The OGC GeoSPARQL standard supports representing and querying geospatial data on the Semantic Web. GeoSPARQL defines a vocabulary for representing geospatial data in RDF, and it defines an extension to the SPARQL query language for processing geospatial data. In addition, GeoSPARQL is designed to accommodate systems based on qualitative spatial reasoning and systems based on quantitative spatial computations.

In cooperation with the GSoC2015, in version 3.4.0 we have added GeoSPARQL support to our SPARQL implementation.

Warning! Because some portability issues, GeoSPARQL support has not been shipped as part of any public release. We expect to manage to solve it in a future release. In the meantime, you need to build branch MARMOTTA-584 manually from the source code.

Further technical details can be found in the wiki.

Besides our mailing lists, if you are interested about geospatial technologies in a broader way, there is a dedicated mailing list as a common space with other projects, both within Apache (e.g., SIS) and externally (e.g., Eclipse LocationTech).

Maven Artifact

The GeoSPARQL implementation is available in the kiwi-geosparql module. To include it in a project that uses the KiWi Triple Store, you need to add the following dependency to your Maven project:


Installation Considerations

Please, take into account that GeoSPARQL support is only available when you are using PostgreSQL as backend for KiWi.

In PostgreSQL, it is necessary to install the PostGIS extension into the Marmotta database. Depending on your operating system and distribution, this might also require installation of additional software packages (under Debian: postgis). To install the postgis extension, connect to the database as superuser and run:



The following query shows an example how to use the extension for the language:

PREFIX geoes: <>
PREFIX geo: <>
PREFIX geof: <>

SELECT DISTINCT ?labelMunicipios 
  ?subject a <>.
  ?subject rdfs:label "Madrid"@es.
  ?subject geoes:hasExactGeometry ?geo.
  ?geo geo:asWKT ?wkt.
  ?subject2 a <>.
  ?subject2 rdfs:label ?labelMunicipios.
  ?subject2 geoes:hasExactGeometry ?geo2.
  ?geo2 geo:asWKT ?wkt2.
  FILTER (geof:sfContains(?wkt, ?wkt2))
ORDER BY ?labelMunicipios

You can find more usage examples at the user documentation.