ad-freiburg / qlever

Very fast SPARQL Engine, which can handle very large knowledge graphs like the complete Wikidata, offers context-sensitive autocompletion for SPARQL queries, and allows combination with text search. It's faster than engines like Blazegraph or Virtuoso, especially for queries involving large result sets.
Apache License 2.0
417 stars 52 forks source link

Return value of geof:distance #1408

Open c81c4a0370 opened 4 months ago

c81c4a0370 commented 4 months ago

Documentation under https://docs.ogc.org/is/22-047r1/22-047r1.html defines distance as:

geof:distance (geom1: ogc:geomLiteral, geom2: ogc:geomLiteral, units: xsd:anyURI): xsd:double`

Qlevel seems to implement it without the third parameter units. What is the return value, and would it be possible to express units somehow?

The sparql spects tells:

10.3. Recommendation for units of measure

For geometric data to be interpreted and used correctly, the units of measure should be known. Typically, the particular Spatial Reference System (SRS) that is associated with a Geometry instance will specify a unit of measurement. However, some elements of GeoSPARQL allow arbitrary units of distance to be used, for example the property geo:hasSpatialResolution or the function geof:buffer. In those cases it is advisable to make use of a well-known web vocabulary for units of measurement. Making the unit of measurement explicit will improve data interoperability. The recommended vocabulary for units of measurement for GeoSPARQL is the Quantities, Units, Dimensions and Types (QUDT) ontology9 but others may be used, as long as they are well-described.

joka921 commented 3 months ago

Hi, Thanks for the question. The current implementation of geof:distance has the following limitations:

  1. It always returns the result in kilometers (no unit specification supported currently).
  2. It only works if both arguments are points.
  3. It is rather inefficient (has to work on strings that are read from disk).