Get started
Your first spatial query in two minutes
You need Docker, or Rust if you prefer to build from source. Nothing else: TripleTrail is one program with its web interface built in.
Start the server
This runs TripleTrail on your machine and keeps its data in a Docker volume. Then open http://localhost:7878 in your browser.
Without Docker: install Rust and run cargo install --locked --path crates/tripletrail-server in a copy of the source.
docker run -p 7878:7878 -v tripletrail-data:/data \ ghcr.io/matdata-eu/tripletrail
Add some data
Save these three stations as stations.ttl and send them to the server. In the web interface you can also drop the file on the upload page.
@prefix ex: <http://example.org/> . @prefix geo: <http://www.opengis.net/ont/geosparql#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . ex:brussels a ex:Station ; rdfs:label "Brussels Central" ; geo:hasGeometry [ geo:asWKT "POINT(4.3571 50.8456)"^^geo:wktLiteral ] . ex:leuven a ex:Station ; rdfs:label "Leuven" ; geo:hasGeometry [ geo:asWKT "POINT(4.7158 50.8813)"^^geo:wktLiteral ] . ex:antwerp a ex:Station ; rdfs:label "Antwerp Central" ; geo:hasGeometry [ geo:asWKT "POINT(4.4211 51.2172)"^^geo:wktLiteral ] .
Ask where things are
Open Query in the web interface and run this. Switch to the map view to see the stations, or open Map to browse everything in the dataset.
- Every SPARQL client works: Python, R, Java, curl
- QGIS can read the same data through OGC API Features at
/ds/ogc
PREFIX geo: <http://www.opengis.net/ont/geosparql#> PREFIX geof: <http://www.opengis.net/def/function/geosparql/> PREFIX uom: <http://www.opengis.net/def/uom/OGC/1.0/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?name ?km WHERE { ?station rdfs:label ?name ; geo:hasGeometry/geo:asWKT ?wkt . BIND(geof:distance(?wkt, "POINT(4.3571 50.8456)"^^geo:wktLiteral, uom:metre) / 1000 AS ?km) FILTER(?km < 50) } ORDER BY ?km
Where to go next
Spatial functions
GeoSPARQL, the PostGIS function set, linear referencing and the spatial index.
Routing
Named networks, the pgRouting functions, constraints, vehicle rules and isochrones.
Running a server
Datasets, access control, backups, replicas and running it in production.
Lifting files
Turn CSV, JSON, XML, spreadsheets and databases into RDF.
Validation and reasoning
SHACL shapes and rules, RDFS and OWL 2 RL.
Stuck?
Ask a question on GitHub, or talk to us about a proof of concept on your data.