Closed samuel-kerrien closed 4 years ago
Thx again @samuel-kerrien. Fix available from the context
repo.
Thanks !
still digging into google structured data tool but it seems that it does like when @context are supplied as a URI
{ "@context": "https://json-ld.org/contexts/person.jsonld", "@id": "http://dbpedia.org/resource/John_Lennon", "name": "John Lennon", "born": "1940-10-09", "spouse": "http://dbpedia.org/resource/Cynthia_Lennon" }
causes it to throw the error we get. It is strange as the JSON-LD is compliant with the specifications. I will ask around
Curious ...
I have tried to inline the context in that entity and I then get other, more specific errors:
{
"@context": {
"Person": "http://xmlns.com/foaf/0.1/Person",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"name": "http://xmlns.com/foaf/0.1/name",
"nickname": "http://xmlns.com/foaf/0.1/nick",
"affiliation": "http://schema.org/affiliation",
"depiction":
{
"@id": "http://xmlns.com/foaf/0.1/depiction",
"@type": "@id"
},
"image":
{
"@id": "http://xmlns.com/foaf/0.1/img",
"@type": "@id"
},
"born":
{
"@id": "http://schema.org/birthDate",
"@type": "xsd:date"
},
"child":
{
"@id": "http://schema.org/children",
"@type": "@id"
},
"colleague":
{
"@id": "http://schema.org/colleagues",
"@type": "@id"
},
"knows":
{
"@id": "http://xmlns.com/foaf/0.1/knows",
"@type": "@id"
},
"died":
{
"@id": "http://schema.org/deathDate",
"@type": "xsd:date"
},
"email":
{
"@id": "http://xmlns.com/foaf/0.1/mbox",
"@type": "@id"
},
"familyName": "http://xmlns.com/foaf/0.1/familyName",
"givenName": "http://xmlns.com/foaf/0.1/givenName",
"gender": "http://schema.org/gender",
"homepage":
{
"@id": "http://xmlns.com/foaf/0.1/homepage",
"@type": "@id"
},
"honorificPrefix": "http://schema.org/honorificPrefix",
"honorificSuffix": "http://schema.org/honorificSuffix",
"jobTitle": "http://xmlns.com/foaf/0.1/title",
"nationality": "http://schema.org/nationality",
"parent":
{
"@id": "http://schema.org/parent",
"@type": "@id"
},
"sibling":
{
"@id": "http://schema.org/sibling",
"@type": "@id"
},
"spouse":
{
"@id": "http://schema.org/spouse",
"@type": "@id"
},
"telephone": "http://schema.org/telephone",
"Address": "http://www.w3.org/2006/vcard/ns#Address",
"address": "http://www.w3.org/2006/vcard/ns#address",
"street": "http://www.w3.org/2006/vcard/ns#street-address",
"locality": "http://www.w3.org/2006/vcard/ns#locality",
"region": "http://www.w3.org/2006/vcard/ns#region",
"country": "http://www.w3.org/2006/vcard/ns#country",
"postalCode": "http://www.w3.org/2006/vcard/ns#postal-code"
},
"@id": "http://dbpedia.org/resource/John_Lennon",
"@type": "Person",
"name": "John Lennon",
"born": "1940-10-09",
"spouse": "http://dbpedia.org/resource/Cynthia_Lennon"
}
"@type": "Person"
then I get an other error:
http://xmlns.com/foaf/0.1/Person (The type http://xmlns.com/foaf/0.1/Person is not a type known to Google.)
. But I guess that's just a limitation of the Google tool and the types they decided to support.However if I use the type https://schema.org/Person
the error gets more specific (I guess they support that type): I get this error John Lennon (The property http://xmlns.com/foaf/0.1/name is not recognized by Google for an object of type Person.)
. This to me indicates that the context you have tried to bring isn't matching the expectations of the Google validator.
{
"@context": {
"Person": "http://xmlns.com/foaf/0.1/Person",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"name": "http://xmlns.com/foaf/0.1/name",
"nickname": "http://xmlns.com/foaf/0.1/nick",
"affiliation": "http://schema.org/affiliation",
"depiction":
{
"@id": "http://xmlns.com/foaf/0.1/depiction",
"@type": "@id"
},
"image":
{
"@id": "http://xmlns.com/foaf/0.1/img",
"@type": "@id"
},
"born":
{
"@id": "http://schema.org/birthDate",
"@type": "xsd:date"
},
"child":
{
"@id": "http://schema.org/children",
"@type": "@id"
},
"colleague":
{
"@id": "http://schema.org/colleagues",
"@type": "@id"
},
"knows":
{
"@id": "http://xmlns.com/foaf/0.1/knows",
"@type": "@id"
},
"died":
{
"@id": "http://schema.org/deathDate",
"@type": "xsd:date"
},
"email":
{
"@id": "http://xmlns.com/foaf/0.1/mbox",
"@type": "@id"
},
"familyName": "http://xmlns.com/foaf/0.1/familyName",
"givenName": "http://xmlns.com/foaf/0.1/givenName",
"gender": "http://schema.org/gender",
"homepage":
{
"@id": "http://xmlns.com/foaf/0.1/homepage",
"@type": "@id"
},
"honorificPrefix": "http://schema.org/honorificPrefix",
"honorificSuffix": "http://schema.org/honorificSuffix",
"jobTitle": "http://xmlns.com/foaf/0.1/title",
"nationality": "http://schema.org/nationality",
"parent":
{
"@id": "http://schema.org/parent",
"@type": "@id"
},
"sibling":
{
"@id": "http://schema.org/sibling",
"@type": "@id"
},
"spouse":
{
"@id": "http://schema.org/spouse",
"@type": "@id"
},
"telephone": "http://schema.org/telephone",
"Address": "http://www.w3.org/2006/vcard/ns#Address",
"address": "http://www.w3.org/2006/vcard/ns#address",
"street": "http://www.w3.org/2006/vcard/ns#street-address",
"locality": "http://www.w3.org/2006/vcard/ns#locality",
"region": "http://www.w3.org/2006/vcard/ns#region",
"country": "http://www.w3.org/2006/vcard/ns#country",
"postalCode": "http://www.w3.org/2006/vcard/ns#postal-code"
},
"@id": "http://dbpedia.org/resource/John_Lennon",
"@type": "http://schema.org/Person",
"name": "John Lennon",
"born": "1940-10-09",
"spouse": "http://dbpedia.org/resource/Cynthia_Lennon"
}
Now if I replace the "name" by the following vocabulary term: http://schema.org/name
the validator is happy, below is the final payload:
{
"@context": {
"Person": "http://xmlns.com/foaf/0.1/Person",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"name": "http://xmlns.com/foaf/0.1/name",
"nickname": "http://xmlns.com/foaf/0.1/nick",
"affiliation": "http://schema.org/affiliation",
"depiction":
{
"@id": "http://xmlns.com/foaf/0.1/depiction",
"@type": "@id"
},
"image":
{
"@id": "http://xmlns.com/foaf/0.1/img",
"@type": "@id"
},
"born":
{
"@id": "http://schema.org/birthDate",
"@type": "xsd:date"
},
"child":
{
"@id": "http://schema.org/children",
"@type": "@id"
},
"colleague":
{
"@id": "http://schema.org/colleagues",
"@type": "@id"
},
"knows":
{
"@id": "http://xmlns.com/foaf/0.1/knows",
"@type": "@id"
},
"died":
{
"@id": "http://schema.org/deathDate",
"@type": "xsd:date"
},
"email":
{
"@id": "http://xmlns.com/foaf/0.1/mbox",
"@type": "@id"
},
"familyName": "http://xmlns.com/foaf/0.1/familyName",
"givenName": "http://xmlns.com/foaf/0.1/givenName",
"gender": "http://schema.org/gender",
"homepage":
{
"@id": "http://xmlns.com/foaf/0.1/homepage",
"@type": "@id"
},
"honorificPrefix": "http://schema.org/honorificPrefix",
"honorificSuffix": "http://schema.org/honorificSuffix",
"jobTitle": "http://xmlns.com/foaf/0.1/title",
"nationality": "http://schema.org/nationality",
"parent":
{
"@id": "http://schema.org/parent",
"@type": "@id"
},
"sibling":
{
"@id": "http://schema.org/sibling",
"@type": "@id"
},
"spouse":
{
"@id": "http://schema.org/spouse",
"@type": "@id"
},
"telephone": "http://schema.org/telephone",
"Address": "http://www.w3.org/2006/vcard/ns#Address",
"address": "http://www.w3.org/2006/vcard/ns#address",
"street": "http://www.w3.org/2006/vcard/ns#street-address",
"locality": "http://www.w3.org/2006/vcard/ns#locality",
"region": "http://www.w3.org/2006/vcard/ns#region",
"country": "http://www.w3.org/2006/vcard/ns#country",
"postalCode": "http://www.w3.org/2006/vcard/ns#postal-code"
},
"@id": "http://dbpedia.org/resource/John_Lennon",
"@type": "http://schema.org/Person",
"http://schema.org/name": "John Lennon",
"born": "1940-10-09",
"spouse": "http://dbpedia.org/resource/Cynthia_Lennon"
}
My recommendation is maybe not to use that validator for things that you don't intend to put in the Google Knowledge Graph. I am guessing that they are very biased toward their own KG schema and as such you will encounter issues if you don't follow it religiously ;)
I hope that helps ;)
very useful indeed @samuel-kerrien. thx!
Hi guys,
I have just noticed that the term
Access
is actually spelledAccess:
in the following context:https://github.com/datatagsuite/context/blob/master/sdo/access_sdo_context.jsonld