Linking in JSON Exceptions to the general rules
Copyright © 2015 Open Geospatial Consortium.
29 the expected size of the object. For convenience the reason for the link can be
encapsulated in a “link” key. In the following example, we are relating linking the representation of the Rio Negro
river in Wikipedia with the Amazon river and also to a metadata record better describing the Rio Negro.
{ type: pg:River,
id: wiki:Rio_Negro_Amazon, tributes:
{ href: wiki:Amazon_River,
type: pg:River, },
links: {
id: wiki:Rio_Negro_Amazon, via:
{ type: atom:link,
MIMEtype: applicationxml, href: http:www.river.comMetadataRioNegro.xml,
title: XML metadata for the Rio Negro river, length: 1523,
} }
}
Using the following context:
context: {
atom: http:www.w3.org2005Atom, wiki: http:en.wikipedia.orgwiki,
pg: http:physicalgeography.schema.org, id: id,
href: id, type: type,
MIMEtype: atom:type, links: _:,
via: atom:via, title: atom:title,
length: atom:length, tributes: pg:tributes,
}
30
Copyright © 2015 Open Geospatial Consortium.
We can automatically transform the JSON file into RDF where the relations between objects are highlighted in
green .
http:en.wikipedia.orgwikiRio_Negro_Amazon http:www.w3.org19990222-rdf-syntax-nstype
http:physicalgeography.schema.orgRiver . http:en.wikipedia.orgwikiRio_Negro_Amazon
http:physicalgeography.schema.orgtributes http:en.wikipedia.orgwikiAmazon_River .
http:en.wikipedia.orgwikiAmazon_River http:www.w3.org19990222-rdf-syntax-nstype
http:physicalgeography.schema.orgRiver . http:en.wikipedia.orgwikiRio_Negro_Amazon
http:www.w3.org2005Atomvia http:www.river.comMetadataRioNegro.xml .
http:www.river.comMetadataRioNegro.xml http:www.w3.org19990222-rdf-syntax-nstype
http:www.w3.org2005Atomlink . http:www.river.comMetadataRioNegro.xml
http:www.w3.org2005Atomlength 1523http:www.w3.org2001XMLSchemainteger .
http:www.river.comMetadataRioNegro.xml http:www.w3.org2005Atomtitle
XML metadata for the Rio Negro river . http:www.river.comMetadataRioNegro.xml
http:www.w3.org2005Atomtype applicationxml .
Recommendation 10: Include in a best practice for JSON a subclause for linking to other objects in JSON, using the natural approaches that JSON-LD provides for both simple links and atom links.
Target: OWS Common.SWG