Home › Mediator › SPARQL

SPARQL

Query
— SPARQL query link (copy for curl; the # in FROM IRIs becomes %23)

FROM — selecting the data

Every query needs at least one FROM (or FROM NAMED); the endpoint fetches those documents and queries over them. FROM/ FROM NAMED is restricted to the Linked AdV wrapper's two data routes — /oid, /wfs —, this mediator's routed /feature, and the wrapper's vocabulary documents (gid/7.1, ok/7.1/…, vocab/…); any other target is rejected with 400. The mediator and the wrapper share one public prefix, so relative IRIs resolve against that common root and the same query works on any deployment. FROM clauses are never rewritten — you name the exact source:

Several FROM clauses merge into one graph (see the sfCrosses example). A # inside a FROM IRI must be written %23.

Calling the endpoint

GeoSPARQL functions

The endpoint registers the GeoSPARQL 1.1 function suite (OGC 22-047r1). Functions operate on geo:wktLiteral/geo:gmlLiteral values. Every RDF document served here lifts its GML geometry into the canonical form — bind it with ?s geo:hasGeometry/geo:asWKT ?g (PREFIX geo: <http://www.opengis.net/ont/geosparql#>); the raw GML stays untouched on locn:geometry as an rdf:XMLLiteral, which the functions do NOT accept. Common functions relevant to this dataset:

Topological relations (DE-9IM / Simple Features) return a boolean for a pair of geometries:

Use PREFIX geof: <http://www.opengis.net/def/function/geosparql/>.

A non-standard helper returns a geometry's topological dimension as an integer (0 point, 1 curve, 2 surface):

Use PREFIX fn: <https://wunderfacts.com/adv/vocab/fn#>. These reproduce the ATKIS SK50 styling-rule predicates (mdl:geo_crosses → geof:sfCrosses, mdl:geo_isArea → fn:dimension(?g) = 2, etc.). See the example dropdown above for working queries.