Oxigraph

Latest Version Released API docs Crates.io downloads actions status Gitter

Oxigraph is a graph database library implementing the SPARQL standard.

Its goal is to provide a compliant, safe and fast on-disk graph database. It also provides a set of utility functions for reading, writing, and processing RDF files.

Oxigraph is in heavy development and SPARQL query evaluation has not been optimized yet.

Oxigraph also provides a standalone HTTP server and a Python library based on this library.

Oxigraph implements the following specifications: * SPARQL 1.1 Query, SPARQL 1.1 Update, and SPARQL 1.1 Federated Query. * Turtle, TriG, N-Triples, N-Quads, and RDF XML RDF serialization formats for both data ingestion and retrieval using the Rio library. * SPARQL Query Results XML Format, SPARQL 1.1 Query Results JSON Format and SPARQL 1.1 Query Results CSV and TSV Formats.

A preliminary benchmark is provided. Oxigraph internal design is described on the wiki.

The main entry point of Oxigraph is the Store struct: ```rust use oxigraph::store::Store; use oxigraph::model::*; use oxigraph::sparql::QueryResults;

let store = Store::new().unwrap();

// insertion let ex = NamedNode::new("http://example.com").unwrap(); let quad = Quad::new(ex.clone(), ex.clone(), ex.clone(), GraphName::DefaultGraph); store.insert(&quad).unwrap();

// quad filter let results = store.quadsforpattern(Some(ex.asref().into()), None, None, None).collect::,>>().unwrap(); assert_eq!(vec![quad], results);

// SPARQL query if let QueryResults::Solutions(mut solutions) = store.query("SELECT ?s WHERE { ?s ?p ?o }").unwrap() { assert_eq!(solutions.next().unwrap().unwrap().get("s"), Some(&ex.into())); } ```

Some parts of this library are available as standalone crates: * oxrdf provides datastructures encoding RDF basic concepts (the oxigraph::model module). * spargebra provides a SPARQL parser. * sparesults provides parsers and serializers for SPARQL result formats.

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Oxigraph by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.