-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
Use case: the user draws a polygon on the map and wants to find all features within.
- The most natural way to do this is with a query where the polygon is given inline (rather than written to some temporary graph).
- but you cannot specify or make triples in WHERE. You can only test triple patterns for existence
- (You can make triples in CONSTRUCT, but only with "material" you already found with WHERE)
- So the only way to test GeoSPARQL data against geometries specified inline, is to use
geoffunctions but notgeopredicates.- https://graphdb.ontotext.com/documentation/10.8/geosparql-support.html#geosparql-support-example-2 gives an example with a function and the same with a predicate
- https://opengeospatial.github.io/ogc-geosparql/geosparql11/document.html#C.2.2.2 gives example only with function
- The problem is that functions are much slower: they can only test but cannot generate candidate solutions
- So you have to fetch all geometries, then compare them against the inline polygon
- in contrast, predicates can use the spatial index to quickly find only matching ontologies
GraphDB has such a non-standard extension but a customer challenged it, and asked instead "to allow functions to use the spatial index". But I don't see how this can be done: functions cannot take unbound arguments, and cannot generate candidate solutions.
To implement this in the ontology:
- declare abstract Datatype
ogc:geomLiteralas superclass of wktLiteral, gmlLiteral etc and subclass of rdf:Literal- I think but am not sure that literals can form class hierarchies
- declare
SpatialObjectOrGeometryLiteralas union of SpatialObject and ogc:geomLiteral - downgrade
geopredicates from ObjectProperty to Property - redeclare their range to be SpatialObjectOrGeometryLiteral
- let's leave the domain as is because this is not valid in RDF (it's only valid in "generalised RDF" but that's a hypothetical beast):
# invalid
"literal" geo:sfWithin "literal"
# valid
<geometry> geo:sfWithin "literal"
More important than the ontology: give examples! (and conformance tests)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels