Limits are explicit
Set solution and numeric limits at execution. Queries fail clearly at their boundary instead of relying on hidden truncation.
An embeddable SPARQL 1.1 Query parser and execution engine for Odin. Bring your own RDF data and storage; retain ownership of limits, lifetimes, networking, and source policy.
import sparql "../../sparql"
import dataset "../../sparql/dataset"
import engine "../../sparql/engine"
query, parse_error := sparql.Parse(
`SELECT ?name WHERE {
<urn:ada> <urn:name> ?name
}`,
)
defer sparql.Destroy(&query)
store: dataset.Memory_Dataset
dataset.init(&store)
defer dataset.destroy(&store)
// Add application-owned RDF data, seal it,
// then execute with explicit limits.
result, execute_error := engine.execute(
&query, view, {Max_Solutions = 8},
)
A focused query layer for application-owned RDF
Designed for integration
The engine is deliberately a query layer, not a hidden database or network client. Its contracts make the important decisions visible to the application.
Set solution and numeric limits at execution. Queries fail clearly at their boundary instead of relying on hidden truncation.
Use the sealed in-memory Dataset or expose your own graph-scoped, streaming View over a snapshot or index.
SERVICE, clocks, UUIDs, random values, and cancellation enter through caller-supplied callbacks. The core never opens a connection.
Serialized SELECT and ASK results, plus graph results, stay valid after query parsing and dataset resources are released.
An opt-in deterministic BGP ordering heuristic and caller-owned execution statistics keep query work inspectable.
Pinned W3C fixtures, local policy gates, property tests, fuzzing, and cross-platform CI keep scope honest and reviewable.
SPARQL 1.1 Query
The public surface concentrates on the SPARQL 1.1 Query Language. `FROM` and `FROM NAMED` only restrict graphs already offered by the View; they never fetch a resource or presume a graph store.
Read the SPARQL 1.1 Query recommendation →Included
Deliberately separate
Quick start
Point Odin's named `odin-rdf` collection at a sibling, vendored, or application-owned checkout. The minimal example builds a sealed Dataset, then writes SPARQL Results JSON.
# run the end-to-end public API example
odin run examples/minimal \
-collection:odin-rdf=../odin-rdf
# run the same path over application-owned storage
odin run examples/custom_view \
-collection:odin-rdf=../odin-rdf
# check the parser and engine
odin check sparql -no-entry-point \
-collection:odin-rdf=../odin-rdf
odin test sparql \
-collection:odin-rdf=../odin-rdf
odin test sparql/engine \
-collection:odin-rdf=../odin-rdf
Expected example output:
{"head":{"vars":["name"]},"results":{...}}
Evidence before claims
Syntax, evaluation, result serialization, and the implementation-defined DESCRIBE policy are documented separately. The complete record states what passes, what is intentionally excluded, and what remains future work.
Start at the boundary
Read the API contract, then choose the Dataset or custom View that fits your application.