<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Coverages, JSON-LD and RDF Data Cubes</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>J.D. Blower?</string-name>
          <email>j.d.blower@reading.ac.uk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>M. Riechert</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Meteorology, University of Reading</institution>
          ,
          <country country="UK">United Kingdom</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Many kinds of scienti c data, including satellite imagery, climate simulations and sensor data, can be represented as coverages, which are essentially mappings from points in space and time to data values. Coverage data are typically encoded as multidimensional arrays in compact binary forms such as NetCDF, HDF and GeoTIFF, most of which require specialist knowledge and tools to process and manipulate. There is considerable current interest in helping the wider Web community use coverage data, by providing data in more general formats such as JSON and RDF, and by using commonly-accepted vocabularies. This short discussion paper outlines some current work in the area and highlights some of the main inherent issues.</p>
      </abstract>
      <kwd-group>
        <kwd>Coverages</kwd>
        <kwd>RDF</kwd>
        <kwd>JSON-LD</kwd>
        <kwd>Semantic Web</kwd>
        <kwd>e ciency</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        A coverage is a general data structure that can hold many di erent kinds of
geospatial and temporal data. It is de ned in the ISO19123 speci cation [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] as
a \feature that acts as a function to return values from its range for any direct
position within its spatial, temporal or spatiotemporal domain". Essentially, a
coverage maps a set of positions in space and time to data values. Examples of
coverage data include satellite imagery, results from simulations of weather and
climate, ow data from river gauges, wind observations from radiosondes and
much more. It is important to note that coverages can be gridded or non-gridded
in nature (the term \coverage" is sometimes used as a synonym for \gridded"
or \raster" data but this is not the case).
      </p>
      <p>
        Coverages are typically published on the Web in one of two ways: (i) as static
les, in formats such as GeoTIFF, NetCDF [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] and HDF [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]; or (ii) through
web APIs such as the Web Coverage Service (WCS) [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ] or OPeNDAP [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. Users
from outside a selection of specialist communities often nd it hard to access
and understand coverage data, for reasons including complexity, unfamiliarity
and large data size.
      </p>
      <p>
        The user base of coverage data could potentially be widened if it were possible
to make data available in more general formats that are familiar to the Web and
Semantic Web communities. In addition, the use of well-de ned vocabularies
would help to describe coverage data better, and help it to be related more
accurately to other related data sources. Therefore, it is interesting to consider
how coverage data could be encoded in RDF [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], and to what extent this is
practical and usable.
      </p>
      <p>The joint OGC/W3C \Spatial Data on the Web" working group1 is
developing several strands of work in this area, and this work has been partly motivated
by the activities of this group. This short paper highlights some of the issues
revealed, with the intention of stimulating discussion. It is not intended to be
a complete treatment of this complex area, nor does it represent the totality of
the work of the group.
2</p>
    </sec>
    <sec id="sec-2">
      <title>The main elements of a Coverage</title>
      <p>
        A useful general structure for a Coverage can be found in the Open
Geospatial Consortium Coverage Implementation Schema (CIS) [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], which specialises
ISO19123. In summary, a coverage consists of three main pieces of information:
{ The domain, which encodes the set of points in space and time for which
data values exist.
{ The range, which is the set of data values themselves.
      </p>
      <p>{ The range metadata, which describes the range values (e.g. units of measure).
The only structural di erence between di erent types of coverage (images,
timeseries, vertical pro les etc.) is the spatiotemporal geometry and topology of the
domain. The range and range metadata can be encoded consistently, irrespective
of the domain type.</p>
      <p>(We note that an alternative model is possible, in which the domain and
range are interleaved. This model can be convenient in some cases { for example
where streaming capabilities are required { but we do not discuss it further in
this paper.)
3</p>
    </sec>
    <sec id="sec-3">
      <title>CoverageJSON and JSON-LD</title>
      <p>
        CoverageJSON (or \CovJSON" for short) is a JSON-based [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] format that we
have developed for encoding coverage data. It is primarily intended to be used
as a means to convey data from servers to web browsers, so that web developers
can develop rich, highly interactive applications based on coverage data. The
primary goals of CovJSON are usability and e ciency. The format is described
more fully at https://covjson.org, but notable features include:
{ The ability to encode a large range of domain types (grids, timeseries,
trajectories, polygonal representations, and more).
{ The ability to separate information between documents, which are linked
together (e.g. the range can be held in a separate document), enabling more
convenient treatment of large data sets.
1 https://www.w3.org/2015/spatial/
{ The use of URIs to encode semantic information.
      </p>
      <p>A sample CovJSON document is given in Appendix A.</p>
      <p>
        CovJSON makes use of JSON-LD [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], a means of representing RDF data in
JSON. Through the use of a JSON-LD context le, the objects and properties in
a CovJSON le can be converted to URIs and triples. An important \tension"
in our development of CovJSON has been balancing the desire to use
JSONLD (to enable automated conversion to RDF) with the desire to maintain the
readability and simplicity of the format. We believe that it is of great importance
that users should be able to use and understand CovJSON without the need to
understand JSON-LD or RDF { hence we have used simple and idiomatic JSON
as our starting point, using JSON-LD to enable some degree of interoperability
with RDF, accepting the limitations of doing so for now.
      </p>
      <p>The result of converting the CovJSON document in Appendix A to RDF,
using the information in the currently-supplied JSON-LD context document, is
shown in Appendix B. It can be seen that the range metadata (coming from the
CovJSON Parameter objects) is well represented in the resulting RDF, as well
as the domain type (a two-dimensional grid in this case) and certain domain
metadata such as the coordinate reference systems (CRSs). However, the actual
data values that make up the domain and range do not survive the conversion.
Other information is also missing, such as the mapping between the axes of the
domain and the coordinate reference systems.</p>
      <p>The two main reasons for this are:
1. Much of a coverage's data is array-based in CovJSON, including the range
and key parts of the domain. JSON arrays can be converted to RDF lists
through JSON-LD, but this is probably not a usable way to represent arrays
that can potentially be very large.
2. CovJSON uses data structures that are equivalent to associative arrays. The
keys of these arrays are important and are used to map between di erent
pieces of information in the CovJSON document. For example, the arrays
representing each variable in the coverage are keyed to short identi er strings,
which are also used in Parameters { see the use of \TEMP" in Appendix A.
These keys cannot be easily converted to an RDF representation with the
current version of JSON-LD (a change to JSON-LD has been requested and
may appear in future versions 2). One potential solution is to craft a di erent
JSON-LD context document for each CovJSON document, but we feel it
would be much more desirable to use a single, standard context document
that works across all CovJSON documents.</p>
      <p>We therefore conclude that, for the foreseeable future, the automated \full"
conversion of CovJSON to RDF will remain limited. However, some applications
may nd the resulting limited RDF useful, particularly for describing the range
metadata and the types of the main objects in the coverage. Applications that
do not require RDF will hopefully appreciate the simple nature of the format
and the use of URIs to bring in some semantic content.
2 https://github.com/json-ld/json-ld.org/issues/430</p>
    </sec>
    <sec id="sec-4">
      <title>DataCube</title>
      <p>
        The RDF Data Cube vocabulary [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] provides an general means for encoding
multidimensional data. Although not speci cally designed for representing
coverage data, coverages are certainly (in general) multidimensional objects that
share many of the characteristics of a Data Cube. We have not yet attempted to
encode coverage data using the Data Cube vocabulary, but are aware of e orts
ongoing elsewhere [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. We would therefore like to stimulate discussion about
whether the Data Cube is the most useful RDF representation of a coverage. If
this is the case, then we may be able to treat the Data Cube representation as the
\canonical" RDF coverage encoding and provide tools for converting CovJSON
to Data Cubes. There should be enough information in the CovJSON document
to be able to perform this conversion unambiguously.
      </p>
      <p>In fact, the way in which CovJSON models coverages is conducive to such
a conversion. In CovJSON, all types of domain are modelled using a set of
orthogonal axes, even where the domain consists of polygons. Each of these axes
could map neatly to a dimension in the data cube. (It is worth noting that CIS
does not always model domains using orthogonal axes, and so conversion from
CIS to Data Cube may be less obvious in some cases.)</p>
      <p>The Data Cube vocabulary is designed to encode statistical data, in which
the dimensions of the data cube are relatively small and unordered. The axes
of a coverage can be large (satellite images can be tens of thousands of pixels
across) and ordering of the axis values is important. Therefore the Data Cube
vocabulary may require some specialisation to re ect this.</p>
      <p>As with CovJSON and JSON-LD, the encoding of the range values
(particularly for large coverages) will be an important issue to resolve. Possible solutions
include:
1. encode the range values individually as RDF triples, which will be very
ine cient for large coverages;
2. de ne a microformat (i.e. encode all range values in a single long string).</p>
      <p>This will be more e cient, but less exible and still problematic for large
coverages; or
3. encode the range values in a separate document in a more e cient format.</p>
      <p>The last option is likely to be the most productive. Various formats for the
range are possible, but one attractive possibility is CovJSON itself, which
provides a JSON encoding for a standalone multidimensional array (this can be
compressed during data transfer for much greater e ciency). It may also, of
course, be possible to use binary formats like NetCDF for this purpose. But
many of these formats encode the full coverage (not just the range), and care
must be taken to ensure that the RDF representation of the domain is consistent
with that in the linked le.</p>
    </sec>
    <sec id="sec-5">
      <title>Summary</title>
      <p>
        RDF can provide a highly expressive means to encode coverage information.
Through the use of other vocabularies that provide contextual information (such
as DCAT [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] for dataset-level descriptions and PROV [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] for provenance
information) it may become possible to describe the whole \coverage ecosystem"
consistently in RDF, which would be a great bene t to data managers and users.
Much work needs to be done to work out how these vocabularies should work
with each other, and how systems like Observations and Measurements [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] can
best be used.
      </p>
      <p>CovJSON provides a general data model for a wide range of coverages (based
on CIS concepts), making signi cant use of semantic information. It de nes
a kind of ontology for coverages, although currently not a complete one. The
incompleteness is partly due to the current limitations of the current version of
JSON-LD. The RDF Data Cube may provide a more useful \canonical" RDF
format, and we are hopeful that CovJSON and DataCube representations are
su ciently conceptually similar that they can be converted readily to each other.
This would be an interesting area of research.</p>
      <p>
        The Semantic Sensor Network (SSN) [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] provides another abstract model
that could probably be specialised or extended to act as a representation of
coverages. Like the RDF Data Cube, it would need to be endowed with concepts
of things like dimensions, coordinate reference systems and so forth. This could
be an interesting area of discussion and research.
      </p>
      <p>It is likely that any attempt to encode coverages as RDF will meet practical
limitations in encoding the range values (and, in some cases, the domain values).
Given that range values will probably be given in separate documents outside
the \RDF world" it is critical that the RDF and non-RDF information can be
related unambiguously to each other.
A</p>
    </sec>
    <sec id="sec-6">
      <title>Sample CoverageJSON document</title>
      <p>This is a coverage that measures a single parameter (air temperature) on a
regular global grid of 1 degree resolution.
{
"type" : "Coverage",
"domain" : {
"type": "Domain",
"domainType": "Grid",
"axes": {
"x": { "start": -179.5, "stop": 179.5, "num": 360 },
"y": { "start": -89.5, "stop": 89.5, "num": 180 },
"t": { "values": ["2013-01-13T00:00:00Z"] }
},
"referencing": [{
"coordinates": ["x","y"],
"system": {
"type": "GeographicCRS",
"id": "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
}
}, {
"coordinates": ["t"],
"system": {
"type": "TemporalRS",
"calendar": "Gregorian"
}]</p>
      <p>}
},
"parameters" : {
"TEMP": {
"type" : "Parameter",
"description" : {</p>
      <p>"en": "The air temperature measured in degrees Celsius."
},
"unit" : {
"label": {</p>
      <p>"en": "Degree Celsius"
},
"symbol": {
"value": "Cel",
"type": "http://www.opengis.net/def/uom/UCUM/"
}
},
"observedProperty" : {
"id" : "http://vocab.nerc.ac.uk/standard_name/air_temperature/",
"label" : {
"en": "Air temperature",
"de": "Lufttemperatur"
}
B
}
}
}</p>
      <p>}
},
"ranges" : {
"TEMP" : "http://example.com/coverages/123/TEMP"</p>
    </sec>
    <sec id="sec-7">
      <title>Result of converting CoverageJSON document to RDF via JSON-LD</title>
      <p>The following document (in the Turtle notation) shows the result of
automatically converting the coverage from Appendix A to RDF using the JSON-LD
context. Some information has been omitted for brevity and clarity.
&lt;http://example.com/mycoverage&gt; a covjson:Coverage;
covjson:domain [
a covjson:Domain;
covjson:domainType covjsondt:Grid;
covjson:referencing: [</p>
      <p>covjson:referenceSystem: &lt;http://www.opengis.net/def/crs/OGC/1.3/CRS84&gt;
], [
covjson:referenceSystem: [
a inspiregloss:TemporalReferenceSystem ;
covjson:calendar: &lt;http://www.opengis.net/def/uom/ISO-8601/0/Gregorian&gt; .
]
] ;
covjson:parameter [
a covjson:Parameter ;
dct:description "The air temperature measured in degrees Celsius."@en ;
qudt:unit [
qudt:symbol "Cel"^^&lt;http://www.opengis.net/def/uom/UCUM/&gt; ;
skos:prefLabel "Degree Celsius"@en
] ;
ssn:observedProperty &lt;http://vocab.nerc.ac.uk/standard_name/air_temperature/&gt;
] .
&lt;http://www.opengis.net/def/crs/OGC/1.3/CRS84&gt; a ignf:GeodeticCRS .
&lt;http://vocab.nerc.ac.uk/standard_name/air_temperature/&gt;
skos:prefLabel "Lufttemperatur"@de ;
skos:prefLabel "Air temperature"@en .</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Bray</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>The JavaScript Object Notation (JSON) Data Interchange Format</article-title>
          .
          <source>RFC 7159</source>
          , RFC Editor (
          <year>March 2014</year>
          ), http://www.rfc-editor.org/rfc/rfc7159.txt
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Candan</surname>
            ,
            <given-names>K.S.</given-names>
          </string-name>
          , Liu,
          <string-name>
            <given-names>H.</given-names>
            ,
            <surname>Suvarna</surname>
          </string-name>
          , R.: Resource Description Framework: Metadata and
          <string-name>
            <given-names>Its</given-names>
            <surname>Applications</surname>
          </string-name>
          .
          <source>SIGKDD Explor. Newsl</source>
          .
          <volume>3</volume>
          (
          <issue>1</issue>
          ),
          <volume>6</volume>
          {
          <fpage>19</fpage>
          (Jul
          <year>2001</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>Coverage</given-names>
            <surname>Implementation Schema. Standard</surname>
          </string-name>
          09-146r2, Open Geospatial Consortium (May
          <year>2012</year>
          ), http://www.opengis.net/doc/gml/gmlcov/1.0.
          <fpage>1</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>Data</given-names>
            <surname>Catalog</surname>
          </string-name>
          <article-title>Vocabulary (DCAT)</article-title>
          .
          <source>Standard, W3C (Jan</source>
          <year>2014</year>
          ), https://www.w3. org/TR/vocab-dcat/
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Gallagher</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Potter</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sgouros</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hankin</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Flierl</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          :
          <article-title>The Data Access Protocol - DAP 2.0</article-title>
          .
          <string-name>
            <surname>Standard</surname>
            <given-names>ESE</given-names>
          </string-name>
          -RFC-
          <volume>004</volume>
          .0.08,
          <string-name>
            <surname>NASA</surname>
          </string-name>
          (
          <year>October 2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <article-title>Hierarchical Data Format, version 5</article-title>
          .
          <string-name>
            <surname>Standard</surname>
          </string-name>
          , The HDF Group (
          <year>1997</year>
          -2016), https://support.hdfgroup.org/HDF5/doc/Specs.html
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7. ISO 19123:
          <year>2005</year>
          .
          <article-title>Geographic information { Schema for coverage geometry and functions</article-title>
          . Standard, International Organization for Standardization, Geneva,
          <string-name>
            <surname>CH</surname>
          </string-name>
          (Aug
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8. ISO 19156:
          <year>2011</year>
          .
          <article-title>Geographic information { Observations and measurements</article-title>
          . Standard, International Organization for Standardization, Geneva,
          <string-name>
            <surname>CH</surname>
          </string-name>
          (Aug
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <article-title>9. JSON-LD 1.0</article-title>
          .
          <string-name>
            <surname>Standard</surname>
          </string-name>
          ,
          <source>W3C (Jan</source>
          <year>2014</year>
          ), https://www.w3.org/TR/json-ld/
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>PROV-O: The</surname>
            <given-names>PROV</given-names>
          </string-name>
          <string-name>
            <surname>Ontology. Standard</surname>
          </string-name>
          ,
          <source>W3C (Apr</source>
          <year>2013</year>
          ), https://www.w3. org/TR/prov-o/
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <article-title>QB4ST: RDF Data Cube extensions for spatio-temporal components</article-title>
          .
          <source>Editor's draft, W3C (Dec</source>
          <year>2016</year>
          ), http://w3c.github.io/sdw/qb4st/
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <article-title>The RDF Data Cube Vocabulary</article-title>
          . Standard,
          <source>W3C (Jan</source>
          <year>2014</year>
          ), https://www.w3. org/TR/vocab
          <article-title>-data-cube/</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Rew</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Davis</surname>
          </string-name>
          , G.:
          <article-title>NetCDF: an interface for scienti c data access</article-title>
          .
          <source>IEEE Computer Graphics and Applications</source>
          <volume>10</volume>
          (
          <issue>4</issue>
          ),
          <volume>76</volume>
          {
          <fpage>82</fpage>
          (
          <year>July 1990</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14. Semantic Sensor Network Ontology. Working draft,
          <source>W3C</source>
          (May
          <year>2016</year>
          ), https:// www.w3.org/TR/vocab-ssn/
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <article-title>WCS 2.0 Interface Standard - Core. Standard 09-110r4</article-title>
          , Open Geospatial Consortium (
          <year>July 2012</year>
          ), http://www.opengis.net/doc/IS/wcs-core
          <source>-2.0.1</source>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>