Issue raised by Andrea Perego: http://joinup.ec.europa.eu/mailman/archives/dcat_application_profile-geo/2015-April/000021.html
Currently there is no agreement on a preferred format to be used in RDF for the representation of a geographic bounding box, or more generally a geometry. The 1st WG Draft of the GeoDCAT-AP (based on the INSPIRE+DCAT-AP alignment work done earlier) states the following:
In [DCAT, DCAT-AP], the spatial coverage is specified by using property dct:spatial
, having as range dct:Location
.
When the area corresponding to the spatial coverage is denoted by a geometry, as in INSPIRE, [DCAT-AP] recommends the use of the Core Location Vocabulary [LOCN]. In [LOCN], this is done by using property locn:geometry
, having as range a geometry specified as
-
a URI - e.g., by using the
geo
URI scheme [IETF-RFC-5870], or a geohash URI [GEOHASH, GEOHASH-36] - a syntax encoding scheme - e.g., geohashes [GEOHASH, GEOHASH-36], WKT [ISO-19125], GML [GML], KML [KML], GeoJSON [GEOJSON]
- a semantic representation - using vocabularies like W3C Lat/long [LAT-LONG] or schema.org [SCHEMA]
The provisional proposal is to represent the geometry as a GML literal (gml:Envelope
), as specified in [GEOSPARQL]. However, this is an issue that requires further investigation, both in the framework of the INSPIRE MIG and in relevant standardisation activities.
(related issue: 138937 - IM4 - Recommend best practice for spatial coverage)
Comments
The issue under discussion concerns which should be the preferable encoding(s) for a geometry - in particular, for a bounding box - taking into account its possible uses and common practices in existing data portals and triple stores.
Alternatives to GML (proposed in the current draft) can be, e.g.:
It is worth noting that in (Geo)DCAT-AP it is possible to specify the bounding box of a dataset by using multiple geometry encodings. So, GeoDCAT-AP could leave to data providers the choice of the enconding(s) they would like to use, but recommending, for interoperability reasons, that at least a given geometry encoding (e.g., GML, WKT, GeoJSON) is also made available.
There was a short discussion on this during the 2nd WG meeting (see the minutes).
If multiple geometry encodings (e.g. GML, WKT, GeoJSON, etc) are allowed, it would be good to always indicate which encoding is used, so that geometry literals can be easily parsed by machines.
This is possible in GeoSPARQL by using typed literals (the RDF data types ogc:gmlLiteral and ogc:wktLiteral), as illustrated in the Core Location Vocabulary (there seems to be one typo: the data types ogc:gmlLiteral and ogc:wktLiteral start with a lower case, this typo seems to have also slipped into our specs).
Is there an RDF data type for GeoJSON or KML?
In case appropriate XML Schema / RDF datatypes are missing, an option would be to use IANA media type URLs (if available). E.g.:
Andrea Perego opened a discussion about this on the mailing list:
http://joinup.ec.europa.eu/mailman/archives/dcat_application_profile-geo/2015-May/thread.html
Via the mailing list, the following votes came in... and revised proposal was made.
http://joinup.ec.europa.eu/mailman/archives/dcat_application_profile-geo/2015-May/000066.html
Andrea Perego andrea.perego at jrc.ec.europa.eu
Mon May 18 01:34:24 CEST 2015
During the 4th WG meeting of 20 May 2015, it was decided by vote that
There is an explanation of the decision taken in the last version of the GeoDCAT-AP specifications. This can be completed with the issue about mapping geographic identifiers for spatial coverage:
In the core profile of ISO 18115, spatial coverage can be specified either with a bounding box (a geometry) or a geographic identifier. INSPIRE is more restrictive, in that it requires to use a bounding box
Based on that, GeoDCAT-AP models spatial coverage as follows:
It is worth noting that currently there is no agreement on a preferred format to be used in RDF for the representation of geometries. Geometries can be provided in any, and possibly multiple, encodings, but at least one of the following must be made available: WKT or GML. An additional requirement concerns the coordinate reference system (CRS) used, which may vary on a country or territory basis. Following GeoSPARQL, the CRS must be always specified in the WKT endcoding when it is different from CRS84 (WGS84, with axis order longitude / latitude). Summarising:
The following example shows how to specify the spatial coverage.
# Resource metadata in GeoDCAT-AP using a geographic bounding box. This example uses multiple encodings, namely, the
# recommended ones (WKT and GML), plus GeoJSON. To denote the datatype of the GeoJSON literal, the URL of the corresponding
# IANA media type.
[] dct:spatial [ a dct:Location ;
locn:geometry "POLYGON((-10.58 70.09,34.59 70.09,34.59 34.56,-10.58 34.56,
-10.58 70.09))"^^gsp:wktLiteral ;
locn:geometry "<gml:Envelope srsName=\"http://www.opengis.net/def/crs/OGC/1.3/CRS84\">
<gml:lowerCorner>34.56 -10.58</gml:lowerCorner>
<gml:upperCorner>70.09 34.59</gml:upperCorner>
</gml:Envelope>"^^gsp:gmlLiteral ] ;
locn:geometry "{\"type\":\"Polygon\",\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"urn:ogc:def:crs:OGC:1.3:CRS84\"}},
\"coordinates\":[[[-10.58,70.09],[34.59,70.09],[34.59,34.56],[-10.58,34.56],[-10.58,70.09]]]
}"^^<https://www.iana.org/assignments/media-types/application/vnd.geo+json> ].
# Resource metadata in GeoDCAT-AP using a geographic identifier
#If a URI is used for the geographic identifier (recommended)
[] dct:spatial <http://publications.europa.eu/resource/authority/country/NLD>.
#If no URI is used for the geographic identifier
[] dct:spatial [
skos:preflabel "Netherlands"@en;
skos:prefLabel "Nederland"@nl;
skos:inScheme [
dct:title "Countries Authority Table"@en;
dct:modified "2009-01-01"^^xsd:date
]
].
<!-- Resource metadata in ISO19139 using a geographic bounding box -->
<gmd:MD_Metadata>
...
<gmd:identificationInfo>
<gmd:MD_DataIdentification>
<gmd:extent>
<gmd:EX_Extent>
<gmd:geographicElement>
<gmd:EX_GeographicBoundingBox>
<gmd:extentTypeCode>
<gco:Boolean>true</gco:Boolean>
</gmd:extentTypeCode>
<gmd:westBoundLongitude>
<gco:Decimal>-9.227701</gco:Decimal>
</gmd:westBoundLongitude>
<gmd:eastBoundLongitude>
<gco:Decimal>2.687637</gco:Decimal>
</gmd:eastBoundLongitude>
<gmd:southBoundLatitude>
<gco:Decimal>49.83726</gco:Decimal>
</gmd:southBoundLatitude>
<gmd:northBoundLatitude>
<gco:Decimal>60.850441</gco:Decimal>
</gmd:northBoundLatitude>
</gmd:EX_GeographicBoundingBox>
</gmd:geographicElement>
</gmd:EX_Extent>
</gmd:extent>
</gmd:MD_DataIdentification>
</gmd:identificationInfo>
...
</gmd:MD_Metadata>