From 9b202efc2780b54a04372bc1215454bb4d0f9cfc Mon Sep 17 00:00:00 2001 From: Tpt Date: Fri, 14 Aug 2020 12:06:44 +0200 Subject: [PATCH] Fixes some typos --- lib/src/model/blank_node.rs | 4 ++-- lib/src/model/literal.rs | 4 ++-- lib/src/model/named_node.rs | 4 ++-- lib/src/model/triple.rs | 4 ++-- lib/src/model/xsd/date_time.rs | 5 ++++- lib/src/model/xsd/parser.rs | 2 +- lib/src/sparql/mod.rs | 2 +- lib/src/sparql/xml_results.rs | 6 +++--- lib/src/store/memory.rs | 4 ++-- lib/src/store/rocksdb.rs | 2 +- lib/src/store/sled.rs | 2 +- python/src/sparql.rs | 2 +- 12 files changed, 22 insertions(+), 19 deletions(-) diff --git a/lib/src/model/blank_node.rs b/lib/src/model/blank_node.rs index 600342d4..748398b4 100644 --- a/lib/src/model/blank_node.rs +++ b/lib/src/model/blank_node.rs @@ -12,7 +12,7 @@ use std::str; /// It is also possible to create a blank node from a blank node identifier using the [`BlankNode::new`](#method.new) function. /// The blank node identifier must be valid according to N-Triples, Turtle and SPARQL grammars. /// -/// The default string formatter is returning a N-Triples, Turtle and SPARQL compatible representation: +/// The default string formatter is returning an N-Triples, Turtle and SPARQL compatible representation: /// ``` /// use oxigraph::model::BlankNode; /// @@ -122,7 +122,7 @@ impl Default for BlankNode { /// It is also possible to create a blank node from a blank node identifier using the [`BlankNodeRef::new`](#method.new) function. /// The blank node identifier must be valid according to N-Triples, Turtle and SPARQL grammars. /// -/// The default string formatter is returning a N-Triples, Turtle and SPARQL compatible representation: +/// The default string formatter is returning an N-Triples, Turtle and SPARQL compatible representation: /// ``` /// use oxigraph::model::BlankNodeRef; /// diff --git a/lib/src/model/literal.rs b/lib/src/model/literal.rs index dcec157d..79194da5 100644 --- a/lib/src/model/literal.rs +++ b/lib/src/model/literal.rs @@ -11,7 +11,7 @@ use std::option::Option; /// An owned RDF [literal](https://www.w3.org/TR/rdf11-concepts/#dfn-literal) /// -/// The default string formatter is returning a N-Triples, Turtle and SPARQL compatible representation: +/// The default string formatter is returning an N-Triples, Turtle and SPARQL compatible representation: /// ``` /// # use oxilangtag::LanguageTagParseError; /// use oxigraph::model::Literal; @@ -404,7 +404,7 @@ impl From for Literal { /// A borrowed RDF [literal](https://www.w3.org/TR/rdf11-concepts/#dfn-literal) /// -/// The default string formatter is returning a N-Triples, Turtle and SPARQL compatible representation: +/// The default string formatter is returning an N-Triples, Turtle and SPARQL compatible representation: /// ``` /// # use oxilangtag::LanguageTagParseError; /// use oxigraph::model::LiteralRef; diff --git a/lib/src/model/named_node.rs b/lib/src/model/named_node.rs index b7d7d4b3..12f02c93 100644 --- a/lib/src/model/named_node.rs +++ b/lib/src/model/named_node.rs @@ -4,7 +4,7 @@ use std::fmt; /// An owned RDF [IRI](https://www.w3.org/TR/rdf11-concepts/#dfn-iri) /// -/// The default string formatter is returning a N-Triples, Turtle and SPARQL compatible representation: +/// The default string formatter is returning an N-Triples, Turtle and SPARQL compatible representation: /// ``` /// use oxigraph::model::NamedNode; /// @@ -93,7 +93,7 @@ impl PartialEq for &str { /// A borrowed RDF [IRI](https://www.w3.org/TR/rdf11-concepts/#dfn-iri) /// -/// The default string formatter is returning a N-Triples, Turtle and SPARQL compatible representation: +/// The default string formatter is returning an N-Triples, Turtle and SPARQL compatible representation: /// ``` /// use oxigraph::model::NamedNodeRef; /// diff --git a/lib/src/model/triple.rs b/lib/src/model/triple.rs index c91ec348..fb5fbd65 100644 --- a/lib/src/model/triple.rs +++ b/lib/src/model/triple.rs @@ -540,7 +540,7 @@ impl<'a> From> for rio::Triple<'a> { } /// A possible owned graph name. -/// It is the union of [IRIs](https://www.w3.org/TR/rdf11-concepts/#dfn-iri), [blank nodes](https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node) and the [default graph name](https://www.w3.org/TR/rdf11-concepts/#dfn-default-graph). +/// It is the union of [IRIs](https://www.w3.org/TR/rdf11-concepts/#dfn-iri), [blank nodes](https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node), and the [default graph name](https://www.w3.org/TR/rdf11-concepts/#dfn-default-graph). #[derive(Eq, PartialEq, Debug, Clone, Hash)] pub enum GraphName { NamedNode(NamedNode), @@ -649,7 +649,7 @@ impl From for Option { } /// A possible borrowed graph name. -/// It is the union of [IRIs](https://www.w3.org/TR/rdf11-concepts/#dfn-iri), [blank nodes](https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node) and the [default graph name](https://www.w3.org/TR/rdf11-concepts/#dfn-default-graph). +/// It is the union of [IRIs](https://www.w3.org/TR/rdf11-concepts/#dfn-iri), [blank nodes](https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node), and the [default graph name](https://www.w3.org/TR/rdf11-concepts/#dfn-default-graph). #[derive(Eq, PartialEq, Debug, Clone, Copy, Hash)] pub enum GraphNameRef<'a> { NamedNode(NamedNodeRef<'a>), diff --git a/lib/src/model/xsd/date_time.rs b/lib/src/model/xsd/date_time.rs index 220d1e27..de967134 100644 --- a/lib/src/model/xsd/date_time.rs +++ b/lib/src/model/xsd/date_time.rs @@ -1894,7 +1894,10 @@ mod tests { ); assert!(GDay::from_str("---15").unwrap() < GDay::from_str("---16").unwrap()); assert!(GDay::from_str("---15-13:00").unwrap() > GDay::from_str("---16+13:00").unwrap()); - assert!(GDay::from_str("---15-11:00").unwrap() == GDay::from_str("---16+13:00").unwrap()); + assert_eq!( + GDay::from_str("---15-11:00").unwrap(), + GDay::from_str("---16+13:00").unwrap() + ); assert!(GDay::from_str("---15-13:00") .unwrap() .partial_cmp(&GDay::from_str("---16").unwrap()) diff --git a/lib/src/model/xsd/parser.rs b/lib/src/model/xsd/parser.rs index 9f2cbf70..31404eba 100644 --- a/lib/src/model/xsd/parser.rs +++ b/lib/src/model/xsd/parser.rs @@ -54,7 +54,7 @@ impl fmt::Display for XsdParseError { XsdParseErrorKind::TooMuchData { count } => { write!(f, "Too long XML Schema value: {} extra chars", count) } - XsdParseErrorKind::Overflow => write!(f, "Computation overflow or undeflow"), + XsdParseErrorKind::Overflow => write!(f, "Computation overflow or underflow"), XsdParseErrorKind::ParseInt(error) => { write!(f, "Error while parsing integer: {}", error) } diff --git a/lib/src/sparql/mod.rs b/lib/src/sparql/mod.rs index c2c07315..da41d36a 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. //! -//! SPARQL evaluation is done from a store. See [`MemoryStore`](../store/memory/struct.MemoryStore.html#method.query) for an example. +//! Stores execute SPARQL. See [`MemoryStore`](../store/memory/struct.MemoryStore.html#method.query) for an example. mod algebra; mod dataset; diff --git a/lib/src/sparql/xml_results.rs b/lib/src/sparql/xml_results.rs index b46522dc..2f0ada0d 100644 --- a/lib/src/sparql/xml_results.rs +++ b/lib/src/sparql/xml_results.rs @@ -253,13 +253,13 @@ pub fn read_xml_results(source: impl BufRead + 'static) -> Result { - if event.name() == b"results" { - return Ok(QueryResults::Solutions(QuerySolutionIter::new( + return if event.name() == b"results" { + Ok(QueryResults::Solutions(QuerySolutionIter::new( Rc::new(variables.into_iter().map(Variable::new).collect()), Box::new(empty()), ))) } else { - return Err(invalid_data_error(format!("Unexpected autoclosing tag <{}>", reader.decode(event.name()).map_err(map_xml_error)?))) + Err(invalid_data_error(format!("Unexpected autoclosing tag <{}>", reader.decode(event.name()).map_err(map_xml_error)?))) } } _ => return Err(invalid_data_error(format!("Unexpected autoclosing tag <{}>", reader.decode(event.name()).map_err(map_xml_error)?))) diff --git a/lib/src/store/memory.rs b/lib/src/store/memory.rs index ec0c586e..f9d9eafb 100644 --- a/lib/src/store/memory.rs +++ b/lib/src/store/memory.rs @@ -377,7 +377,7 @@ impl MemoryStore { /// It is implemented using the canonicalization approach presented in /// [Canonical Forms for Isomorphic and Equivalent RDF Graphs: Algorithms for Leaning and Labelling Blank Nodes, Aidan Hogan, 2017](http://aidanhogan.com/docs/rdf-canonicalisation.pdf) /// - /// Warning: This implementation worst-case complexity is in O(b!) with b the number of blank node node in the input graphs. + /// Warning: This implementation worst-case complexity is in O(b!) with b the number of blank nodes in the input graphs. pub fn is_isomorphic(&self, other: &Self) -> bool { iso_canonicalize(self) == iso_canonicalize(other) } @@ -1086,7 +1086,7 @@ impl MemoryPreparedQuery { } } -/// Allows to insert and delete quads during an ACID transaction with the [`MemoryStore`](struct.MemoryStore.html). +/// Allows inserting and deleting quads during an ACID transaction with the [`MemoryStore`](struct.MemoryStore.html). pub struct MemoryTransaction { ops: Vec, } diff --git a/lib/src/store/rocksdb.rs b/lib/src/store/rocksdb.rs index d28877a1..61c1bce7 100644 --- a/lib/src/store/rocksdb.rs +++ b/lib/src/store/rocksdb.rs @@ -1080,7 +1080,7 @@ struct StaticDBRowIterator { impl StaticDBRowIterator { /// Creates a static iterator from a non static one by keeping a ARC reference to the database - /// Caller must unsure that the iterator belongs to the same database + /// Caller must ensure that the iterator belongs to the same database /// /// This unsafe method is required to get static iterators and ease the usage of the library /// and make streaming Python bindings possible diff --git a/lib/src/store/sled.rs b/lib/src/store/sled.rs index 0b283a67..f26d06c3 100644 --- a/lib/src/store/sled.rs +++ b/lib/src/store/sled.rs @@ -1010,7 +1010,7 @@ impl<'a> WritableEncodedStore for &'a SledTransaction<'a> { /// Error returned by a Sled transaction #[derive(Debug)] pub enum SledTransactionError { - /// An failure returned by the API user that have aborted the transaction + /// A failure returned by the API user that have aborted the transaction Abort(T), /// A storage related error Storage(io::Error), diff --git a/python/src/sparql.rs b/python/src/sparql.rs index 83dc0091..7a909039 100644 --- a/python/src/sparql.rs +++ b/python/src/sparql.rs @@ -50,7 +50,7 @@ pub fn build_query_options( if let Some(named_graphs) = named_graphs.or(named_graph_uris) { if named_graphs.is_empty()? { return Err(ValueError::py_err( - "The query() method nammed_graphs argument cannot be empty", + "The query() method named_graphs argument cannot be empty", )); } for named_graph in named_graphs.iter()? {