Makes rustdoc build the internal links in the documentation

pull/69/head
Tpt 4 years ago
parent 75a629860d
commit 7f8bbce07f
  1. 18
      lib/src/io/read.rs
  2. 22
      lib/src/io/write.rs
  3. 10
      lib/src/lib.rs
  4. 10
      lib/src/model/blank_node.rs
  5. 4
      lib/src/model/literal.rs
  6. 4
      lib/src/model/named_node.rs
  7. 5
      lib/src/model/sophia.rs
  8. 2
      lib/src/model/vocab.rs
  9. 4
      lib/src/sparql/mod.rs
  10. 8
      lib/src/sparql/model.rs
  11. 4
      lib/src/sparql/service.rs
  12. 26
      lib/src/store/memory.rs
  13. 44
      lib/src/store/rocksdb.rs
  14. 46
      lib/src/store/sled.rs
  15. 3
      lib/src/store/sophia.rs

@ -14,9 +14,9 @@ use std::io::BufRead;
/// Parsers for RDF graph serialization formats. /// Parsers for RDF graph serialization formats.
/// ///
/// It currently supports the following formats: /// It currently supports the following formats:
/// * [N-Triples](https://www.w3.org/TR/n-triples/) ([`GraphFormat::NTriples`](../enum.GraphFormat.html#variant.NTriples)) /// * [N-Triples](https://www.w3.org/TR/n-triples/) ([`GraphFormat::NTriples`](super::GraphFormat::NTriples))
/// * [Turtle](https://www.w3.org/TR/turtle/) ([`GraphFormat::Turtle`](../enum.GraphFormat.html#variant.Turtle)) /// * [Turtle](https://www.w3.org/TR/turtle/) ([`GraphFormat::Turtle`](super::GraphFormat::Turtle))
/// * [RDF/XML](https://www.w3.org/TR/rdf-syntax-grammar/) ([`GraphFormat::RdfXml`](../enum.GraphFormat.html#variant.RdfXml)) /// * [RDF/XML](https://www.w3.org/TR/rdf-syntax-grammar/) ([`GraphFormat::RdfXml`](super::GraphFormat::RdfXml))
/// ///
/// ``` /// ```
/// use oxigraph::io::{GraphFormat, GraphParser}; /// use oxigraph::io::{GraphFormat, GraphParser};
@ -65,7 +65,7 @@ impl GraphParser {
Ok(self) Ok(self)
} }
/// Executes the parsing itself on a [`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html) implementation and returns an iterator of triples /// Executes the parsing itself on a [`BufRead`](std::io::BufRead) implementation and returns an iterator of triples
pub fn read_triples<R: BufRead>(&self, reader: R) -> Result<TripleReader<R>, io::Error> { pub fn read_triples<R: BufRead>(&self, reader: R) -> Result<TripleReader<R>, io::Error> {
Ok(TripleReader { Ok(TripleReader {
mapper: RioMapper::default(), mapper: RioMapper::default(),
@ -84,7 +84,7 @@ impl GraphParser {
} }
/// An iterator yielding read triples. /// An iterator yielding read triples.
/// Could be built using a [`GraphParser`](struct.GraphParser.html). /// Could be built using a [`GraphParser`].
/// ///
/// ``` /// ```
/// use oxigraph::io::{GraphFormat, GraphParser}; /// use oxigraph::io::{GraphFormat, GraphParser};
@ -163,8 +163,8 @@ impl<R: BufRead> TripleReader<R> {
/// A parser for RDF dataset serialization formats. /// A parser for RDF dataset serialization formats.
/// ///
/// It currently supports the following formats: /// It currently supports the following formats:
/// * [N-Quads](https://www.w3.org/TR/n-quads/) ([`DatasetFormat::NQuads`](../enum.DatasetFormat.html#variant.NQuads)) /// * [N-Quads](https://www.w3.org/TR/n-quads/) ([`DatasetFormat::NQuads`](super::DatasetFormat::NQuads))
/// * [TriG](https://www.w3.org/TR/trig/) ([`DatasetFormat::TriG`](../enum.DatasetFormat.html#variant.TriG)) /// * [TriG](https://www.w3.org/TR/trig/) ([`DatasetFormat::TriG`](super::DatasetFormat::TriG))
/// ///
/// ``` /// ```
/// use oxigraph::io::{DatasetFormat, DatasetParser}; /// use oxigraph::io::{DatasetFormat, DatasetParser};
@ -213,7 +213,7 @@ impl DatasetParser {
Ok(self) Ok(self)
} }
/// Executes the parsing itself on a [`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html) implementation and returns an iterator of quads /// Executes the parsing itself on a [`BufRead`](std::io::BufRead) implementation and returns an iterator of quads
pub fn read_quads<R: BufRead>(&self, reader: R) -> Result<QuadReader<R>, io::Error> { pub fn read_quads<R: BufRead>(&self, reader: R) -> Result<QuadReader<R>, io::Error> {
Ok(QuadReader { Ok(QuadReader {
mapper: RioMapper::default(), mapper: RioMapper::default(),
@ -229,7 +229,7 @@ impl DatasetParser {
} }
/// An iterator yielding read quads. /// An iterator yielding read quads.
/// Could be built using a [`DatasetParser`](struct.DatasetParser.html). /// Could be built using a [`DatasetParser`].
/// ///
/// ``` /// ```
/// use oxigraph::io::{DatasetFormat, DatasetParser}; /// use oxigraph::io::{DatasetFormat, DatasetParser};

@ -11,9 +11,9 @@ use std::io::Write;
/// A serializer for RDF graph serialization formats. /// A serializer for RDF graph serialization formats.
/// ///
/// It currently supports the following formats: /// It currently supports the following formats:
/// * [N-Triples](https://www.w3.org/TR/n-triples/) ([`GraphFormat::NTriples`](../enum.GraphFormat.html#variant.NTriples)) /// * [N-Triples](https://www.w3.org/TR/n-triples/) ([`GraphFormat::NTriples`](super::GraphFormat::NTriples))
/// * [Turtle](https://www.w3.org/TR/turtle/) ([`GraphFormat::Turtle`](../enum.GraphFormat.html#variant.Turtle)) /// * [Turtle](https://www.w3.org/TR/turtle/) ([`GraphFormat::Turtle`](super::GraphFormat::Turtle))
/// * [RDF/XML](https://www.w3.org/TR/rdf-syntax-grammar/) ([`GraphFormat::RdfXml`](../enum.GraphFormat.html#variant.RdfXml)) /// * [RDF/XML](https://www.w3.org/TR/rdf-syntax-grammar/) ([`GraphFormat::RdfXml`](super::GraphFormat::RdfXml))
/// ///
/// ``` /// ```
/// use oxigraph::io::{GraphFormat, GraphSerializer}; /// use oxigraph::io::{GraphFormat, GraphSerializer};
@ -42,7 +42,7 @@ impl GraphSerializer {
Self { format } Self { format }
} }
/// Returns a `TripleWriter` allowing writing triples into the given [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) implementation /// Returns a `TripleWriter` allowing writing triples into the given [`Write`](std::io::Write) implementation
pub fn triple_writer<W: Write>(&self, writer: W) -> Result<TripleWriter<W>, io::Error> { pub fn triple_writer<W: Write>(&self, writer: W) -> Result<TripleWriter<W>, io::Error> {
Ok(TripleWriter { Ok(TripleWriter {
formatter: match self.format { formatter: match self.format {
@ -55,9 +55,9 @@ impl GraphSerializer {
} }
/// Allows writing triples. /// Allows writing triples.
/// Could be built using a [`GraphSerializer`](struct.GraphSerializer.html). /// Could be built using a [`GraphSerializer`].
/// ///
/// Warning: Do not forget to run the [`finish`](#method.finish) method to properly write the last bytes of the file. /// Warning: Do not forget to run the [`finish`](TripleWriter::finish()) method to properly write the last bytes of the file.
/// ///
/// ``` /// ```
/// use oxigraph::io::{GraphFormat, GraphSerializer}; /// use oxigraph::io::{GraphFormat, GraphSerializer};
@ -112,8 +112,8 @@ impl<W: Write> TripleWriter<W> {
/// A serializer for RDF graph serialization formats. /// A serializer for RDF graph serialization formats.
/// ///
/// It currently supports the following formats: /// It currently supports the following formats:
/// * [N-Quads](https://www.w3.org/TR/n-quads/) ([`DatasetFormat::NQuads`](../enum.DatasetFormat.html#variant.NQuads)) /// * [N-Quads](https://www.w3.org/TR/n-quads/) ([`DatasetFormat::NQuads`](super::DatasetFormat::NQuads))
/// * [TriG](https://www.w3.org/TR/trig/) ([`DatasetFormat::TriG`](../enum.DatasetFormat.html#variant.TriG)) /// * [TriG](https://www.w3.org/TR/trig/) ([`DatasetFormat::TriG`](super::DatasetFormat::TriG))
/// ///
/// ``` /// ```
/// use oxigraph::io::{DatasetFormat, DatasetSerializer}; /// use oxigraph::io::{DatasetFormat, DatasetSerializer};
@ -143,7 +143,7 @@ impl DatasetSerializer {
Self { format } Self { format }
} }
/// Returns a `QuadWriter` allowing writing triples into the given [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) implementation /// Returns a `QuadWriter` allowing writing triples into the given [`Write`](std::io::Write) implementation
pub fn quad_writer<W: Write>(&self, writer: W) -> Result<QuadWriter<W>, io::Error> { pub fn quad_writer<W: Write>(&self, writer: W) -> Result<QuadWriter<W>, io::Error> {
Ok(QuadWriter { Ok(QuadWriter {
formatter: match self.format { formatter: match self.format {
@ -155,9 +155,9 @@ impl DatasetSerializer {
} }
/// Allows writing triples. /// Allows writing triples.
/// Could be built using a [`DatasetSerializer`](struct.DatasetSerializer.html). /// Could be built using a [`DatasetSerializer`].
/// ///
/// Warning: Do not forget to run the [`finish`](#method.finish) method to properly write the last bytes of the file. /// Warning: Do not forget to run the [`finish`](QuadWriter::finish()) method to properly write the last bytes of the file.
/// ///
/// ``` /// ```
/// use oxigraph::io::{DatasetFormat, DatasetSerializer}; /// use oxigraph::io::{DatasetFormat, DatasetSerializer};

@ -3,20 +3,20 @@
//! Its goal is to provide a compliant, safe and fast graph database. //! Its goal is to provide a compliant, safe and fast graph database.
//! //!
//! It currently provides three store implementations providing [SPARQL](https://www.w3.org/TR/sparql11-overview/) capability: //! It currently provides three store implementations providing [SPARQL](https://www.w3.org/TR/sparql11-overview/) capability:
//! * [`MemoryStore`](store/memory/struct.MemoryStore.html): a simple in memory implementation. //! * [`MemoryStore`](store::memory::MemoryStore): a simple in memory implementation.
//! * [`RocksDbStore`](store/rocksdb/struct.RocksDbStore.html): a file system implementation based on the [RocksDB](https://rocksdb.org/) key-value store. //! * [`RocksDbStore`](store::rocksdb::RocksDbStore): a file system implementation based on the [RocksDB](https://rocksdb.org/) key-value store.
//! It requires the `"rocksdb"` feature to be activated. //! It requires the `"rocksdb"` feature to be activated.
//! The [clang](https://clang.llvm.org/) compiler needs to be installed to compile RocksDB. //! The [clang](https://clang.llvm.org/) compiler needs to be installed to compile RocksDB.
//! * [`SledStore`](store/sled/struct.SledStore.html): another file system implementation based on the [Sled](https://sled.rs/) key-value store. //! * [`SledStore`](store::sled::SledStore): another file system implementation based on the [Sled](https://sled.rs/) key-value store.
//! It requires the `"sled"` feature to be activated. //! It requires the `"sled"` feature to be activated.
//! Sled is much faster to build than RockDB and does not require a C++ compiler. //! Sled is much faster to build than RockDB and does not require a C++ compiler.
//! However, Sled is still in developpment, less tested and data load seems much slower than RocksDB. //! However, Sled is still in developpment, less tested and data load seems much slower than RocksDB.
//! //!
//! Oxigraph also provides a set of utility functions for reading, writing and processing RDF files. //! Oxigraph also provides a set of utility functions for reading, writing and processing RDF files.
//! //!
//! The disabled by default `"sophia"` feature provides [`sophia_api`](https://docs.rs/sophia_api/) traits implemention on Oxigraph terms and stores. //! The disabled by default `"sophia"` feature provides [`sophia_api`] traits implemention on Oxigraph terms and stores.
//! //!
//! Usage example with the [`MemoryStore`](store/memory/struct.MemoryStore.html): //! Usage example with the [`MemoryStore`](store::memory::MemoryStore):
//! //!
//! ``` //! ```
//! use oxigraph::MemoryStore; //! use oxigraph::MemoryStore;

@ -9,7 +9,7 @@ use std::str;
/// ///
/// The common way to create a new blank node is to use the [`BlankNode::default`](#impl-Default) function. /// The common way to create a new blank node is to use the [`BlankNode::default`](#impl-Default) function.
/// ///
/// It is also possible to create a blank node from a blank node identifier using the [`BlankNode::new`](#method.new) function. /// It is also possible to create a blank node from a blank node identifier using the [`BlankNode::new()`] function.
/// The blank node identifier must be valid according to N-Triples, Turtle and SPARQL grammars. /// The blank node identifier must be valid according to N-Triples, Turtle and SPARQL grammars.
/// ///
/// The default string formatter is returning an N-Triples, Turtle and SPARQL compatible representation: /// The default string formatter is returning an N-Triples, Turtle and SPARQL compatible representation:
@ -49,7 +49,7 @@ impl BlankNode {
/// It is the caller's responsibility to ensure that `id` is a valid blank node identifier /// It is the caller's responsibility to ensure that `id` is a valid blank node identifier
/// according to N-Triples, Turtle and SPARQL grammars. /// according to N-Triples, Turtle and SPARQL grammars.
/// ///
/// [`new`](#method.new) is a safe version of this constructor and should be used for untrusted data. /// [`BlankNode::new()`] is a safe version of this constructor and should be used for untrusted data.
pub fn new_unchecked(id: impl Into<String>) -> Self { pub fn new_unchecked(id: impl Into<String>) -> Self {
let id = id.into(); let id = id.into();
if let Some(numerical_id) = to_integer_id(&id) { if let Some(numerical_id) = to_integer_id(&id) {
@ -119,7 +119,7 @@ impl Default for BlankNode {
/// ///
/// The common way to create a new blank node is to use the [`BlankNode::default`](#impl-Default) trait method. /// The common way to create a new blank node is to use the [`BlankNode::default`](#impl-Default) trait method.
/// ///
/// It is also possible to create a blank node from a blank node identifier using the [`BlankNodeRef::new`](#method.new) function. /// It is also possible to create a blank node from a blank node identifier using the [`BlankNodeRef::new()`] function.
/// The blank node identifier must be valid according to N-Triples, Turtle and SPARQL grammars. /// The blank node identifier must be valid according to N-Triples, Turtle and SPARQL grammars.
/// ///
/// The default string formatter is returning an N-Triples, Turtle and SPARQL compatible representation: /// The default string formatter is returning an N-Triples, Turtle and SPARQL compatible representation:
@ -158,7 +158,7 @@ impl<'a> BlankNodeRef<'a> {
/// It is the caller's responsibility to ensure that `id` is a valid blank node identifier /// It is the caller's responsibility to ensure that `id` is a valid blank node identifier
/// according to N-Triples, Turtle and SPARQL grammars. /// according to N-Triples, Turtle and SPARQL grammars.
/// ///
/// [`new`](#method.new) is a safe version of this constructor and should be used for untrusted data. /// [`BlankNodeRef::new()`) is a safe version of this constructor and should be used for untrusted data.
pub fn new_unchecked(id: &'a str) -> Self { pub fn new_unchecked(id: &'a str) -> Self {
if let Some(numerical_id) = to_integer_id(id) { if let Some(numerical_id) = to_integer_id(id) {
Self(BlankNodeRefContent::Anonymous { Self(BlankNodeRefContent::Anonymous {
@ -336,7 +336,7 @@ fn to_integer_id(id: &str) -> Option<u128> {
Some(value) Some(value)
} }
/// An error raised during [`BlankNode`](struct.BlankNode.html) IDs validation. /// An error raised during [`BlankNode`] IDs validation.
#[allow(missing_copy_implementations)] #[allow(missing_copy_implementations)]
#[derive(Debug)] #[derive(Debug)]
pub struct BlankNodeIdParseError {} pub struct BlankNodeIdParseError {}

@ -82,7 +82,7 @@ impl Literal {
/// is valid [BCP47](https://tools.ietf.org/html/bcp47) language tag, /// is valid [BCP47](https://tools.ietf.org/html/bcp47) language tag,
/// and is lowercase. /// and is lowercase.
/// ///
/// [`new_language_tagged_literal`](#method.new_language_tagged_literal) is a safe version of this constructor and should be used for untrusted data. /// [`Literal::new_language_tagged_literal()`] is a safe version of this constructor and should be used for untrusted data.
#[inline] #[inline]
pub fn new_language_tagged_literal_unchecked( pub fn new_language_tagged_literal_unchecked(
value: impl Into<String>, value: impl Into<String>,
@ -461,7 +461,7 @@ impl<'a> LiteralRef<'a> {
/// is valid [BCP47](https://tools.ietf.org/html/bcp47) language tag, /// is valid [BCP47](https://tools.ietf.org/html/bcp47) language tag,
/// and is lowercase. /// and is lowercase.
/// ///
/// [`new_language_tagged_literal`](#method.new_language_tagged_literal) is a safe version of this constructor and should be used for untrusted data. /// [`LiteralRef::new_language_tagged_literal()`] is a safe version of this constructor and should be used for untrusted data.
#[inline] #[inline]
pub fn new_language_tagged_literal_unchecked(value: &'a str, language: &'a str) -> Self { pub fn new_language_tagged_literal_unchecked(value: &'a str, language: &'a str) -> Self {
LiteralRef(LiteralRefContent::LanguageTaggedString { value, language }) LiteralRef(LiteralRefContent::LanguageTaggedString { value, language })

@ -34,7 +34,7 @@ impl NamedNode {
/// ///
/// It is the caller's responsibility to ensure that `iri` is a valid IRI. /// It is the caller's responsibility to ensure that `iri` is a valid IRI.
/// ///
/// [`parse`](#method.parse) is a safe version of this constructor and should be used for untrusted data. /// [`NamedNode::parse()`] is a safe version of this constructor and should be used for untrusted data.
#[inline] #[inline]
pub fn new_unchecked(iri: impl Into<String>) -> Self { pub fn new_unchecked(iri: impl Into<String>) -> Self {
Self { iri: iri.into() } Self { iri: iri.into() }
@ -123,7 +123,7 @@ impl<'a> NamedNodeRef<'a> {
/// ///
/// It is the caller's responsibility to ensure that `iri` is a valid IRI. /// It is the caller's responsibility to ensure that `iri` is a valid IRI.
/// ///
/// [`parse`](#method.parse) is a safe version of this constructor and should be used for untrusted data. /// [`NamedNodeRef::parse()`] is a safe version of this constructor and should be used for untrusted data.
#[inline] #[inline]
pub const fn new_unchecked(iri: &'a str) -> Self { pub const fn new_unchecked(iri: &'a str) -> Self {
Self { iri } Self { iri }

@ -1,5 +1,4 @@
//! This crate provides implementation of [Sophia] traits for the `model` module. //! This crate provides implementation of [Sophia](https://docs.rs/sophia/) traits for the `model` module.
//! [Sophia]: https://docs.rs/sophia/latest/sophia/
use crate::model::*; use crate::model::*;
use sophia_api::term::*; use sophia_api::term::*;
@ -393,7 +392,7 @@ impl<'a> From<TripleRef<'a>> for [TermRef<'a>; 3] {
} }
} }
/// Error raised when trying to copy a [Sophia](https://docs.rs/sophia/) /// Error raised when trying to copy a [Sophia](sophia)
/// term as an incompatible Oxigraph term /// term as an incompatible Oxigraph term
/// (e.g. a literal into `NamedNode`). /// (e.g. a literal into `NamedNode`).
#[derive(Clone, Copy, Debug)] #[derive(Clone, Copy, Debug)]

@ -1,4 +1,4 @@
//! Provides ready to use [`NamedNodeRef`s](struct.NamedNodeRef.html) for basic RDF vocabularies //! Provides ready to use [`NamedNodeRef`]s for basic RDF vocabularies
pub mod rdf { pub mod rdf {
//! [RDF](https://www.w3.org/TR/rdf11-concepts/) vocabulary //! [RDF](https://www.w3.org/TR/rdf11-concepts/) vocabulary

@ -1,6 +1,6 @@
//! [SPARQL](https://www.w3.org/TR/sparql11-overview/) implementation. //! [SPARQL](https://www.w3.org/TR/sparql11-overview/) implementation.
//! //!
//! Stores execute SPARQL. See [`MemoryStore`](../store/memory/struct.MemoryStore.html#method.query) for an example. //! Stores execute SPARQL. See [`MemoryStore`](super::store::memory::MemoryStore::query()) for an example.
mod algebra; mod algebra;
mod csv_results; mod csv_results;
@ -114,7 +114,7 @@ impl Default for QueryOptions {
} }
impl QueryOptions { impl QueryOptions {
/// Use a given [`ServiceHandler`](trait.ServiceHandler.html) to execute [SPARQL 1.1 Federated Query](https://www.w3.org/TR/sparql11-federated-query/) SERVICE calls. /// Use a given [`ServiceHandler`] to execute [SPARQL 1.1 Federated Query](https://www.w3.org/TR/sparql11-federated-query/) SERVICE calls.
#[inline] #[inline]
pub fn with_service_handler(mut self, service_handler: impl ServiceHandler + 'static) -> Self { pub fn with_service_handler(mut self, service_handler: impl ServiceHandler + 'static) -> Self {
self.service_handler = Rc::new(ErrorConversionServiceHandler::wrap(service_handler)); self.service_handler = Rc::new(ErrorConversionServiceHandler::wrap(service_handler));

@ -214,7 +214,7 @@ impl QueryResultsFormat {
} }
} }
/// An iterator over [`QuerySolution`s](struct.QuerySolution.html) /// An iterator over [`QuerySolution`]s
/// ///
/// ``` /// ```
/// use oxigraph::MemoryStore; /// use oxigraph::MemoryStore;
@ -285,7 +285,7 @@ pub struct QuerySolution {
} }
impl QuerySolution { impl QuerySolution {
/// Returns a value for a given position in the tuple ([`usize`](https://doc.rust-lang.org/std/primitive.usize.html)) or a given variable name ([`&str`](https://doc.rust-lang.org/std/primitive.str.html) or [`Variable`](struct.Variable.html)) /// Returns a value for a given position in the tuple ([`usize`](std::usize)) or a given variable name ([`&str`](std::str) or [`Variable`])
/// ///
/// ```ignore /// ```ignore
/// let foo = solution.get("foo"); // Get the value of the variable ?foo if it exists /// let foo = solution.get("foo"); // Get the value of the variable ?foo if it exists
@ -434,7 +434,7 @@ impl Variable {
/// It is the caller's responsibility to ensure that `id` is a valid blank node identifier /// It is the caller's responsibility to ensure that `id` is a valid blank node identifier
/// according to the SPARQL grammar. /// according to the SPARQL grammar.
/// ///
/// [`new`](#method.new) is a safe version of this constructor and should be used for untrusted data. /// [`Variable::new()`] is a safe version of this constructor and should be used for untrusted data.
#[inline] #[inline]
pub fn new_unchecked(name: impl Into<String>) -> Self { pub fn new_unchecked(name: impl Into<String>) -> Self {
Variable { name: name.into() } Variable { name: name.into() }
@ -513,7 +513,7 @@ fn validate_variable_identifier(id: &str) -> Result<(), VariableNameParseError>
Ok(()) Ok(())
} }
/// An error raised during [`Variable`](struct.Variable.html) name validation. /// An error raised during [`Variable`] name validation.
#[allow(missing_copy_implementations)] #[allow(missing_copy_implementations)]
#[derive(Debug)] #[derive(Debug)]
pub struct VariableNameParseError {} pub struct VariableNameParseError {}

@ -11,7 +11,7 @@ use std::error::Error;
/// Handler for [SPARQL 1.1 Federated Query](https://www.w3.org/TR/sparql11-federated-query/) SERVICE. /// Handler for [SPARQL 1.1 Federated Query](https://www.w3.org/TR/sparql11-federated-query/) SERVICE.
/// ///
/// Should be given to [`QueryOptions`](struct.QueryOptions.html#method.with_service_handler) /// Should be given to [`QueryOptions`](QueryOptions::with_service_handler())
/// before evaluating a SPARQL query that uses SERVICE calls. /// before evaluating a SPARQL query that uses SERVICE calls.
/// ///
/// ``` /// ```
@ -52,7 +52,7 @@ use std::error::Error;
pub trait ServiceHandler { pub trait ServiceHandler {
type Error: Error + Send + Sync + 'static; type Error: Error + Send + Sync + 'static;
/// Evaluates a [`Query`](struct.Query.html) against a given service identified by a [`NamedNode`](../model/struct.NamedNode.html). /// Evaluates a [`Query`] against a given service identified by a [`NamedNode`](super::model::NamedNode).
fn handle(&self, service_name: NamedNode, query: Query) -> Result<QueryResults, Self::Error>; fn handle(&self, service_name: NamedNode, query: Query) -> Result<QueryResults, Self::Error>;
} }

@ -26,7 +26,7 @@ use std::{fmt, io};
/// 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 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.
/// It is cheap to build using the [`MemoryStore::new()`](#method.new) method. /// It is cheap to build using the [`MemoryStore::new()`] method.
/// ///
/// Usage example: /// Usage example:
/// ``` /// ```
@ -312,10 +312,10 @@ impl MemoryStore {
/// ///
/// Warning: This functions saves the triples during the parsing. /// Warning: This functions saves the triples during the parsing.
/// If the parsing fails in the middle of the file, the triples read before stay in the store. /// If the parsing fails in the middle of the file, the triples read before stay in the store.
/// Use a (memory greedy) [transaction](#method.transaction) if you do not want that. /// Use a (memory greedy) [transaction](MemoryStore::transaction()) if you do not 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 parameter validation like the base IRI use the [`InvalidInput`](std::io::ErrorKind::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. /// Errors related to a bad syntax in the loaded file use the [`InvalidData`](std::io::ErrorKind::InvalidData) or [`UnexpectedEof`](std::io::ErrorKind::UnexpectedEof) error kinds.
pub fn load_graph<'a>( pub fn load_graph<'a>(
&self, &self,
reader: impl BufRead, reader: impl BufRead,
@ -350,10 +350,10 @@ impl MemoryStore {
/// ///
/// Warning: This functions saves the quads during the parsing. /// Warning: This functions saves the quads during the parsing.
/// If the parsing fails in the middle of the file, the quads read before stay in the store. /// If the parsing fails in the middle of the file, the quads read before stay in the store.
/// Use a (memory greedy) [transaction](#method.transaction) if you do not want that. /// Use a (memory greedy) [transaction](MemoryStore::transaction()) if you do not 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 parameter validation like the base IRI use the [`InvalidInput`](std::io::ErrorKind::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. /// Errors related to a bad syntax in the loaded file use the [`InvalidData`](std::io::ErrorKind::InvalidData) or [`UnexpectedEof`](std::io::ErrorKind::UnexpectedEof) error kinds.
pub fn load_dataset( pub fn load_dataset(
&self, &self,
reader: impl BufRead, reader: impl BufRead,
@ -1085,7 +1085,7 @@ fn quad_map_flatten<T: Copy>(gspo: &QuadMap<T>) -> impl Iterator<Item = (T, T, T
}) })
} }
/// Allows inserting and deleting quads during an ACID transaction with the [`MemoryStore`](struct.MemoryStore.html). /// Allows inserting and deleting quads during an ACID transaction with the [`MemoryStore`].
pub struct MemoryTransaction { pub struct MemoryTransaction {
ops: Vec<TransactionOp>, ops: Vec<TransactionOp>,
} }
@ -1122,8 +1122,8 @@ impl MemoryTransaction {
/// 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 parameter validation like the base IRI use the [`InvalidInput`](std::io::ErrorKind::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. /// Errors related to a bad syntax in the loaded file use the [`InvalidData`](std::io::ErrorKind::InvalidData) or [`UnexpectedEof`](std::io::ErrorKind::UnexpectedEof) error kinds.
pub fn load_graph<'a>( pub fn load_graph<'a>(
&mut self, &mut self,
reader: impl BufRead, reader: impl BufRead,
@ -1169,8 +1169,8 @@ impl MemoryTransaction {
/// 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 parameter validation like the base IRI use the [`InvalidInput`](std::io::ErrorKind::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. /// Errors related to a bad syntax in the loaded file use the [`InvalidData`](std::io::ErrorKind::InvalidData) or [`UnexpectedEof`](std::io::ErrorKind::UnexpectedEof) error kinds.
pub fn load_dataset( pub fn load_dataset(
&mut self, &mut self,
reader: impl BufRead, reader: impl BufRead,
@ -1275,7 +1275,7 @@ impl Iterator for EncodedQuadsIter {
} }
} }
/// An iterator returning the quads contained in a [`MemoryStore`](struct.MemoryStore.html). /// An iterator returning the quads contained in a [`MemoryStore`].
pub struct MemoryQuadIter { pub struct MemoryQuadIter {
iter: IntoIter<EncodedQuad>, iter: IntoIter<EncodedQuad>,
store: MemoryStore, store: MemoryStore,

@ -123,7 +123,7 @@ impl RocksDbStore {
/// Executes a [SPARQL 1.1 query](https://www.w3.org/TR/sparql11-query/). /// Executes a [SPARQL 1.1 query](https://www.w3.org/TR/sparql11-query/).
/// ///
/// See [`MemoryStore`](../memory/struct.MemoryStore.html#method.query) for a usage example. /// See [`MemoryStore`](super::memory::MemoryStore::query()) for a usage example.
pub fn query( pub fn query(
&self, &self,
query: impl TryInto<Query, Error = impl Into<EvaluationError>>, query: impl TryInto<Query, Error = impl Into<EvaluationError>>,
@ -142,7 +142,7 @@ impl RocksDbStore {
/// Retrieves quads with a filter on each quad component /// Retrieves quads with a filter on each quad component
/// ///
/// See [`MemoryStore`](../memory/struct.MemoryStore.html#method.quads_for_pattern) for a usage example. /// See [`MemoryStore`](super::memory::MemoryStore::quads_for_pattern()) for a usage example.
pub fn quads_for_pattern( pub fn quads_for_pattern(
&self, &self,
subject: Option<NamedOrBlankNodeRef<'_>>, subject: Option<NamedOrBlankNodeRef<'_>>,
@ -211,7 +211,7 @@ impl RocksDbStore {
/// The store does not track the existence of empty named graphs. /// The store does not track the existence of empty named graphs.
/// This method has no ACID guarantees. /// This method has no ACID guarantees.
/// ///
/// See [`MemoryStore`](../memory/struct.MemoryStore.html#method.update) for a usage example. /// See [`MemoryStore`](super::memory::MemoryStore::update()) for a usage example.
pub fn update( pub fn update(
&self, &self,
update: impl TryInto<Update, Error = impl Into<EvaluationError>>, update: impl TryInto<Update, Error = impl Into<EvaluationError>>,
@ -232,7 +232,7 @@ impl RocksDbStore {
/// ///
/// The transaction data are stored in memory while the transaction is not committed or rollbacked. /// The transaction data are stored in memory while the transaction is not committed or rollbacked.
/// ///
/// See [`MemoryStore`](../memory/struct.MemoryStore.html#method.transaction) for a usage example. /// See [`MemoryStore`](super::memory::MemoryStore::transaction()) for a usage example.
pub fn transaction<'a, E: From<io::Error>>( pub fn transaction<'a, E: From<io::Error>>(
&'a self, &'a self,
f: impl FnOnce(&mut RocksDbTransaction<'a>) -> Result<(), E>, f: impl FnOnce(&mut RocksDbTransaction<'a>) -> Result<(), E>,
@ -250,12 +250,12 @@ impl RocksDbStore {
/// Loads a graph file (i.e. triples) into the store /// Loads a graph file (i.e. triples) into the store
/// ///
/// Warning: This functions saves the triples in batch. If the parsing fails in the middle of the file, /// Warning: This functions saves the triples in batch. If the parsing fails in the middle of the file,
/// only a part of it may be written. Use a (memory greedy) [transaction](#method.transaction) if you do not want that. /// only a part of it may be written. Use a (memory greedy) [transaction](RocksDbStore::transaction()) if you do not want that.
/// ///
/// See [`MemoryStore`](../memory/struct.MemoryStore.html#method.load_graph) for a usage example. /// See [`MemoryStore`](super::memory::MemoryStore::load_graph()) for a usage example.
/// ///
/// 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 parameter validation like the base IRI use the [`InvalidInput`](std::io::ErrorKind::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. /// Errors related to a bad syntax in the loaded file use the [`InvalidData`](std::io::ErrorKind::InvalidData) or [`UnexpectedEof`](std::io::ErrorKind::UnexpectedEof) error kinds.
/// Errors related to data loading into the store use the other error kinds. /// Errors related to data loading into the store use the other error kinds.
pub fn load_graph<'a>( pub fn load_graph<'a>(
&self, &self,
@ -278,12 +278,12 @@ impl RocksDbStore {
/// Loads a dataset file (i.e. quads) into the store. /// Loads a dataset file (i.e. quads) into the store.
/// ///
/// Warning: This functions saves the quads in batch. If the parsing fails in the middle of the file, /// Warning: This functions saves the quads in batch. If the parsing fails in the middle of the file,
/// only a part of it may be written. Use a (memory greedy) [transaction](#method.transaction) if you do not want that. /// only a part of it may be written. Use a (memory greedy) [transaction](RocksDbStore::transaction()) if you do not want that.
/// ///
/// See [`MemoryStore`](../memory/struct.MemoryStore.html#method.load_dataset) for a usage example. /// See [`MemoryStore`](super::memory::MemoryStore::load_dataset()) for a usage example.
/// ///
/// 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 parameter validation like the base IRI use the [`InvalidInput`](std::io::ErrorKind::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. /// Errors related to a bad syntax in the loaded file use the [`InvalidData`](std::io::ErrorKind::InvalidData) or [`UnexpectedEof`](std::io::ErrorKind::UnexpectedEof) error kinds.
/// Errors related to data loading into the store use the other error kinds. /// Errors related to data loading into the store use the other error kinds.
pub fn load_dataset( pub fn load_dataset(
&self, &self,
@ -319,7 +319,7 @@ impl RocksDbStore {
/// Dumps a store graph into a file. /// Dumps a store graph into a file.
/// ///
/// See [`MemoryStore`](../memory/struct.MemoryStore.html#method.dump_graph) for a usage example. /// See [`MemoryStore`](super::memory::MemoryStore::dump_graph()) for a usage example.
pub fn dump_graph<'a>( pub fn dump_graph<'a>(
&self, &self,
writer: impl Write, writer: impl Write,
@ -336,7 +336,7 @@ impl RocksDbStore {
/// Dumps the store into a file. /// Dumps the store into a file.
/// ///
/// See [`MemoryStore`](../memory/struct.MemoryStore.html#method.dump_dataset) for a usage example. /// See [`MemoryStore`](super::memory::MemoryStore::dump_dataset()) for a usage example.
pub fn dump_dataset(&self, writer: impl Write, syntax: DatasetFormat) -> Result<(), io::Error> { pub fn dump_dataset(&self, writer: impl Write, syntax: DatasetFormat) -> Result<(), io::Error> {
dump_dataset(self.iter(), writer, syntax) dump_dataset(self.iter(), writer, syntax)
} }
@ -862,7 +862,7 @@ impl WritableEncodedStore for AutoBatchWriter<'_> {
} }
} }
/// Allows inserting and deleting quads during an ACID transaction with the [`RocksDbStore`](struct.RocksDbStore.html). /// Allows inserting and deleting quads during an ACID transaction with the [`RocksDbStore`].
pub struct RocksDbTransaction<'a> { pub struct RocksDbTransaction<'a> {
store: &'a RocksDbStore, store: &'a RocksDbStore,
batch: WriteBatch, batch: WriteBatch,
@ -877,14 +877,14 @@ impl RocksDbTransaction<'_> {
/// the full file content is temporarily stored in main memory. /// the full file content is temporarily stored in main memory.
/// Do not use for big files. /// Do not use for big files.
/// ///
/// See [`MemoryTransaction`](../memory/struct.MemoryTransaction.html#method.load_graph) for a usage example. /// See [`MemoryTransaction`](super::memory::MemoryTransaction::load_graph()) for a usage example.
/// ///
/// 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 parameter validation like the base IRI use the [`InvalidInput`](std::io::ErrorKind::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. /// Errors related to a bad syntax in the loaded file use the [`InvalidData`](std::io::ErrorKind::InvalidData) or [`UnexpectedEof`](std::io::ErrorKind::UnexpectedEof) error kinds.
pub fn load_graph<'a>( pub fn load_graph<'a>(
&mut self, &mut self,
reader: impl BufRead, reader: impl BufRead,
@ -902,14 +902,14 @@ impl RocksDbTransaction<'_> {
/// the full file content is temporarily stored in main memory. /// the full file content is temporarily stored in main memory.
/// Do not use for big files. /// Do not use for big files.
/// ///
/// See [`MemoryTransaction`](../memory/struct.MemoryTransaction.html#method.load_dataset) for a usage example. /// See [`MemoryTransaction`](super::memory::MemoryTransaction::load_dataset()) for a usage example.
/// ///
/// 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 parameter validation like the base IRI use the [`InvalidInput`](std::io::ErrorKind::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. /// Errors related to a bad syntax in the loaded file use the [`InvalidData`](std::io::ErrorKind::InvalidData) or [`UnexpectedEof`](std::io::ErrorKind::UnexpectedEof) error kinds.
pub fn load_dataset( pub fn load_dataset(
&mut self, &mut self,
reader: impl BufRead, reader: impl BufRead,
@ -1167,7 +1167,7 @@ fn map_err(e: Error) -> io::Error {
io::Error::new(io::ErrorKind::Other, e) io::Error::new(io::ErrorKind::Other, e)
} }
/// An iterator returning the quads contained in a [`RocksDbStore`](struct.RocksDbStore.html). /// An iterator returning the quads contained in a [`RocksDbStore`].
pub struct RocksDbQuadIter { pub struct RocksDbQuadIter {
inner: QuadIterInner, inner: QuadIterInner,
} }

@ -133,7 +133,7 @@ impl SledStore {
/// Executes a [SPARQL 1.1 query](https://www.w3.org/TR/sparql11-query/). /// Executes a [SPARQL 1.1 query](https://www.w3.org/TR/sparql11-query/).
/// ///
/// See [`MemoryStore`](../memory/struct.MemoryStore.html#method.query) for a usage example. /// See [`MemoryStore`](super::memory::MemoryStore::query()) for a usage example.
pub fn query( pub fn query(
&self, &self,
query: impl TryInto<Query, Error = impl Into<EvaluationError>>, query: impl TryInto<Query, Error = impl Into<EvaluationError>>,
@ -152,7 +152,7 @@ impl SledStore {
/// Retrieves quads with a filter on each quad component /// Retrieves quads with a filter on each quad component
/// ///
/// See [`MemoryStore`](../memory/struct.MemoryStore.html#method.quads_for_pattern) for a usage example. /// See [`MemoryStore`](super::memory::MemoryStore::quads_for_pattern()) for a usage example.
pub fn quads_for_pattern( pub fn quads_for_pattern(
&self, &self,
subject: Option<NamedOrBlankNodeRef<'_>>, subject: Option<NamedOrBlankNodeRef<'_>>,
@ -203,7 +203,7 @@ impl SledStore {
/// The store does not track the existence of empty named graphs. /// The store does not track the existence of empty named graphs.
/// This method has no ACID guarantees. /// This method has no ACID guarantees.
/// ///
/// See [`MemoryStore`](../memory/struct.MemoryStore.html#method.update) for a usage example. /// See [`MemoryStore`](super::memory::MemoryStore::update()) for a usage example.
pub fn update( pub fn update(
&self, &self,
update: impl TryInto<Update, Error = impl Into<EvaluationError>>, update: impl TryInto<Update, Error = impl Into<EvaluationError>>,
@ -282,12 +282,12 @@ impl SledStore {
/// only a part of it may be written to the store. /// only a part of it may be written to the store.
/// Also, this method is optimized for performances and is not atomic. /// Also, this method is optimized for performances and is not atomic.
/// It might leave the store in a bad state if a crash happens during a triple insertion. /// It might leave the store in a bad state if a crash happens during a triple insertion.
/// Use a (memory greedy) [transaction](#method.transaction) if you do not want that. /// Use a (memory greedy) [transaction](SledStore::transaction()) if you do not want that.
/// ///
/// See [`MemoryStore`](../memory/struct.MemoryStore.html#method.load_graph) for a usage example. /// See [`MemoryStore`](super::memory::MemoryStore::load_graph()) for a usage example.
/// ///
/// 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 parameter validation like the base IRI use the [`InvalidInput`](std::io::ErrorKind::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. /// Errors related to a bad syntax in the loaded file use the [`InvalidData`](std::io::ErrorKind::InvalidData) or [`UnexpectedEof`](std::io::ErrorKind::UnexpectedEof) error kinds.
/// Errors related to data loading into the store use the other error kinds. /// Errors related to data loading into the store use the other error kinds.
pub fn load_graph<'a>( pub fn load_graph<'a>(
&self, &self,
@ -307,12 +307,12 @@ impl SledStore {
/// only a part of it may be written to the store. /// only a part of it may be written to the store.
/// Also, this method is optimized for performances and is not atomic. /// Also, this method is optimized for performances and is not atomic.
/// It might leave the store in a bad state if a crash happens during a quad insertion. /// It might leave the store in a bad state if a crash happens during a quad insertion.
/// Use a (memory greedy) [transaction](#method.transaction) if you do not want that. /// Use a (memory greedy) [transaction](SledStore::transaction()) if you do not want that.
/// ///
/// See [`MemoryStore`](../memory/struct.MemoryStore.html#method.load_dataset) for a usage example. /// See [`MemoryStore`](super::memory::MemoryStore::load_dataset()) for a usage example.
/// ///
/// 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 parameter validation like the base IRI use the [`InvalidInput`](std::io::ErrorKind::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. /// Errors related to a bad syntax in the loaded file use the [`InvalidData`](std::io::ErrorKind::InvalidData) or [`UnexpectedEof`](std::io::ErrorKind::UnexpectedEof) error kinds.
/// Errors related to data loading into the store use the other error kinds. /// Errors related to data loading into the store use the other error kinds.
pub fn load_dataset( pub fn load_dataset(
&self, &self,
@ -329,7 +329,7 @@ impl SledStore {
/// ///
/// This method is optimized for performances and is not atomic. /// This method is optimized for performances and is not atomic.
/// It might leave the store in a bad state if a crash happens during the insertion. /// It might leave the store in a bad state if a crash happens during the insertion.
/// Use a (memory greedy) [transaction](#method.transaction) if you do not want that. /// Use a (memory greedy) [transaction](SledStore::transaction()) if you do not want that.
pub fn insert<'a>(&self, quad: impl Into<QuadRef<'a>>) -> Result<(), io::Error> { pub fn insert<'a>(&self, quad: impl Into<QuadRef<'a>>) -> Result<(), io::Error> {
let mut this = self; let mut this = self;
let quad = this.encode_quad(quad.into())?; let quad = this.encode_quad(quad.into())?;
@ -340,7 +340,7 @@ impl SledStore {
/// ///
/// This method is optimized for performances and is not atomic. /// This method is optimized for performances and is not atomic.
/// It might leave the store in a bad state if a crash happens during the removal. /// It might leave the store in a bad state if a crash happens during the removal.
/// Use a (memory greedy) [transaction](#method.transaction) if you do not want that. /// Use a (memory greedy) [transaction](SledStore::transaction()) if you do not want that.
pub fn remove<'a>(&self, quad: impl Into<QuadRef<'a>>) -> Result<(), io::Error> { pub fn remove<'a>(&self, quad: impl Into<QuadRef<'a>>) -> Result<(), io::Error> {
if let Some(quad) = self.get_encoded_quad(quad.into())? { if let Some(quad) = self.get_encoded_quad(quad.into())? {
let mut this = self; let mut this = self;
@ -352,7 +352,7 @@ impl SledStore {
/// Dumps a store graph into a file. /// Dumps a store graph into a file.
/// ///
/// See [`MemoryStore`](../memory/struct.MemoryStore.html#method.dump_graph) for a usage example. /// See [`MemoryStore`](super::memory::MemoryStore::dump_graph()) for a usage example.
pub fn dump_graph<'a>( pub fn dump_graph<'a>(
&self, &self,
writer: impl Write, writer: impl Write,
@ -369,7 +369,7 @@ impl SledStore {
/// Dumps the store into a file. /// Dumps the store into a file.
/// ///
/// See [`MemoryStore`](../memory/struct.MemoryStore.html#method.dump_dataset) for a usage example. /// See [`MemoryStore`](super::memory::MemoryStore::dump_dataset()) for a usage example.
pub fn dump_dataset(&self, writer: impl Write, format: DatasetFormat) -> Result<(), io::Error> { pub fn dump_dataset(&self, writer: impl Write, format: DatasetFormat) -> Result<(), io::Error> {
dump_dataset(self.iter(), writer, format) dump_dataset(self.iter(), writer, format)
} }
@ -801,7 +801,7 @@ impl<'a> WritableEncodedStore for &'a SledStore {
} }
} }
/// Allows inserting and deleting quads during an ACID transaction with the [`SledStore`](struct.SledStore.html). /// Allows inserting and deleting quads during an ACID transaction with the [`SledStore`].
pub struct SledTransaction<'a> { pub struct SledTransaction<'a> {
id2str: &'a TransactionalTree, id2str: &'a TransactionalTree,
spog: &'a TransactionalTree, spog: &'a TransactionalTree,
@ -822,14 +822,14 @@ impl SledTransaction<'_> {
/// the full file content might be temporarily stored in main memory. /// the full file content might be temporarily stored in main memory.
/// Do not use for big files. /// Do not use for big files.
/// ///
/// See [`MemoryTransaction`](../memory/struct.MemoryTransaction.html#method.load_graph) for a usage example. /// See [`MemoryTransaction`](super::memory::MemoryTransaction::load_graph()) for a usage example.
/// ///
/// 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 parameter validation like the base IRI use the [`InvalidInput`](std::io::ErrorKind::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. /// Errors related to a bad syntax in the loaded file use the [`InvalidData`](std::io::ErrorKind::InvalidData) or [`UnexpectedEof`](std::io::ErrorKind::UnexpectedEof) error kinds.
pub fn load_graph<'a>( pub fn load_graph<'a>(
&self, &self,
reader: impl BufRead, reader: impl BufRead,
@ -848,14 +848,14 @@ impl SledTransaction<'_> {
/// the full file content might be temporarily stored in main memory. /// the full file content might be temporarily stored in main memory.
/// Do not use for big files. /// Do not use for big files.
/// ///
/// See [`MemoryTransaction`](../memory/struct.MemoryTransaction.html#method.load_dataset) for a usage example. /// See [`MemoryTransaction`](super::memory::MemoryTransaction::load_dataset()) for a usage example.
/// ///
/// 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 parameter validation like the base IRI use the [`InvalidInput`](std::io::ErrorKind::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. /// Errors related to a bad syntax in the loaded file use the [`InvalidData`](std::io::ErrorKind::InvalidData) or [`UnexpectedEof`](std::io::ErrorKind::UnexpectedEof) error kinds.
pub fn load_dataset( pub fn load_dataset(
&self, &self,
reader: impl BufRead, reader: impl BufRead,
@ -1222,7 +1222,7 @@ impl Iterator for DecodingQuadIterator {
} }
} }
/// An iterator returning the quads contained in a [`SledStore`](struct.SledStore.html). /// An iterator returning the quads contained in a [`SledStore`].
pub struct SledQuadIter { pub struct SledQuadIter {
inner: QuadIterInner, inner: QuadIterInner,
} }

@ -1,5 +1,4 @@
//! This crate provides implementation of [Sophia] traits for the `store` module. //! This crate provides implementation of [Sophia](https://docs.rs/sophia/) traits for the `store` module.
//! [Sophia]: https://docs.rs/sophia/latest/sophia/
use crate::model::*; use crate::model::*;
use crate::sparql::{EvaluationError, QueryResults}; use crate::sparql::{EvaluationError, QueryResults};
use crate::store::*; use crate::store::*;

Loading…
Cancel
Save