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.
///
/// It currently supports the following formats:
/// * [N-Triples](https://www.w3.org/TR/n-triples/) ([`GraphFormat::NTriples`](../enum.GraphFormat.html#variant.NTriples))
/// * [Turtle](https://www.w3.org/TR/turtle/) ([`GraphFormat::Turtle`](../enum.GraphFormat.html#variant.Turtle))
/// * [RDF/XML](https://www.w3.org/TR/rdf-syntax-grammar/) ([`GraphFormat::RdfXml`](../enum.GraphFormat.html#variant.RdfXml))
/// * [N-Triples](https://www.w3.org/TR/n-triples/) ([`GraphFormat::NTriples`](super::GraphFormat::NTriples))
/// * [Turtle](https://www.w3.org/TR/turtle/) ([`GraphFormat::Turtle`](super::GraphFormat::Turtle))
/// * [RDF/XML](https://www.w3.org/TR/rdf-syntax-grammar/) ([`GraphFormat::RdfXml`](super::GraphFormat::RdfXml))
///
/// ```
/// use oxigraph::io::{GraphFormat, GraphParser};
@ -65,7 +65,7 @@ impl GraphParser {
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> {
Ok(TripleReader {
mapper: RioMapper::default(),
@ -84,7 +84,7 @@ impl GraphParser {
}
/// 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};
@ -163,8 +163,8 @@ impl<R: BufRead> TripleReader<R> {
/// A parser for RDF dataset serialization formats.
///
/// It currently supports the following formats:
/// * [N-Quads](https://www.w3.org/TR/n-quads/) ([`DatasetFormat::NQuads`](../enum.DatasetFormat.html#variant.NQuads))
/// * [TriG](https://www.w3.org/TR/trig/) ([`DatasetFormat::TriG`](../enum.DatasetFormat.html#variant.TriG))
/// * [N-Quads](https://www.w3.org/TR/n-quads/) ([`DatasetFormat::NQuads`](super::DatasetFormat::NQuads))
/// * [TriG](https://www.w3.org/TR/trig/) ([`DatasetFormat::TriG`](super::DatasetFormat::TriG))
///
/// ```
/// use oxigraph::io::{DatasetFormat, DatasetParser};
@ -213,7 +213,7 @@ impl DatasetParser {
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> {
Ok(QuadReader {
mapper: RioMapper::default(),
@ -229,7 +229,7 @@ impl DatasetParser {
}
/// 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};

@ -11,9 +11,9 @@ use std::io::Write;
/// A serializer for RDF graph serialization formats.
///
/// It currently supports the following formats:
/// * [N-Triples](https://www.w3.org/TR/n-triples/) ([`GraphFormat::NTriples`](../enum.GraphFormat.html#variant.NTriples))
/// * [Turtle](https://www.w3.org/TR/turtle/) ([`GraphFormat::Turtle`](../enum.GraphFormat.html#variant.Turtle))
/// * [RDF/XML](https://www.w3.org/TR/rdf-syntax-grammar/) ([`GraphFormat::RdfXml`](../enum.GraphFormat.html#variant.RdfXml))
/// * [N-Triples](https://www.w3.org/TR/n-triples/) ([`GraphFormat::NTriples`](super::GraphFormat::NTriples))
/// * [Turtle](https://www.w3.org/TR/turtle/) ([`GraphFormat::Turtle`](super::GraphFormat::Turtle))
/// * [RDF/XML](https://www.w3.org/TR/rdf-syntax-grammar/) ([`GraphFormat::RdfXml`](super::GraphFormat::RdfXml))
///
/// ```
/// use oxigraph::io::{GraphFormat, GraphSerializer};
@ -42,7 +42,7 @@ impl GraphSerializer {
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> {
Ok(TripleWriter {
formatter: match self.format {
@ -55,9 +55,9 @@ impl GraphSerializer {
}
/// 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};
@ -112,8 +112,8 @@ impl<W: Write> TripleWriter<W> {
/// A serializer for RDF graph serialization formats.
///
/// It currently supports the following formats:
/// * [N-Quads](https://www.w3.org/TR/n-quads/) ([`DatasetFormat::NQuads`](../enum.DatasetFormat.html#variant.NQuads))
/// * [TriG](https://www.w3.org/TR/trig/) ([`DatasetFormat::TriG`](../enum.DatasetFormat.html#variant.TriG))
/// * [N-Quads](https://www.w3.org/TR/n-quads/) ([`DatasetFormat::NQuads`](super::DatasetFormat::NQuads))
/// * [TriG](https://www.w3.org/TR/trig/) ([`DatasetFormat::TriG`](super::DatasetFormat::TriG))
///
/// ```
/// use oxigraph::io::{DatasetFormat, DatasetSerializer};
@ -143,7 +143,7 @@ impl DatasetSerializer {
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> {
Ok(QuadWriter {
formatter: match self.format {
@ -155,9 +155,9 @@ impl DatasetSerializer {
}
/// 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};

@ -3,20 +3,20 @@
//! 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:
//! * [`MemoryStore`](store/memory/struct.MemoryStore.html): 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.
//! * [`MemoryStore`](store::memory::MemoryStore): a simple in memory implementation.
//! * [`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.
//! 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.
//! 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.
//!
//! 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;

@ -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.
///
/// 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 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
/// 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 {
let id = id.into();
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.
///
/// 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 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
/// 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 {
if let Some(numerical_id) = to_integer_id(id) {
Self(BlankNodeRefContent::Anonymous {
@ -336,7 +336,7 @@ fn to_integer_id(id: &str) -> Option<u128> {
Some(value)
}
/// An error raised during [`BlankNode`](struct.BlankNode.html) IDs validation.
/// An error raised during [`BlankNode`] IDs validation.
#[allow(missing_copy_implementations)]
#[derive(Debug)]
pub struct BlankNodeIdParseError {}

@ -82,7 +82,7 @@ impl Literal {
/// is valid [BCP47](https://tools.ietf.org/html/bcp47) language tag,
/// 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]
pub fn new_language_tagged_literal_unchecked(
value: impl Into<String>,
@ -461,7 +461,7 @@ impl<'a> LiteralRef<'a> {
/// is valid [BCP47](https://tools.ietf.org/html/bcp47) language tag,
/// 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]
pub fn new_language_tagged_literal_unchecked(value: &'a str, language: &'a str) -> Self {
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.
///
/// [`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]
pub fn new_unchecked(iri: impl Into<String>) -> Self {
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.
///
/// [`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]
pub const fn new_unchecked(iri: &'a str) -> Self {
Self { iri }

@ -1,5 +1,4 @@
//! This crate provides implementation of [Sophia] traits for the `model` module.
//! [Sophia]: https://docs.rs/sophia/latest/sophia/
//! This crate provides implementation of [Sophia](https://docs.rs/sophia/) traits for the `model` module.
use crate::model::*;
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
/// (e.g. a literal into `NamedNode`).
#[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 {
//! [RDF](https://www.w3.org/TR/rdf11-concepts/) vocabulary

@ -1,6 +1,6 @@
//! [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 csv_results;
@ -114,7 +114,7 @@ impl Default for 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]
pub fn with_service_handler(mut self, service_handler: impl ServiceHandler + 'static) -> Self {
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;
@ -285,7 +285,7 @@ pub struct 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
/// 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
/// 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]
pub fn new_unchecked(name: impl Into<String>) -> Self {
Variable { name: name.into() }
@ -513,7 +513,7 @@ fn validate_variable_identifier(id: &str) -> Result<(), VariableNameParseError>
Ok(())
}
/// An error raised during [`Variable`](struct.Variable.html) name validation.
/// An error raised during [`Variable`] name validation.
#[allow(missing_copy_implementations)]
#[derive(Debug)]
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.
///
/// 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.
///
/// ```
@ -52,7 +52,7 @@ use std::error::Error;
pub trait ServiceHandler {
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>;
}

@ -26,7 +26,7 @@ use std::{fmt, io};
/// 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 is cheap to build using the [`MemoryStore::new()`](#method.new) method.
/// It is cheap to build using the [`MemoryStore::new()`] method.
///
/// Usage example:
/// ```
@ -312,10 +312,10 @@ impl MemoryStore {
///
/// 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.
/// 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 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 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`](std::io::ErrorKind::InvalidData) or [`UnexpectedEof`](std::io::ErrorKind::UnexpectedEof) error kinds.
pub fn load_graph<'a>(
&self,
reader: impl BufRead,
@ -350,10 +350,10 @@ impl MemoryStore {
///
/// 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.
/// 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 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 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`](std::io::ErrorKind::InvalidData) or [`UnexpectedEof`](std::io::ErrorKind::UnexpectedEof) error kinds.
pub fn load_dataset(
&self,
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 {
ops: Vec<TransactionOp>,
}
@ -1122,8 +1122,8 @@ impl MemoryTransaction {
/// considered by the transaction. Rollback the transaction by making the transaction closure
/// 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.
/// 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`](std::io::ErrorKind::InvalidData) or [`UnexpectedEof`](std::io::ErrorKind::UnexpectedEof) error kinds.
pub fn load_graph<'a>(
&mut self,
reader: impl BufRead,
@ -1169,8 +1169,8 @@ impl MemoryTransaction {
/// considered by the transaction. Rollback the transaction by making the transaction closure
/// 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.
/// 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`](std::io::ErrorKind::InvalidData) or [`UnexpectedEof`](std::io::ErrorKind::UnexpectedEof) error kinds.
pub fn load_dataset(
&mut self,
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 {
iter: IntoIter<EncodedQuad>,
store: MemoryStore,

@ -123,7 +123,7 @@ impl RocksDbStore {
/// 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(
&self,
query: impl TryInto<Query, Error = impl Into<EvaluationError>>,
@ -142,7 +142,7 @@ impl RocksDbStore {
/// 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(
&self,
subject: Option<NamedOrBlankNodeRef<'_>>,
@ -211,7 +211,7 @@ impl RocksDbStore {
/// The store does not track the existence of empty named graphs.
/// 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(
&self,
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.
///
/// 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>>(
&'a self,
f: impl FnOnce(&mut RocksDbTransaction<'a>) -> Result<(), E>,
@ -250,12 +250,12 @@ impl RocksDbStore {
/// 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,
/// 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 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 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`](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.
pub fn load_graph<'a>(
&self,
@ -278,12 +278,12 @@ impl RocksDbStore {
/// 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,
/// 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 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 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`](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.
pub fn load_dataset(
&self,
@ -319,7 +319,7 @@ impl RocksDbStore {
/// 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>(
&self,
writer: impl Write,
@ -336,7 +336,7 @@ impl RocksDbStore {
/// 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> {
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> {
store: &'a RocksDbStore,
batch: WriteBatch,
@ -877,14 +877,14 @@ impl RocksDbTransaction<'_> {
/// the full file content is temporarily stored in main memory.
/// 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
/// considered by the transaction. Rollback the transaction by making the transaction closure
/// 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.
/// 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`](std::io::ErrorKind::InvalidData) or [`UnexpectedEof`](std::io::ErrorKind::UnexpectedEof) error kinds.
pub fn load_graph<'a>(
&mut self,
reader: impl BufRead,
@ -902,14 +902,14 @@ impl RocksDbTransaction<'_> {
/// the full file content is temporarily stored in main memory.
/// 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
/// considered by the transaction. Rollback the transaction by making the transaction closure
/// 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.
/// 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`](std::io::ErrorKind::InvalidData) or [`UnexpectedEof`](std::io::ErrorKind::UnexpectedEof) error kinds.
pub fn load_dataset(
&mut self,
reader: impl BufRead,
@ -1167,7 +1167,7 @@ fn map_err(e: Error) -> io::Error {
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 {
inner: QuadIterInner,
}

@ -133,7 +133,7 @@ impl SledStore {
/// 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(
&self,
query: impl TryInto<Query, Error = impl Into<EvaluationError>>,
@ -152,7 +152,7 @@ impl SledStore {
/// 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(
&self,
subject: Option<NamedOrBlankNodeRef<'_>>,
@ -203,7 +203,7 @@ impl SledStore {
/// The store does not track the existence of empty named graphs.
/// 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(
&self,
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.
/// 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.
/// 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 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 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`](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.
pub fn load_graph<'a>(
&self,
@ -307,12 +307,12 @@ impl SledStore {
/// only a part of it may be written to the store.
/// 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.
/// 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 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 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`](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.
pub fn load_dataset(
&self,
@ -329,7 +329,7 @@ impl SledStore {
///
/// 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.
/// 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> {
let mut this = self;
let quad = this.encode_quad(quad.into())?;
@ -340,7 +340,7 @@ impl SledStore {
///
/// 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.
/// 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> {
if let Some(quad) = self.get_encoded_quad(quad.into())? {
let mut this = self;
@ -352,7 +352,7 @@ impl SledStore {
/// 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>(
&self,
writer: impl Write,
@ -369,7 +369,7 @@ impl SledStore {
/// 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> {
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> {
id2str: &'a TransactionalTree,
spog: &'a TransactionalTree,
@ -822,14 +822,14 @@ impl SledTransaction<'_> {
/// the full file content might be temporarily stored in main memory.
/// 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
/// considered by the transaction. Rollback the transaction by making the transaction closure
/// 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.
/// 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`](std::io::ErrorKind::InvalidData) or [`UnexpectedEof`](std::io::ErrorKind::UnexpectedEof) error kinds.
pub fn load_graph<'a>(
&self,
reader: impl BufRead,
@ -848,14 +848,14 @@ impl SledTransaction<'_> {
/// the full file content might be temporarily stored in main memory.
/// 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
/// considered by the transaction. Rollback the transaction by making the transaction closure
/// 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.
/// 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`](std::io::ErrorKind::InvalidData) or [`UnexpectedEof`](std::io::ErrorKind::UnexpectedEof) error kinds.
pub fn load_dataset(
&self,
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 {
inner: QuadIterInner,
}

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

Loading…
Cancel
Save