Fork of https://github.com/oxigraph/oxigraph.git for the purpose of NextGraph project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
oxigraph/lib
Yuri Astrakhan 18bf383701 Remove tabs from BNF comments 10 months ago
..
benches Parsers: adds "unchecked" option for faster parsing 10 months ago
oxrdf Linting: Impl ordering, Self refs 10 months ago
oxrdfio oxttl and oxrdfio: improves prefixes and base_iri getters 10 months ago
oxrdfxml Uses nightly rustfmt on imports and comments 10 months ago
oxsdatatypes Remove tabs from BNF comments 10 months ago
oxttl Remove tabs from BNF comments 10 months ago
sparesults Remove tabs from BNF comments 10 months ago
spargebra Uses nightly rustfmt on imports and comments 10 months ago
sparopt Uses nightly rustfmt on imports and comments 10 months ago
sparql-smith Remove tabs from BNF comments 10 months ago
src Linting: Impl ordering, Self refs 10 months ago
tests Merge remote-tracking branch 'origin/main' into next 11 months ago
Cargo.toml Turtle: fixes parsing bug with escaped dot at the end of a local name 10 months ago
README.md Releases v0.4.0-alpha.1 10 months ago

README.md

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 CLI tool and a Python library based on this library.

Oxigraph implements the following specifications:

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

The main entry point of Oxigraph is the Store struct:

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.quads_for_pattern(Some(ex.as_ref().into()), None, None, None).collect::<Result<Vec<Quad>,_>>().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, datastructures encoding RDF basic concepts (the oxigraph::model module).
  • oxrdfio, a unified parser and serializer API for RDF formats (the oxigraph::io module). It itself relies on:
    • oxttl, N-Triple, N-Quad, Turtle, TriG and N3 parsing and serialization.
    • oxrdfxml, RDF/XML parsing and serialization.
  • spargebra, a SPARQL parser.
  • sparesults, parsers and serializers for SPARQL result formats.
  • sparopt, a SPARQL optimizer.
  • oxsdatatypes, an implementation of some XML Schema datatypes.

To build the library locally, don't forget to clone the submodules using git clone --recursive https://github.com/oxigraph/oxigraph.git to clone the repository including submodules or git submodule update --init to add submodules to the already cloned repository.

License

This project is licensed under either of

  • Apache License, Version 2.0, (LICENSE-APACHE or <http://www.apache.org/licenses/LICENSE-2.0>)
  • MIT license (LICENSE-MIT or <http://opensource.org/licenses/MIT>)

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.