You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

  • Assumption: Whatever schemas our WG comes up with for resources, they will need to be locally extensible.

  • Questions: Is it possible to implement APIs so that resource properties the recipient doesn’t know about can be ignored/skipped? If so, how?

One way

I'd also like to expose a JSON-LD representation of my resources. JSON-LD is fine with multiple vocabularies and you can in fact 'ignore' properties by not defining them in the @context. This means this is my source (note that I shortened the polygon value for readability):

{
"@context": {
"geo": "http://schema.org/geo",
"polygon": "http://schema.org/polygon"
},
"@type": "http://schema.org/Place",
"ID": 1,
"MUNICIPALITY": "Leeuwarden",
"WATER": "NO",
"geo": {
"@type": "http://schema.org/GeoShape",
"polygon": "53.24330130 ... 2536921"
}
}

From a Linked Data and JSON-LD point of view this is completely correct. The properties ID, MUNICIPALITY and WATER aren't mapped in the @context so the parsers ignore this. However, the Structured Data Testing Tool reports errors that those properties aren't known as properties of http://schema.org/Place. The same errors occur when I map those values to another (my own) vocabulary.


  • No labels