From 7f8bbce07fc10232f95b11b4ac3232afb96f7e94 Mon Sep 17 00:00:00 2001 From: Tpt Date: Sat, 28 Nov 2020 17:02:08 +0100 Subject: [PATCH] Makes rustdoc build the internal links in the documentation --- lib/src/io/read.rs | 18 +++++++-------- lib/src/io/write.rs | 22 +++++++++--------- lib/src/lib.rs | 10 ++++---- lib/src/model/blank_node.rs | 10 ++++---- lib/src/model/literal.rs | 4 ++-- lib/src/model/named_node.rs | 4 ++-- lib/src/model/sophia.rs | 5 ++-- lib/src/model/vocab.rs | 2 +- lib/src/sparql/mod.rs | 4 ++-- lib/src/sparql/model.rs | 8 +++---- lib/src/sparql/service.rs | 4 ++-- lib/src/store/memory.rs | 26 ++++++++++----------- lib/src/store/rocksdb.rs | 44 +++++++++++++++++------------------ lib/src/store/sled.rs | 46 ++++++++++++++++++------------------- lib/src/store/sophia.rs | 3 +-- 15 files changed, 104 insertions(+), 106 deletions(-) diff --git a/lib/src/io/read.rs b/lib/src/io/read.rs index 7621bccc..32066e8c 100644 --- a/lib/src/io/read.rs +++ b/lib/src/io/read.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(&self, reader: R) -> Result, 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 TripleReader { /// 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(&self, reader: R) -> Result, 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}; diff --git a/lib/src/io/write.rs b/lib/src/io/write.rs index fb5bbc5e..b8e57a28 100644 --- a/lib/src/io/write.rs +++ b/lib/src/io/write.rs @@ -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(&self, writer: W) -> Result, 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 TripleWriter { /// 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(&self, writer: W) -> Result, 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}; diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 69c37cc3..88d4fdfd 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -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; diff --git a/lib/src/model/blank_node.rs b/lib/src/model/blank_node.rs index 406911f9..1999f224 100644 --- a/lib/src/model/blank_node.rs +++ b/lib/src/model/blank_node.rs @@ -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) -> 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 { 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 {} diff --git a/lib/src/model/literal.rs b/lib/src/model/literal.rs index 52be875c..7e0a0fc0 100644 --- a/lib/src/model/literal.rs +++ b/lib/src/model/literal.rs @@ -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, @@ -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 }) diff --git a/lib/src/model/named_node.rs b/lib/src/model/named_node.rs index 12f02c93..e0ef8118 100644 --- a/lib/src/model/named_node.rs +++ b/lib/src/model/named_node.rs @@ -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) -> 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 } diff --git a/lib/src/model/sophia.rs b/lib/src/model/sophia.rs index 6ca458b1..aa29b4e6 100644 --- a/lib/src/model/sophia.rs +++ b/lib/src/model/sophia.rs @@ -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> 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)] diff --git a/lib/src/model/vocab.rs b/lib/src/model/vocab.rs index b603aac7..6e095e75 100644 --- a/lib/src/model/vocab.rs +++ b/lib/src/model/vocab.rs @@ -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 diff --git a/lib/src/sparql/mod.rs b/lib/src/sparql/mod.rs index 58c252d8..f7242203 100644 --- a/lib/src/sparql/mod.rs +++ b/lib/src/sparql/mod.rs @@ -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)); diff --git a/lib/src/sparql/model.rs b/lib/src/sparql/model.rs index bb9ef758..8392d5bc 100644 --- a/lib/src/sparql/model.rs +++ b/lib/src/sparql/model.rs @@ -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) -> 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 {} diff --git a/lib/src/sparql/service.rs b/lib/src/sparql/service.rs index a82a4ba4..98474e33 100644 --- a/lib/src/sparql/service.rs +++ b/lib/src/sparql/service.rs @@ -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; } diff --git a/lib/src/store/memory.rs b/lib/src/store/memory.rs index 546f86f6..5f8e1dcb 100644 --- a/lib/src/store/memory.rs +++ b/lib/src/store/memory.rs @@ -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(gspo: &QuadMap) -> impl Iterator, } @@ -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, store: MemoryStore, diff --git a/lib/src/store/rocksdb.rs b/lib/src/store/rocksdb.rs index c6a21d4d..27591969 100644 --- a/lib/src/store/rocksdb.rs +++ b/lib/src/store/rocksdb.rs @@ -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>, @@ -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>, @@ -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>, @@ -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>( &'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, } diff --git a/lib/src/store/sled.rs b/lib/src/store/sled.rs index b5bcf2ba..cec7902e 100644 --- a/lib/src/store/sled.rs +++ b/lib/src/store/sled.rs @@ -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>, @@ -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>, @@ -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>, @@ -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>) -> 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>) -> 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, } diff --git a/lib/src/store/sophia.rs b/lib/src/store/sophia.rs index 9c7e6283..18f42dc6 100644 --- a/lib/src/store/sophia.rs +++ b/lib/src/store/sophia.rs @@ -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::*;