Oxigraph is a work in progress graph database implementing the [SPARQL](https://www.w3.org/TR/sparql11-overview/) standard.
Oxigraph is a graph database implementing the [SPARQL](https://www.w3.org/TR/sparql11-overview/) standard.
There is no released version yet.
There is no released version yet.
The storage format is not stable yet and may be at any time.
Its goal is to provide a compliant, safe and fast graph database based on the [RocksDB](https://rocksdb.org/) and [Sled](https://sled.rs/) key-value stores.
Its goal is to provide a compliant, safe and fast graph database based on the [RocksDB](https://rocksdb.org/) and [Sled](https://sled.rs/) key-value stores.
It is written in Rust.
It is written in Rust.
@ -20,7 +19,7 @@ It is split into multiple parts:
* The `server` directory contains a stand-alone binary of a web server implementing the [SPARQL 1.1 Protocol](https://www.w3.org/TR/sparql11-protocol/). It uses the [RocksDB](https://rocksdb.org/) key-value store.
* The `server` directory contains a stand-alone binary of a web server implementing the [SPARQL 1.1 Protocol](https://www.w3.org/TR/sparql11-protocol/). It uses the [RocksDB](https://rocksdb.org/) key-value store.
* The `wikibase` directory contains a stand-alone binary of a web server able to synchronize with a [Wikibase instance](https://wikiba.se/).
* The `wikibase` directory contains a stand-alone binary of a web server able to synchronize with a [Wikibase instance](https://wikiba.se/).
* [Turtle](https://www.w3.org/TR/turtle/), [TriG](https://www.w3.org/TR/trig/), [N-Triples](https://www.w3.org/TR/n-triples/), [N-Quads](https://www.w3.org/TR/n-quads/) and [RDF XML](https://www.w3.org/TR/rdf-syntax-grammar/) RDF serialization formats for both data ingestion and retrieval using the [Rio library](https://github.com/oxigraph/rio).
* [Turtle](https://www.w3.org/TR/turtle/), [TriG](https://www.w3.org/TR/trig/), [N-Triples](https://www.w3.org/TR/n-triples/), [N-Quads](https://www.w3.org/TR/n-quads/) and [RDF XML](https://www.w3.org/TR/rdf-syntax-grammar/) RDF serialization formats for both data ingestion and retrieval using the [Rio library](https://github.com/oxigraph/rio).
This package provides a JavaScript API on top of Oxigraph compiled with WebAssembly.
This package provides a JavaScript API on top of Oxigraph compiled with WebAssembly.
Oxigraph is a work in progress graph database written in Rust implementing the [SPARQL](https://www.w3.org/TR/sparql11-overview/) standard.
Oxigraph is a graph database written in Rust implementing the [SPARQL](https://www.w3.org/TR/sparql11-overview/) standard.
It is a work in progress and currently offers a simple in-memory store with [SPARQL 1.1 Query](https://www.w3.org/TR/sparql11-query/) capabilities.
Oxigraph or JavaScript is a work in progress and currently offers a simple in-memory store with [SPARQL 1.1 Query](https://www.w3.org/TR/sparql11-query/) capabilities.
The store is also able to load RDF serialized in [Turtle](https://www.w3.org/TR/turtle/), [TriG](https://www.w3.org/TR/trig/), [N-Triples](https://www.w3.org/TR/n-triples/), [N-Quads](https://www.w3.org/TR/n-quads/) and [RDF/XML](https://www.w3.org/TR/rdf-syntax-grammar/).
The store is also able to load RDF serialized in [Turtle](https://www.w3.org/TR/turtle/), [TriG](https://www.w3.org/TR/trig/), [N-Triples](https://www.w3.org/TR/n-triples/), [N-Quads](https://www.w3.org/TR/n-quads/) and [RDF/XML](https://www.w3.org/TR/rdf-syntax-grammar/).
@ -163,4 +163,4 @@ The Oxigraph bindings are written in Rust using [the Rust WASM toolkit](https://
The [The Rust Wasm Book](https://rustwasm.github.io/docs/book/) is a great tutorial to get started.
The [The Rust Wasm Book](https://rustwasm.github.io/docs/book/) is a great tutorial to get started.
To build the JavaScript bindings, just run `wasm-pack build`, to run the tests of the JS bindings written in JS just do a usual`npm test`.
To build the JavaScript bindings, run `wasm-pack build`, to run the tests of the JS bindings written in JS run`npm test`.
/// Executes the parsing itself on a [`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html) implementation and returns an iterator of triples
returnErr(invalid_data_error(format!("Expecting sparql tag, found {}",reader.decode(event.name()).map_err(map_xml_error)?)).into());
returnErr(invalid_data_error(format!("Expecting sparql tag, found {}",reader.decode(event.name()).map_err(map_xml_error)?)));
}
}
}
}
State::Boolean=>returnErr(invalid_data_error(format!("Unexpected tag inside of <boolean> tag: {}",reader.decode(event.name()).map_err(map_xml_error)?)).into())
State::Boolean=>returnErr(invalid_data_error(format!("Unexpected tag inside of <boolean> tag: {}",reader.decode(event.name()).map_err(map_xml_error)?)))
},
},
Event::Empty(event)=>matchstate{
Event::Empty(event)=>matchstate{
State::Sparql=>{
State::Sparql=>{
ifevent.name()==b"head"{
ifevent.name()==b"head"{
state=State::AfterHead;
state=State::AfterHead;
}else{
}else{
returnErr(invalid_data_error(format!("Expecting <head> tag, found {}",reader.decode(event.name()).map_err(map_xml_error)?)).into());
returnErr(invalid_data_error(format!("Expecting <head> tag, found {}",reader.decode(event.name()).map_err(map_xml_error)?)));
/// Errors related to parameter validation like the base IRI use the [`InvalidInput`](https://doc.rust-lang.org/std/io/enum.ErrorKind.html#variant.InvalidInput) error kind.
/// Errors related to a bad syntax in the loaded file use the [`InvalidData`](https://doc.rust-lang.org/std/io/enum.ErrorKind.html#variant.InvalidData) or [`UnexpectedEof`](https://doc.rust-lang.org/std/io/enum.ErrorKind.html#variant.UnexpectedEof) error kinds.
pubfndump_graph<'a>(
pubfndump_graph<'a>(
&self,
&self,
writer: implWrite,
writer: implWrite,
@ -413,7 +406,7 @@ impl MemoryStore {
)
)
}
}
/// Dumps the store dataset into a file.
/// Dumps the store into a file.
///
///
/// Usage example:
/// Usage example:
/// ```
/// ```
@ -430,9 +423,6 @@ impl MemoryStore {
/// assert_eq!(file, buffer.as_slice());
/// assert_eq!(file, buffer.as_slice());
/// # std::io::Result::Ok(())
/// # std::io::Result::Ok(())
/// ```
/// ```
///
/// Errors related to parameter validation like the base IRI use the [`InvalidInput`](https://doc.rust-lang.org/std/io/enum.ErrorKind.html#variant.InvalidInput) error kind.
/// Errors related to a bad syntax in the loaded file use the [`InvalidData`](https://doc.rust-lang.org/std/io/enum.ErrorKind.html#variant.InvalidData) or [`UnexpectedEof`](https://doc.rust-lang.org/std/io/enum.ErrorKind.html#variant.UnexpectedEof) error kinds.
/// If the file parsing fails in the middle of the file, the triples read before are still
/// If the file parsing fails in the middle of the file, the triples read before are still
/// considered by the transaction. Rollback the transaction by making the transaction closure
/// considered by the transaction. Rollback the transaction by making the transaction closure
/// return an error if you don't want that.
/// return an error if you don't want that.
///
/// Errors related to parameter validation like the base IRI use the [`InvalidInput`](https://doc.rust-lang.org/std/io/enum.ErrorKind.html#variant.InvalidInput) error kind.
/// Errors related to a bad syntax in the loaded file use the [`InvalidData`](https://doc.rust-lang.org/std/io/enum.ErrorKind.html#variant.InvalidData) or [`UnexpectedEof`](https://doc.rust-lang.org/std/io/enum.ErrorKind.html#variant.UnexpectedEof) error kinds.
pubfnload_graph<'a>(
pubfnload_graph<'a>(
&mutself,
&mutself,
reader: implBufRead,
reader: implBufRead,
@ -1164,16 +1156,18 @@ impl MemoryTransaction {
/// let file = b"<http://example.com> <http://example.com> <http://example.com> <http://example.com> .";
/// let file = b"<http://example.com> <http://example.com> <http://example.com> <http://example.com> .";
/// If the file parsing fails in the middle of the file, the quads read before are still
/// If the file parsing fails in the middle of the file, the quads read before are still
/// considered by the transaction. Rollback the transaction by making the transaction closure
/// considered by the transaction. Rollback the transaction by making the transaction closure
/// return an error if you don't want that.
/// return an error if you don't want that.
///
/// Errors related to parameter validation like the base IRI use the [`InvalidInput`](https://doc.rust-lang.org/std/io/enum.ErrorKind.html#variant.InvalidInput) error kind.
/// Errors related to a bad syntax in the loaded file use the [`InvalidData`](https://doc.rust-lang.org/std/io/enum.ErrorKind.html#variant.InvalidData) or [`UnexpectedEof`](https://doc.rust-lang.org/std/io/enum.ErrorKind.html#variant.UnexpectedEof) error kinds.
/// Store based on the `Sled <https://sled.rs/>`_ key-value database.
/// Store based on the `Sled <https://sled.rs/>`_ key-value database.
///
///
/// In-memory store.
/// In-memory store.
/// It encodes a `RDF dataset <https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-dataset>`_ and allows to query and update it using SPARQL.
/// It encodes a `RDF dataset <https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-dataset>`_ and allows to query it using SPARQL.
///
///
/// :param path: the path of the directory in which Sled should read and write its data. If the directoty does not exist, it is created. If no directory is provided a temporary one is created and removed when the Python garbage collector removes the store.
/// :param path: the path of the directory in which Sled should read and write its data. If the directoty does not exist, it is created. If no directory is provided a temporary one is created and removed when the Python garbage collector removes the store.