3 ms·
The first line of the example on the JSON-LD website is: "@context": "https://json-ld.org/contexts/person.jsonld", This is a 'context map', which is what li
by seabass-labrax 4y ago
The first line of the example on the JSON-LD website is:
"@context": "https://json-ld.org/contexts/person.jsonld",
This is a 'context map', which is what links the short name "spouse" for the JSON key to a particular class defined in a RDF (Resource Description Framework) ontology. Here, that's <https://schema.org/spouse https://schema.org/spouse>. These ontologies are what make it unambiguous to the parser that the content is a IRI/URL rather than a literal string.
Alternatively, one can write JSON-LD without a context map by using the full IRI of the class as the key:
"https://schema.org/spouse": "https://json-ld.org/contexts/person.jsonld",