Here is a sample JSON-LD document:
1 2 3 4 5 6 7 8 9 10 11 |
{ "@context": { "sc": "https://schema.org/", "sp": "https://schema.parkeon.com/", "ssp": "https://{domain}/{platform}/" }, "@id": "ssp:businesscustomer/parks/V1/parks/123", "@type": "sp:Park", "sp:city": { "@id": "ssp:cities/Paris"}, "sc:name": "Eiffel Tower park" } |
Explanation:
●Lines 2-6 contain JSON-LD context used to interpret the rest of the document. This simple context defines only a few short hands.
●Line 7 contains the unique identifier of the resource represented by this document. In this case it is https://{domain}/{platform}businesscustomer/parks/V1/parks/123. Encoded using the "ssp" short hands defined in the context.
●Line 8 contains the URI of the definition of the schema of this document.
●Line 9 contains a hyper-link to another resource.
●Line 10 contains a sample property of this resource.
The same document can be represented in multiple ways. Below are two equivalent representations:
Expanded form:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
[ { "@id": "https://{domain}/{platform}/businesscustomer/parks/V1/parks/123", "@type": [ "https://{domain}/{platform}/businesscustomer/parks/V1" ], { "@value": "Eiffel Tower Park" } ], "https://schema.parkeon.com/city": [ { "@id": "https://{domain}/{platform}/cities/Paris" } ] } ] |
Compacted with empty context:
1 2 3 4 5 |
{"@id": "https://{domain}/{platform}/businesscustomer/parks/V1/parks/123", "@type": "https://schema.parkeon.com/Park", "https://schema.org/name": "Eiffel Tower Park", "https://schema.parkeon.com/city": { "@id": "https://{domain}/{platform}/cities/Paris" } } |