Skip to content

Latest commit

 

History

History
96 lines (69 loc) · 3.3 KB

File metadata and controls

96 lines (69 loc) · 3.3 KB

sparqld

sparqld logo

CI crates.io License

A live, read-only SPARQL endpoint for linked data stored in files.

sparqld watches a directory and makes its RDF files queryable immediately. The files remain authoritative: there is no database to operate, import step to run, or duplicate copy to synchronize. Each successful edit becomes available atomically.

Install

Install Rust and Cargo if they are not already available, then install sparqld from crates.io:

cargo install sparqld

Start an endpoint

Serve a directory of RDF files:

sparqld ./data

The endpoint listens locally at http://127.0.0.1:7737/ and watches the directory for changes.

Query it with any SPARQL client. For example, install sq and inspect the first twenty triples:

cargo install --git https://github.com/ktk/sq
sq -e http://127.0.0.1:7737/ \
  'SELECT ?subject ?predicate ?object { ?subject ?predicate ?object } LIMIT 20'

For copy-pasteable example data and a first query, see the Quickstart.

What it supports

  • JSON-LD, YAML-LD, and Markdown-LD;
  • Turtle, TriG, N-Triples, N-Quads, RDF/XML, and Notation3;
  • local JSON-LD contexts, including relative @import references, scoped to the served directory;
  • a live file catalog and named graph model for locating source data.

See the file formats reference for extensions and format-specific behavior.

How it behaves

Every source file is represented by its own named graph. A file that declares named graphs, such as a TriG file or nanopublication, retains them as graphs scoped to that source. The default graph is the union of source graphs and the catalog, so ordinary SPARQL queries search the whole directory.

When a file or its local context changes, sparqld parses the affected data before replacing it. A failed parse removes that source graph and records the error in the catalog. Pass --no-watch to load once without watching.

The endpoint is permanently read-only: modify RDF by editing files, never via SPARQL Update.

Security

By default, sparqld listens only on 127.0.0.1. Using --host 0.0.0.0 makes its read-only endpoint reachable on the network; it provides neither authentication nor TLS. Put network-facing deployments behind appropriate access controls.

Project

sparqld is under active development. See the documentation, roadmap, and issue tracker.

License

Licensed under either of Apache License, Version 2.0 or MIT license, at your option.