Please do NOT post requests for help here. Use the Help forum for that.
  • Page:
  • 1
  • 2

TOPIC:

Schema.org ? 8 years 1 day ago #1

  • WGroleau
  • WGroleau's Avatar Topic Author
  • Offline
  • Gold
  • Gold
  • Posts: 1612
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/
PHP 7.2.15; MySQL 5.6.40; Apache

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

Schema.org ? 8 years 1 day ago #2

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 13693
Yes, I know about it.
Yes, I am interested in using it.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

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

Schema.org ? 8 years 1 day ago #3

  • WGroleau
  • WGroleau's Avatar Topic Author
  • Offline
  • Gold
  • Gold
  • Posts: 1612
New to me. Found it today.
--
Wes Groleau
UniGen.us/
PHP 7.2.15; MySQL 5.6.40; Apache

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

Schema.org ? 8 years 1 day ago #4

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 ( beta GitHub)
PHP 7.4.6, MariaDB 10.1.44, Apache 2.4.43,
Hosted at tigertech.net

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

Schema.org ? 8 years 1 day ago #5

  • KosherJava
  • KosherJava's Avatar
  • Offline
  • Frequent
  • Frequent
  • Posts: 512
hershfeld.com/family/ (webtrees git dev)
PHP: 5.6.15, MySQL: 5.5.42

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

Schema.org ? 8 years 1 day ago #6

  • WGroleau
  • WGroleau's Avatar Topic Author
  • Offline
  • Gold
  • Gold
  • Posts: 1612

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/
PHP 7.2.15; MySQL 5.6.40; Apache

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

Schema.org? 5 years 5 months ago #7

  • mampf
  • mampf's Avatar
  • Visitor
  • Visitor
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:
<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:
<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:
<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 :
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.

Schema.org ? 5 years 5 months ago #8

  • mampf
  • mampf's Avatar
  • Visitor
  • Visitor
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.

Do you need a web hosting solution for your webtrees site?
If you prefer a host that specialises in webtrees, the following page lists some suppliers able to provide one for you: 

Schema.org ? 5 years 5 months ago #9

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 13693
> 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 - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

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

Schema.org ? 5 years 5 months ago #10

  • mampf
  • mampf's Avatar
  • Visitor
  • Visitor

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

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

Last edit: by mampf.

Schema.org ? 5 years 5 months ago #11

  • bertkoor
  • bertkoor's Avatar
  • Offline
  • Platinum
  • Platinum
  • Greetings from Utrecht, Holland
  • Posts: 2099
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 v1.7.13

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

Last edit: by bertkoor.

Schema.org ? 5 years 5 months ago #12

  • mampf
  • mampf's Avatar
  • Visitor
  • Visitor

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.

Schema.org ? 5 years 5 months ago #13

  • mampf
  • mampf's Avatar
  • Visitor
  • Visitor
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/

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

Last edit: by mampf.

Schema.org ? 5 years 5 months ago #14

  • norwegian_sardines
  • norwegian_sardines's Avatar
  • Offline
  • Gold
  • Gold
  • Posts: 1802
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.

Schema.org ? 5 years 5 months ago #15

  • mampf
  • mampf's Avatar
  • Visitor
  • Visitor
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.

Schema.org ? 5 years 5 months ago #16

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 13693
> 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 - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

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

Schema.org ? 5 years 5 months ago #17

  • mampf
  • mampf's Avatar
  • Visitor
  • 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. :-P

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

Schema.org ? 5 years 5 months ago #18

  • LindnerFamilyTree
  • LindnerFamilyTree's Avatar
  • Offline
  • New
  • New
  • Posts: 49
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.

Schema.org ? 5 years 5 months ago #19

  • mampf
  • mampf's Avatar
  • Visitor
  • Visitor
I can have a release in a few days, I think.

What is ugly:
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? =)
:-)

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

Last edit: by mampf.

Schema.org ? 5 years 5 months ago #20

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 13693

difference between full and fullNN on name??


There are comments in the code (Individual.php)
'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 - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

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

Last edit: by fisharebest.
  • Page:
  • 1
  • 2
Powered by Kunena Forum