> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neuro-tech.io/llms.txt
> Use this file to discover all available pages before exploring further.

# SPARQL and RDF Graph Store

> Query and manage semantic graphs with standard HTTP protocols

The semantic-web module registers:

```text theme={null}
/sparql
/rdf-graph-store
```

Both resources require an authenticated user with the operation-specific privilege configured by the module.

## SPARQL endpoint

`/sparql` accepts GET and POST queries. The Script parser supports SPARQL `SELECT`, `ASK`, and `CONSTRUCT`. Use POST for long queries and send the correct SPARQL media type.

```bash theme={null}
curl --fail -X POST https://neuron.example.com/sparql \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/sparql-query" \
  -H "Accept: application/sparql-results+json" \
  --data 'SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 100'
```

Result negotiation supports standard SPARQL result encodings and, when installed, HTML, CSV, and tab-separated renderers.

## Graph Store Protocol

`/rdf-graph-store` implements GET, POST, PUT, and DELETE over the default or a named graph.

* `GET` retrieves a graph.
* `POST` merges triples into a graph.
* `PUT` replaces a graph.
* `DELETE` removes a graph.

Identify named graphs with the standard graph query parameter expected by the endpoint. Use RDF media types such as Turtle, RDF/XML, or JSON-LD that the running Neuron advertises.

## Operational guidance

* Put `LIMIT` on exploratory queries.
* Restrict mutation privileges separately from query.
* Validate and bound remote graph dereferencing.
* Invalidate application caches after graph updates.
* Treat blank-node identifiers as document-local.
* Version domain vocabularies and contract/harmonized-interface namespaces.
