- Posts: 2163
Question Schema.org ?
- WGroleau
- Topic Author
- Offline
- Platinum Member
Schema.org/Person
Apparently some search engines take advantage of it if it's there to make their results pages better.
--
Wes Groleau
UniGen.us/
Please Log in or Create an account to join the conversation.
- fisharebest
- Offline
- Administrator
Yes, I am interested in using it.
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- WGroleau
- Topic Author
- Offline
- Platinum Member
- Posts: 2163
- makitso
- Offline
- Administrator
Rob
www.skatekey.net ( webtrees 2.1 beta GitHub)
webtrees forum admin
Author custom css module
PHP 8.1.21
Hosted at tigertech.net
Please Log in or Create an account to join the conversation.
- KosherJava
- Offline
- Premium Member
- Posts: 518
Please Log in or Create an account to join the conversation.
- WGroleau
- Topic Author
- Offline
- Platinum Member
- Posts: 2163
I sent them feedback suggesting more examples. Kind of hard to deal with "check out this long list of properties. Stick them in your HTML someplace"would a genealogy program reference the schematic.org person site directly
But there is a meager example on their main page, schema.org (no tic involved)
--
Wes Groleau
UniGen.us/
Please Log in or Create an account to join the conversation.
- mampf
- Visitor
As far as I can see, there is documentation availabe on schema.org/Person .
Which format to use?
So there is microdata and RDFa (and json, but let's put that aside for a while, as it doesn't integrate with html too well).
on Stackoverflow ( stackoverflow.com/a/9066702/1549977 ) they say:
(Highlights included by me)For example, Google says in their FAQ that they will only process microdata (though the testing tool does now work with RDFa, so it is possible that they accept RDFa).
Unless you know that your target consumer only accepts RDFa, you are probably best going with microdata.
What would it look like:
Instead of:
It might become:
So what about JSON-LD?
We could just put a json string next to the person's main div. Like so:
(The name would be a start-wouldn't it?)
What I find interesting about JSON-LD:
- Can be put anywhere on the page.
- Can be easily retrieved by machines using curl*
Interesting, huh? We'd just need to insert into individual.php a simple check for accept-header to return JUST the javascript. There is even a php function to support it.
Pros of JSON-LD:
- Doesn't mess the HTML code with props
- Google likes it
- Easily retrieved using "Accept:"-Header
- MUCH easier to implement. Module possible.
So what do you think? There has been some activity in the past three years. Sounds promising to me. I'd go for a module with json-ld. Perhaps I can free up some time and create one? But if someone else could spend some time on it, I'd be happy about it.
Please Log in or Create an account to join the conversation.
- mampf
- Visitor
I didn't find a hook or filter to modify individual.php completely, so I'll just start putting javascript and pre-formatted code into a tab for public persons. Would be a start.
@Greg: How do I intercept loading of individual.php, So I can respond with a complete alternate site as suggested below (accept-header)? Thanks.
As soon as I have a stable set up, I'll put the code on github and will create some documentation on how to develop a module.
Best regards
Ben
Please Log in or Create an account to join the conversation.
- fisharebest
- Offline
- Administrator
There is nothing like that. After the 1.7.0 release is complete, I plan to convert webtrees to use a modern PHP framework. But this requires PHP5.4, and we still support PHP5.3.
To start, I suggest creating a module. You could access it (using curl) with a URL such as
example.com/webtrees/module.php?mod=my-api&mod_action=individual&format=json-ld&...
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- mampf
- Visitor
Okay, no Problem. It can wait, see below.> I didn't find a hook or filter to modify individual.php completely
There is nothing like that. After the 1.7.0 release is complete, I plan to convert webtrees to use a modern PHP framework.
To start, I suggest creating a module. You could access it (using curl) with a URL such as
example.com/webtrees/module.php?mod=my-api&
This won't work for me, because the information should be accessible on the same URL. So I will go for a new tab for now, which will contain the script snippet and for debugging reasons a pre-tag with the information printed.
But this requires PHP5.4, and we still support PHP5.3.
Sure. Remember, PHP 5.4 is almost out of support (which ends September 2015 according to wikipedia) and PHP5.3 is out of support since 08/2014. I know, a lot of cheap hosts do "maintain" old versions. Debian 6 (which is outdated as well) contains php 5.3, so it's a good idea to not drop php5.3 support, agreed.
convert webtrees to use a modern PHP framework
I'd love to see hooks as in wordpress - I'd hijack individual.php if the quoted header is sent, and otherwise used a footer hook to put it invisibly at the botton.
Nevertheless, I took a look at the code and found it very impressive and mature.
So, a new tab it will be. Persons only. It's a start.
Please Log in or Create an account to join the conversation.
- bertkoor
- Offline
- Platinum Member
- Greetings from Utrecht, Holland
If you're doing this just for fun (or because you can) then fine.
If you're doing this to get higher up the Google page ranks, well I dunno...
Whenever I use Google to seach for yet unknown personal data in my tree, I get my own pages back since these are already ranked quite near to the absolute top. What I've seen of schema.org/person it's tailored to profiles of living individuals: nice for social media like Facebook, LinkedIn etc. Do you really want to attract head hunters and receive job offers for people that deceised centuries ago?
stamboom.BertKoor.nl runs on webtrees v2.1.20
Please Log in or Create an account to join the conversation.
- mampf
- Visitor
Headline of schema.org/PersonWhat I've seen of schema.org/person it's tailored to profiles of living individuals
Thing > Person
A person (alive, dead, undead, or fictional).
Usage: Over 1,000,000 domains
So I'd use it for deceased persons.
It's only a few lines of code. Just putting existing data into an array and apply json_encode().whether it's really worth the trouble to implement
Well for what I do this:
Not only just for fun or google ranking or having headhunters, but also for just delivering data in a machine-readable, well-known format. I think it's worth it, who knows what use cases we will have in the near future. At the moment, Google (why always just Google???) has two use cases according to their site :
1. Nicer result (image, data...)
2. Usage in knowledge graph.
So it's not an important thing, but as said, who knows what will be. Perhaps someone will crawl all webtrees domains and insert all data into an elastic search cluster. Dunno.
Please Log in or Create an account to join the conversation.
- mampf
- Visitor
test.bmarwell.de/individual.php?pid=I67&ged=AllGED#jsonld
Works for me, pushing to github in a few days, adding a readme and putting in more information.
Also had a look at the 1.7 API. Looks great, looking forward to using it!
Comments appreciated.
// Edit:
Use Google Rich snippet testing tool for validation:
developers.google.com/structured-data/testing-tool/
Please Log in or Create an account to join the conversation.
- norwegian_sardines
- Offline
- Platinum Member
- Posts: 3096
< schema.org/familyName > "Rowling" ;
< schema.org/givenName > "J. K." ;
< schema.org/name > "Rowling, J. K." .
I would also suspect that we should be doing these type of things for Sources and Events so www cataloging can index some of this information as well.
Ken
Please Log in or Create an account to join the conversation.
- mampf
- Visitor
I'll make my plugin pretty and releade it, and when there is a API, I'll add places etc.
Btw, I need to use arrays over objects, because json_encode() will take the variable name as json key, but the key needs to have an @ in it, which again is not supported by php variable names.
Please Log in or Create an account to join the conversation.
- fisharebest
- Offline
- Administrator
It is supported. You just need to refer to it via a variable. e.g.
php > $x="@fish";
php > $y=new stdClass;
php > $y->$x="best";
php > echo json_encode($y);
{"@fish":"best"}
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- mampf
- Visitor
fisharebest wrote: > the key needs to have an @ in it, which again is not supported by php variable names.
It is supported. You just need to refer to it via a variable. e.g.
php > $x="@fish";
php > $y=new stdClass;
php > $y->$x="best";
php > echo json_encode($y);
{"@fish":"best"}
And it's hard to read and will lead to complicated code. Perhaps I will just use a toarray-method which will add the needed keys and values to the result and strips keys with empty values.
I just started to like php for namespaces (like packages and import in java) you use in the current master branch. But this is so ugly... Says a java dev.
Please Log in or Create an account to join the conversation.
- LindnerFamilyTree
- Offline
- New Member
Is this to become part of the core code or will it be an optional download and install?
Please Log in or Create an account to join the conversation.
- mampf
- Visitor
What is ugly:
// Edit:
Updated dev site:
test.bmarwell.de/individual.php?pid=I218&ged=AllGED
Link to test tool: developers.google.com/structured-data/te...26theme%253Dwebtrees
@Greg
Two API Change requests (will open github issue for each)
1.) API functions should not return html code if not requested. => difference between full and fullNN on name??
2.) date->display should not return words if format string is given, unless requested.
3.) Am I missing a function perhaps, that would suit me better?
Please Log in or Create an account to join the conversation.
- fisharebest
- Offline
- Administrator
difference between full and fullNN on name??
There are comments in the code (Individual.php)
An individual with an unknown surname ("1 NAME John //") would have a display name of "John" but be stored in the database as "John @N.N.".
This allows us to distinguish an individual with no surname from an individual with an unknown surname.
Also, "Mc" and "Mac" prefixes are normalised in fullNN, so that we may sort/group the names correctly.
2.) date->display should not return words if format string is given, unless requested.
Why not. If the date is "BET 17 FEB 2000 AND 21 DEC 2004", then the format allows us localise the date.
en-gb = between 17 February 2000 and 21 December 2004
en-us = between February 17, 2000 and December 21, 2004
It is also necessary for proper localisation. For example "DEC 2004" would require the nominative form of December, while "21 DEC 2004" would require the genitive form. OK, these are the same in English, but are different in other languages. To understand the difference, consider:
"Twenty first of December"
In other languages "of December" is an inflected form, such as "December-da".
3.) Am I missing a function perhaps, that would suit me better?
A "GEDCOM date" consists of a qualifier (before, about, between, after, estimated, etc.) and one or two actual dates. You can work on the individual components as follows:
$date->minimumDate()->format()
$date->maximumDate()->format()
Consider also that dates may be written in other calendars, as well as Gregorian/Julian. webtrees also supports dates in Hebrew, French Republican, Arabic and Persian calendars. The date "1560-04-22" could mean 5 different things!
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.