A very simple, single file MapLibre web map to query and map data from a knowledge graph containing GeoSPARQL geometries.
The web map retrieves and displays data from a knowledge graph using queries to a SPARQL endpoint.
Apache Jena Fuseki is recommended as an easy-to-use SPARQL endpoint and triple store (graph database). Instructions for installing Fuseki and creating a knowledge graph are widely available. OSX users can install in minutes through a package manager like Homebrew, for example.
This repo also contains some more information on installing and configuring the Apache Jena Fuseki GeoSPARQL server.
An example knowledge graph containing the gazetted placenames for Australia, structured using the FSDF Placename ontology, can be downloaded from the RMIT Geographic Knowledge Lab below:
You can verify your SPARQL endpoint is working correctly by running a simple SPARQL query on the created knowledge graph, such as the one below:
PREFIX pn: <http://linked.data.gov.au/def/placenames/>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
SELECT ?loc ?geom ?name ?category
WHERE {
?loc geo:asWKT ?geom .
?place geo:hasGeometry ?loc .
?place pn:hasPlaceClassification ?category .
?place pn:hasPlaceName ?plnm .
?plnm pn:name ?name
}
LIMIT 100
The kgwebmap is based on an updated version of the EPFL DHLAB leaflet-sparql repo, converted to MapLibre.
