Web based family history software

Question Schema.org ?

  • WGroleau
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
11 years 10 months ago #1 by WGroleau
Schema.org ? was created by WGroleau
I almost put this in requests, but I'm not really wanting it, just wondering whether folks knew about it and had considered using any of it.

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.

More
11 years 10 months ago #2 by fisharebest
Replied by fisharebest on topic Schema.org ?
Yes, I know about it.
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
  • Platinum Member
More
11 years 10 months ago #3 by WGroleau
Replied by WGroleau on topic Schema.org ?
New to me. Found it today.

--
Wes Groleau
UniGen.us/

Please Log in or Create an account to join the conversation.

More
11 years 10 months ago #4 by makitso
Replied by makitso on topic Schema.org ?
So, would a genealogy program reference the schematic.org person site directly or, use its taxonomy to define a person with tags that are search friendly?

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.

More
11 years 10 months ago #5 by KosherJava
Replied by KosherJava on topic Schema.org ?

Please Log in or Create an account to join the conversation.

  • WGroleau
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
11 years 10 months ago #6 by WGroleau
Replied by WGroleau on topic Schema.org ?

would a genealogy program reference the schematic.org person site directly

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"

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
  • Visitor
9 years 4 months ago #7 by mampf
Replied by mampf on topic Schema.org?
I'd like to restore this thread (didn't want to create a new one).
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:

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.

(Highlights included by me)

What would it look like:

Instead of:
Code:
<div class="indi_name_details"> <div class="name1"> <dl> <dt class="label">Name</dt> <dd class="field"><span class="NAME" dir="auto" translate="no"><span class= "starredname">Arno</span> Bill <span class="SURN">Nym</span></span></dd> </dl> </div> <div> <dl> <dt class="label">Vornamen</dt> <dd class="field"><span dir="auto"><span class= "starredname">Arno</span> Bill</span></dd> </dl> </div> [..]


It might become:
Code:
<div class="indi_name_details" itemscope itemtype="http://schema.org/Person"> <div class="name1" itemprop="name"> <dl> <dt class="label">Name</dt> <dd class="field"><span class="NAME" dir="auto" translate="no"><span class= "starredname" >Arno</span> Bill <span class="SURN">Nym</span></span></dd> </dl> </div> <div> <dl> <dt class="label">Vornamen</dt> <dd class="field"><span dir="auto"><span class= "starredname">Arno</span> Bill</span></dd> </dl> </div>


So what about JSON-LD?
We could just put a json string next to the person's main div. Like so:
Code:
<script type="application/ld+json"> { "@context": "http://schema.org", "@type": "Person", "name": "Arno Bill Nym" } </script>

(The name would be a start-wouldn't it?)

What I find interesting about JSON-LD:
  1. Can be put anywhere on the page.
  2. Can be easily retrieved by machines using curl*
the second point is most interesting. In the german wikipedia there is a *very* interesting example (but not in the english one) about retrieving data :
Code:
curl -i -L -H "Accept: application/ld+json" "$URL"

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
  • Visitor
9 years 4 months ago #8 by mampf
Replied by mampf on topic Schema.org ?
I'm still trying to find API Docs. No luck so far. I just started a new eclipse project and added webtrees' app-Folder as library path (i.e. git submodule). Seems to work just fine.
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.

More
9 years 4 months ago #9 by fisharebest
Replied by fisharebest on topic Schema.org ?
> 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. 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
  • Visitor
9 years 4 months ago - 9 years 4 months ago #10 by mampf
Replied by mampf on topic Schema.org ?

> 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.

Okay, no Problem. It can wait, see below.

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.
Last edit: 9 years 4 months ago by mampf.

Please Log in or Create an account to join the conversation.

  • bertkoor
  • Offline
  • Platinum Member
  • Platinum Member
  • Greetings from Utrecht, Holland
More
9 years 4 months ago - 9 years 4 months ago #11 by bertkoor
Replied by bertkoor on topic Schema.org ?
I wonder whether it's really worth the trouble to implement this.

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
Last edit: 9 years 4 months ago by bertkoor.

Please Log in or Create an account to join the conversation.

  • mampf
  • Visitor
  • Visitor
9 years 4 months ago #12 by mampf
Replied by mampf on topic Schema.org ?

What I've seen of schema.org/person it's tailored to profiles of living individuals

Headline of schema.org/Person

Thing > Person
A person (alive, dead, undead, or fictional).

Usage: Over 1,000,000 domains


So I'd use it for deceased persons.

whether it's really worth the trouble to implement

It's only a few lines of code. Just putting existing data into an array and apply json_encode().


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
  • Visitor
9 years 4 months ago - 9 years 4 months ago #13 by mampf
Replied by mampf on topic Schema.org ?
Like this?
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/
Last edit: 9 years 4 months ago by mampf.

Please Log in or Create an account to join the conversation.

  • norwegian_sardines
  • Offline
  • Platinum Member
  • Platinum Member
More
9 years 4 months ago #14 by norwegian_sardines
Replied by norwegian_sardines on topic Schema.org ?
OCLC is experimenting with adding the additional meta data for Authors (like an INDI).

< 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
  • Visitor
9 years 4 months ago #15 by mampf
Replied by mampf on topic Schema.org ?
Sure. There is just no API yet to modify the outcome of media.php or individual.php. But the information needs to be on the same page. But with Tabs I can add events and media etc. as subpath on a person.

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.

More
9 years 4 months ago #16 by fisharebest
Replied by fisharebest on topic Schema.org ?
> 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"}

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
  • Visitor
9 years 4 months ago #17 by mampf
Replied by mampf on topic Schema.org ?

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. :-P

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago #18 by LindnerFamilyTree
Replied by LindnerFamilyTree on topic Schema.org ?
Nice to see this being developed.

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
  • Visitor
9 years 4 months ago - 9 years 4 months ago #19 by mampf
Replied by mampf on topic Schema.org ?
I can have a release in a few days, I think.

What is ugly:
Code:
WT_DATE::display(false, '%Y-%m-%d', false)
will give you a string like "between x and y", despite the fact, that I entered a format… not so nice. Needed to use preg_match to see, if the date returned is valid.

// 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? =)
:-)
Last edit: 9 years 4 months ago by mampf.

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago - 9 years 4 months ago #20 by fisharebest
Replied by fisharebest on topic Schema.org ?

difference between full and fullNN on name??


There are comments in the code (Individual.php)
Code:
'type' => $type, 'sort' => $SURN . ',' . $GIVN, 'full' => $full, // This is used for display 'fullNN' => $fullNN, // This goes into the database 'surname' => $surname, // This goes into the database 'givn' => $GIVN, // This goes into the database 'surn' => $SURN, // This goes into the database

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
Last edit: 9 years 4 months ago by fisharebest.

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum