SPARQL Endpoints
Tentris implements the SPARQL 1.1 Protocol and the SPARQL 1.1 Graph Store HTTP Protocol. It makes the following endpoints available.
-
The
/sparql
endpoint accepts the read operations defined in SPARQL 1.1 Query Language (SELECT
,ASK
,CONSTRUCT
andDESCRIBE
). -
The
/stream
endpoint also accepts read operations. This endpoint is optimized for large responses, uses less RAM, and its response size is not limited. It should not be used with queries using the (non-silent)SERVICE
graph pattern (SPARQL 1.1 Federated Query). This is due to a fundamental limitation in HTTP streaming, which does not allow responses to report errors that may occur after the streaming of results has started. -
The
/update
endpoint accepts write operations defined in SPARQL 1.1 Update (e.g.,DELETE
,INSERT
, andLOAD
). -
The
/graph-store
endpoint accepts graph store operations (e.g.,GET
,POST
,PUT
, andDELETE
).
Tentris supports the following response formats for read operations.
- SPARQL JSON (Content-Type:
application/sparql-results+json
), forSELECT
andASK
queries - SPARQL XML (Content-Type:
application/sparql-results+xml
), forSELECT
andASK
queries - SPARQL CSV (Content-Type:
text/csv
), forSELECT
queries - SPARQL TSV (Content-Type:
text/tab-separated-values
), forSELECT
queries - RDF N-Triples (Content-Type:
application/n-triples
), forCONSTRUCT
andDESCRIBE
queries - RDF Turtle (Content-Type:
text/turtle
), forCONSTRUCT
andDESCRIBE
queries
Usage Examples
/sparql
Count all triples in the default graph.
curl -H "Content-Type: application/sparql-query" \
--data "SELECT (COUNT(*) AS ?c) WHERE { ?s ?p ?o }" "http://localhost:9080/sparql"
/stream
Select all triples in the default graph.
curl -H "Content-Type: application/sparql-query" \
--data "SELECT * WHERE { ?s ?p ?o }" "http://localhost:9080/stream"
/update
Add the triple <s> <p> <o>
to the default graph.
curl -H "Content-Type: application/sparql-update" \
--data "INSERT DATA { <s> <p> <o> }" "http://localhost:9080/update"
/graph-store
GET
Retrieve the contents of the default graph as turtle.
curl -H "Accept: text/turtle" "http://localhost:9080/graph-store?default"
POST
Insert additional data into the default graph.
curl -H "Content-Type: text/turtle" -X POST -T data.ttl \
"http://localhost:9080/graph-store?default"
PUT
Replace the data in the default graph with other data.
curl -H "Content-Type: text/turtle" -X PUT -T data.ttl \
"http://localhost:9080/graph-store?default"
DELETE
Delete the contents of the default graph.
curl -X DELETE "http://localhost:9080/graph-store?default"