CSIRO-enviro-informatics / loci.cat

Latest updates from the Loc-I Project
https://loci.cat
Other
0 stars 1 forks source link

Geometry Data Service #39

Closed jyucsiro closed 4 years ago

jyucsiro commented 4 years ago

This issue explores adding a geometry service as part of the Loc-I architecture.

Requirements

Current approach: Embed geometry directly using vanilla GeoSPARQL (as is)

Embed geometry in a Loc-I feature instance using WKT, GML, or GeoJSON as a RDF literal.

This is not a standalone geometry data service.

New approach using Geometry data service: Mint URIs for geometries and provide an API for it

Implies

This is a standalone geometry data service...

Out of scope

Performing calculations of geometries (i.e. ArcGIS GeometryService). ...

Implementation

Option 1: Explore existing tooling

https://gnis-ld.org/

Option 2: Design a new data service implementation and encoding

Web API Conneg by profile Geodatabase backend (e.g. postgis)

Use GeoSPARQL

Example

ASGS 2016 Meshblock Feature

<http://linked.data.gov.au/dataset/asgs2016/meshblock/20663970000> a asgs:MeshBlock,
        geo:Feature ;
    geo:hasGeometry <http://yet-another-awesome-geoservice/dataset/asgs16-geom/20663970000> ;
.

The URI for the Geometry instance should be RESTful, and a local ID should be used as the suffix (it could be anything, but we could choose the ID of the feature for convenience)

It is up to the client/user to resolve the URI ref to the Geometry via standard HTTP plus conneg (by profile and format).

We could reuse the table in (Regalia et al. 2017)... reproduced below:

MIME Type Description Returns
text/html Web interface <!DOCTYPE html><html lang="en">...
text/plain Well-Known Text POLYGON((113.1016 -38.062 ...))
application/gml+xml GML <gml:Polygon><gml:Exterior>...
application/json GeoJSON {"type":"Polygon","coordinates":...}
application/octet-stream Well-Known Binary 01 06 00 00 20 E6 10 00 00 01...

We would like to explore extending them with

MIME Type Description Returns
application/geo+json GeoJSON {"type":"Polygon","coordinates":...}
text/turtle RDF Turtle representation using GeoSPARQL _:geom1 a geo:sfPolygon , geo:Geometry ; geo:asWKT "POLYGON((113.1016 -38.062 ...))"^^geo:wktLiteral .

We would need to add another parameter to specify profiles to return (e.g. GML representation, simple geom, complex geom...) (look at W3C Conneg by Profile)

Use this approach https://w3c.github.io/dxwg/connegp/#eg-qsa-uri-mt... the QSA template = http://example.com/path/to/resource/a?_profile=prof-01&_mediatype=text/turtle

So our example would look like this to query:

http://yet-another-awesome-geoservice/dataset/asgs16-geom/20663970000?_profile=geosparql+gml&_mediatype=text/turtle (showing RDF turtle with GeoSparql GML request)
http://yet-another-awesome-geoservice/dataset/asgs16-geom/20663970000?_profile=geosparql+wkt&_mediatype=text/turtle (showing RDF turtle with GeoSparql WKT request)
http://yet-another-awesome-geoservice/dataset/asgs16-geom/20663970000?_profile=simple-resolution&_mediatype=application/geo+json  (showing simplified geometry request... implementation specific)

Regalia et al., Revisiting the Representation of and Need for Raw Geometries on the Linked Data Web, LDOW, 2017, http://ceur-ws.org/Vol-1809/article-04.pdf

jyucsiro commented 4 years ago

https://github.com/CSIRO-enviro-informatics/geometry-data-service

dr-shorthair commented 4 years ago

Can we close this now?

jyucsiro commented 4 years ago

yes