Copyright © 2015 Open Geospatial Consortium.
27
cit:address cit:CI_Address
cit:deliveryPoint gco:CharacterStringParc de
Montjuà ¯cgco:CharacterString
cit:deliveryPoint cit:city
gco:CharacterStringBarcelonagco:CharacterString cit:city
cit:postalCode gco:CharacterStringE-
08038gco:CharacterString cit:postalCode
cit:electronicMailAddress gco:CharacterStringcentre.atencioicc.catgco:CharacterStri
ng cit:electronicMailAddress
cit:CI_Address cit:address
cit:CI_Contact cit:contactInfo
cit:CI_Organisation cit:party
cit:CI_Responsibility mdb:contact
mdb:MD_Metadata
should be encoded in JSON like this:
{ type: mdb:MD_Metadata,
contact:{ type: cit:CI_Responsibility,
party: { type: cit:CI_Organisation,
name: Institut Cartogràfic de Catalunya ICC, contactInfo: {
type: cit:CI_Contact, address: {
type: cit:CI_Address, deliveryPoint: Parc de Montjuïc,
city: Barcelona, postalCode: E-08038,
electronicMailAddress: centre.atencioicc.cat }
} }
}
28
Copyright © 2015 Open Geospatial Consortium.
}
NOTE: There is also a project that is targeting the encoding of ISO and FGDC metadata in JSON: https:github.comadiwg
Recommendation 9: Include adding type keys to JSON objects as a good practice to makethe transition to JSON-LD and RDF easier. It is also good practice that type names are qualified with a
abbreviated namespaces e.g.: ows:ServiceIdentification that could be later dereferenced using JSON-LD context.
Target: OWS Common with OAB
The GML case is even more special because GeoJSON should be considered and an alternative encoding for vector features. GeoJSON can be extended to fully support all
geospatial types that GML support if needed. Nevertheless, OGC membership can perhaps select another approach that would be more suitable in the future
6.1.2.2 Linking in JSON
NOTE: This section is a response to the demand expressed in the CR-242 OGC 12-121 requesting that OWS Common includes a recommendation for expressing links in JSON that can allow for a functionally
similar to the one provided by XLink.
Many OGC standards use xlink or other similar forms of links to relate elements in the same document or in a remote document. A direct translation of these links will not result
in the right conversion to JSON-LD. In a general case, there is a need for encoding the source of the link, a target url, the reason why this link is required, the title of the link, the
MIME type recovered from the link and the expected size.
There are several encodings proposed in the Internet to do this in JSON but none of them are gaining more momentum than others. Some of them can be seen here:
http:json-schema.orglinks http:amundsen.commedia-typescollectionexamples
https:github.comkevinswibersiren https:gist.github.commiyagawa1912431
http:tools.ietf.orghtmldraft-kelly-json-hal-06 http:blog.cto.hivrelations-in-linked-data
It is difficult to find arguments in favor of a particular approach until a conversion into JSON-LD is explored. In JSON-LD all objects need to have a key that is considered a
synonymous to “id”. This key can be a target of any relation. A relation can be established in source object as an attribute with a key name stating the reason of the link
that can be mapped with the atom link rel values. This key will also be a link object with extra properties. The object will have an key synonymous of “id” is considered the
target object and a key synonymous of “type” indicating that this is a “link” object in the “atom” namespace. The object can have extra parameters about the MIMEtype and
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,
}