Applies "cargo fix --edition"

pull/10/head
Tpt 6 years ago
parent 0ba67d9614
commit 6862fd346e
  1. 4
      lib/src/model/dataset.rs
  2. 8
      lib/src/model/literal.rs
  3. 20
      lib/src/model/mod.rs
  4. 4
      lib/src/model/named_node.rs
  5. 6
      lib/src/model/triple.rs
  6. 6
      lib/src/model/vocab.rs
  7. 8
      lib/src/rio/ntriples/mod.rs
  8. 6
      lib/src/rio/turtle/mod.rs
  9. 2
      lib/src/rio/utils.rs
  10. 8
      lib/src/rio/xml.rs
  11. 6
      lib/src/sparql/algebra.rs
  12. 14
      lib/src/sparql/eval.rs
  13. 41
      lib/src/sparql/mod.rs
  14. 10
      lib/src/sparql/parser.rs
  15. 24
      lib/src/sparql/plan.rs
  16. 10
      lib/src/sparql/xml_results.rs
  17. 6
      lib/src/store/encoded.rs
  18. 4
      lib/src/store/isomorphism.rs
  19. 8
      lib/src/store/memory.rs
  20. 6
      lib/src/store/mod.rs
  21. 10
      lib/src/store/numeric_encoder.rs
  22. 10
      lib/src/store/rocksdb.rs
  23. 8
      python/src/lib.rs

@ -1,5 +1,5 @@
use model::*;
use Result;
use crate::model::*;
use crate::Result;
/// Trait for [RDF graphs](https://www.w3.org/TR/rdf11-concepts/#dfn-graph)
///

@ -1,9 +1,10 @@
use crate::model::named_node::NamedNode;
use crate::model::vocab::rdf;
use crate::model::vocab::xsd;
use crate::utils::Escaper;
use chrono::DateTime;
use chrono::FixedOffset;
use chrono::NaiveDateTime;
use model::named_node::NamedNode;
use model::vocab::rdf;
use model::vocab::xsd;
use num_traits::identities::Zero;
use num_traits::FromPrimitive;
use num_traits::One;
@ -13,7 +14,6 @@ use rust_decimal::Decimal;
use std::borrow::Cow;
use std::fmt;
use std::option::Option;
use utils::Escaper;
/// A RDF [literal](https://www.w3.org/TR/rdf11-concepts/#dfn-literal)
///

@ -9,13 +9,13 @@ mod named_node;
mod triple;
pub mod vocab;
pub use model::blank_node::BlankNode;
pub use model::dataset::Dataset;
pub use model::dataset::Graph;
pub use model::dataset::NamedGraph;
pub use model::literal::Literal;
pub use model::named_node::NamedNode;
pub use model::triple::NamedOrBlankNode;
pub use model::triple::Quad;
pub use model::triple::Term;
pub use model::triple::Triple;
pub use crate::model::blank_node::BlankNode;
pub use crate::model::dataset::Dataset;
pub use crate::model::dataset::Graph;
pub use crate::model::dataset::NamedGraph;
pub use crate::model::literal::Literal;
pub use crate::model::named_node::NamedNode;
pub use crate::model::triple::NamedOrBlankNode;
pub use crate::model::triple::Quad;
pub use crate::model::triple::Term;
pub use crate::model::triple::Triple;

@ -1,9 +1,9 @@
use crate::Error;
use crate::Result;
use std::fmt;
use std::str::FromStr;
use std::sync::Arc;
use url::Url;
use Error;
use Result;
/// A RDF [IRI](https://www.w3.org/TR/rdf11-concepts/#dfn-iri)
///

@ -1,6 +1,6 @@
use model::blank_node::BlankNode;
use model::literal::Literal;
use model::named_node::NamedNode;
use crate::model::blank_node::BlankNode;
use crate::model::literal::Literal;
use crate::model::named_node::NamedNode;
use std::fmt;
/// The union of [IRIs](https://www.w3.org/TR/rdf11-concepts/#dfn-iri) and [blank nodes](https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node).

@ -2,7 +2,7 @@
pub mod rdf {
//! [RDF 1.1](https://www.w3.org/TR/rdf11-concepts/) vocabulary
use model::named_node::NamedNode;
use crate::model::named_node::NamedNode;
use std::str::FromStr;
lazy_static! {
@ -36,7 +36,7 @@ pub mod rdf {
pub mod rdfs {
//! [RDFS](https://www.w3.org/TR/rdf-schema/) vocabulary
use model::named_node::NamedNode;
use crate::model::named_node::NamedNode;
use std::str::FromStr;
lazy_static! {
@ -47,7 +47,7 @@ pub mod rdfs {
pub mod xsd {
//! `NamedNode`s for [RDF compatible XSD datatypes](https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-compatible-xsd-types)
use model::named_node::NamedNode;
use crate::model::named_node::NamedNode;
use std::str::FromStr;
lazy_static! {

@ -12,9 +12,9 @@ mod grammar {
)
)]
use rio::utils::unescape_characters;
use crate::rio::utils::unescape_characters;
use crate::utils::StaticSliceMap;
use std::borrow::Cow;
use utils::StaticSliceMap;
const UNESCAPE_CHARACTERS: [u8; 8] = [b't', b'b', b'n', b'r', b'f', b'"', b'\'', b'\\'];
lazy_static! {
@ -34,12 +34,12 @@ mod grammar {
include!(concat!(env!("OUT_DIR"), "/ntriples_grammar.rs"));
}
use model::*;
use crate::model::*;
use crate::Result;
use std::collections::BTreeMap;
use std::io::BufRead;
use std::io::BufReader;
use std::io::Read;
use Result;
struct NTriplesIterator<R: Read> {
buffer: String,

@ -12,8 +12,9 @@ mod grammar {
)
)]
use model::*;
use rio::utils::unescape_characters;
use crate::model::*;
use crate::rio::utils::unescape_characters;
use crate::utils::StaticSliceMap;
use std::borrow::Cow;
use std::collections::BTreeMap;
use std::collections::HashMap;
@ -21,7 +22,6 @@ mod grammar {
use std::io::Read;
use url::ParseOptions;
use url::Url;
use utils::StaticSliceMap;
include!(concat!(env!("OUT_DIR"), "/turtle_grammar.rs"));

@ -1,7 +1,7 @@
use crate::utils::StaticSliceMap;
use std::borrow::Cow;
use std::char;
use std::str::Chars;
use utils::StaticSliceMap;
pub fn unescape_unicode_codepoints(input: &str) -> Cow<str> {
if needs_unescape_unicode_codepoints(input) {

@ -1,8 +1,9 @@
//! Implementation of [RDF XML](https://www.w3.org/TR/rdf-syntax-grammar/) syntax
use model::vocab::rdf;
use model::Triple;
use model::*;
use crate::model::vocab::rdf;
use crate::model::Triple;
use crate::model::*;
use crate::Result;
use quick_xml::events::BytesEnd;
use quick_xml::events::BytesStart;
use quick_xml::events::BytesText;
@ -12,7 +13,6 @@ use std::collections::BTreeMap;
use std::io::BufRead;
use std::str::FromStr;
use url::Url;
use Result;
/// Reads a [RDF XML](https://www.w3.org/TR/rdf-syntax-grammar/) file from a Rust `Read` and returns an iterator on the read `Triple`s
///

@ -1,13 +1,13 @@
//! [SPARQL 1.1 Query Algebra](https://www.w3.org/TR/sparql11-query/#sparqlQuery) AST
use model::*;
use crate::model::*;
use crate::utils::Escaper;
use crate::Result;
use std::collections::BTreeMap;
use std::collections::BTreeSet;
use std::fmt;
use std::ops::Add;
use utils::Escaper;
use uuid::Uuid;
use Result;
#[derive(Eq, PartialEq, Ord, PartialOrd, Debug, Clone, Hash)]
pub enum Variable {

@ -1,8 +1,13 @@
use crate::model::BlankNode;
use crate::model::Triple;
use crate::sparql::algebra::*;
use crate::sparql::plan::*;
use crate::store::encoded::EncodedQuadsStore;
use crate::store::numeric_encoder::*;
use crate::Result;
use chrono::DateTime;
use chrono::NaiveDateTime;
use language_tags::LanguageTag;
use model::BlankNode;
use model::Triple;
use num_traits::identities::Zero;
use num_traits::FromPrimitive;
use num_traits::One;
@ -10,8 +15,6 @@ use num_traits::ToPrimitive;
use ordered_float::OrderedFloat;
use regex::RegexBuilder;
use rust_decimal::Decimal;
use sparql::algebra::*;
use sparql::plan::*;
use std::cmp::Ordering;
use std::collections::BTreeMap;
use std::collections::HashSet;
@ -20,10 +23,7 @@ use std::iter::Iterator;
use std::str::FromStr;
use std::sync::Arc;
use std::sync::Mutex;
use store::encoded::EncodedQuadsStore;
use store::numeric_encoder::*;
use uuid::Uuid;
use Result;
const REGEX_SIZE_LIMIT: usize = 1_000_000;

@ -23,19 +23,19 @@
//! }
//! ```
use model::Dataset;
use sparql::algebra::Query;
use sparql::algebra::QueryResult;
use sparql::algebra::Variable;
use sparql::eval::SimpleEvaluator;
use sparql::parser::read_sparql_query;
use sparql::plan::PlanBuilder;
use sparql::plan::PlanNode;
use sparql::plan::TripleTemplate;
use crate::model::Dataset;
use crate::sparql::algebra::Query;
use crate::sparql::algebra::QueryResult;
use crate::sparql::algebra::Variable;
use crate::sparql::eval::SimpleEvaluator;
use crate::sparql::parser::read_sparql_query;
use crate::sparql::plan::PlanBuilder;
use crate::sparql::plan::PlanNode;
use crate::sparql::plan::TripleTemplate;
use crate::store::encoded::EncodedQuadsStore;
use crate::store::encoded::StoreDataset;
use crate::Result;
use std::io::Read;
use store::encoded::EncodedQuadsStore;
use store::encoded::StoreDataset;
use Result;
pub mod algebra;
mod eval;
@ -66,7 +66,10 @@ impl<S: EncodedQuadsStore> SparqlDataset for StoreDataset<S> {
fn prepare_query(&self, query: impl Read) -> Result<SimplePreparedQuery<S>> {
Ok(SimplePreparedQuery(match read_sparql_query(query, None)? {
Query::Select { algebra, dataset } => {
Query::Select {
algebra,
dataset: _,
} => {
let store = self.encoded();
let (plan, variables) = PlanBuilder::build(&*store, &algebra)?;
SimplePreparedQueryOptions::Select {
@ -75,7 +78,10 @@ impl<S: EncodedQuadsStore> SparqlDataset for StoreDataset<S> {
evaluator: SimpleEvaluator::new(store),
}
}
Query::Ask { algebra, dataset } => {
Query::Ask {
algebra,
dataset: _,
} => {
let store = self.encoded();
let (plan, _) = PlanBuilder::build(&*store, &algebra)?;
SimplePreparedQueryOptions::Ask {
@ -86,7 +92,7 @@ impl<S: EncodedQuadsStore> SparqlDataset for StoreDataset<S> {
Query::Construct {
construct,
algebra,
dataset,
dataset: _,
} => {
let store = self.encoded();
let (plan, variables) = PlanBuilder::build(&*store, &algebra)?;
@ -96,7 +102,10 @@ impl<S: EncodedQuadsStore> SparqlDataset for StoreDataset<S> {
evaluator: SimpleEvaluator::new(store),
}
}
Query::Describe { algebra, dataset } => {
Query::Describe {
algebra,
dataset: _,
} => {
let store = self.encoded();
let (plan, _) = PlanBuilder::build(&*store, &algebra)?;
SimplePreparedQueryOptions::Describe {

@ -13,10 +13,11 @@ mod grammar {
)
)]
use model::*;
use rio::utils::unescape_characters;
use rio::utils::unescape_unicode_codepoints;
use sparql::algebra::*;
use crate::model::*;
use crate::rio::utils::unescape_characters;
use crate::rio::utils::unescape_unicode_codepoints;
use crate::sparql::algebra::*;
use crate::utils::StaticSliceMap;
use std::borrow::Cow;
use std::collections::BTreeMap;
use std::collections::HashMap;
@ -24,7 +25,6 @@ mod grammar {
use std::io::Read;
use url::ParseOptions;
use url::Url;
use utils::StaticSliceMap;
struct FocusedTriplePattern<F> {
focus: F,

@ -1,11 +1,11 @@
use model::vocab::xsd;
use model::Literal;
use sparql::algebra::*;
use crate::model::vocab::xsd;
use crate::model::Literal;
use crate::sparql::algebra::*;
use crate::store::encoded::EncodedQuadsStore;
use crate::store::numeric_encoder::EncodedTerm;
use crate::store::numeric_encoder::ENCODED_DEFAULT_GRAPH;
use crate::Result;
use std::collections::BTreeSet;
use store::encoded::EncodedQuadsStore;
use store::numeric_encoder::EncodedTerm;
use store::numeric_encoder::ENCODED_DEFAULT_GRAPH;
use Result;
pub type EncodedTuple = Vec<Option<EncodedTerm>>;
@ -133,7 +133,7 @@ impl PlanNode {
PlanNode::HashDeduplicate { child } => child.add_variables(set),
PlanNode::Skip { child, .. } => child.add_variables(set),
PlanNode::Limit { child, .. } => child.add_variables(set),
PlanNode::Project { child, mapping } => {
PlanNode::Project { child: _, mapping } => {
for i in 0..mapping.len() {
set.insert(i);
}
@ -391,7 +391,7 @@ impl<'a, S: EncodedQuadsStore> PlanBuilder<'a, S> {
.pattern_value_from_term_or_variable(&pattern.object, variables)?,
graph_name,
},
TripleOrPathPattern::Path(pattern) => unimplemented!(),
TripleOrPathPattern::Path(_pattern) => unimplemented!(),
}
}
plan
@ -467,9 +467,9 @@ impl<'a, S: EncodedQuadsStore> PlanBuilder<'a, S> {
position: variable_key(variables, &v),
expression: self.build_for_expression(e, variables)?,
},
GraphPattern::Minus(a, b) => unimplemented!(),
GraphPattern::Service(n, p, s) => unimplemented!(),
GraphPattern::AggregateJoin(g, a) => unimplemented!(),
GraphPattern::Minus(_a, _b) => unimplemented!(),
GraphPattern::Service(_n, _p, _s) => unimplemented!(),
GraphPattern::AggregateJoin(_g, _a) => unimplemented!(),
GraphPattern::Data(bs) => PlanNode::StaticBindings {
tuples: self.encode_bindings(bs, variables)?,
},

@ -1,6 +1,10 @@
//! Implementation of [SPARQL Query Results XML Format](http://www.w3.org/TR/rdf-sparql-XMLres/)
use model::*;
use crate::model::*;
use crate::sparql::algebra::BindingsIterator;
use crate::sparql::algebra::QueryResult;
use crate::sparql::algebra::Variable;
use crate::Result;
use quick_xml::events::BytesDecl;
use quick_xml::events::BytesEnd;
use quick_xml::events::BytesStart;
@ -8,15 +12,11 @@ use quick_xml::events::BytesText;
use quick_xml::events::Event;
use quick_xml::Reader;
use quick_xml::Writer;
use sparql::algebra::BindingsIterator;
use sparql::algebra::QueryResult;
use sparql::algebra::Variable;
use std::collections::BTreeMap;
use std::io::BufRead;
use std::io::Write;
use std::iter::empty;
use std::str::FromStr;
use Result;
pub fn write_xml_results<W: Write>(results: QueryResult, sink: W) -> Result<W> {
let mut writer = Writer::new(sink);

@ -1,12 +1,12 @@
use model::*;
use crate::model::*;
use crate::store::numeric_encoder::*;
use crate::Result;
use std::fmt;
use std::iter::empty;
use std::iter::once;
use std::iter::FromIterator;
use std::iter::Iterator;
use std::sync::Arc;
use store::numeric_encoder::*;
use Result;
/// Defines the Store traits that is used to have efficient binary storage

@ -1,11 +1,11 @@
use model::*;
use crate::model::*;
use crate::Result;
use std::collections::hash_map::DefaultHasher;
use std::collections::BTreeSet;
use std::collections::HashMap;
use std::collections::HashSet;
use std::hash::Hash;
use std::hash::Hasher;
use Result;
#[derive(Eq, PartialEq, Hash, Ord, PartialOrd)]
struct SubjectPredicate {

@ -1,13 +1,13 @@
use crate::store::encoded::*;
use crate::store::numeric_encoder::*;
use crate::utils::MutexPoisonError;
use crate::Result;
use std::collections::BTreeMap;
use std::collections::BTreeSet;
use std::sync::RwLock;
use std::sync::RwLockReadGuard;
use std::sync::RwLockWriteGuard;
use store::encoded::*;
use store::numeric_encoder::*;
use url::Url;
use utils::MutexPoisonError;
use Result;
/// Memory based implementation of the `rudf::model::Dataset` trait.
/// They are cheap to build using the `MemoryDataset::default()` method.

@ -7,7 +7,7 @@ pub(crate) mod numeric_encoder;
#[cfg(feature = "rocksdb")]
mod rocksdb;
pub use store::memory::MemoryDataset;
pub use store::memory::MemoryGraph;
pub use crate::store::memory::MemoryDataset;
pub use crate::store::memory::MemoryGraph;
#[cfg(feature = "rocksdb")]
pub use store::rocksdb::RocksDbDataset;
pub use crate::store::rocksdb::RocksDbDataset;

@ -1,10 +1,12 @@
use crate::model::vocab::rdf;
use crate::model::vocab::xsd;
use crate::model::*;
use crate::utils::MutexPoisonError;
use crate::Result;
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
use chrono::DateTime;
use chrono::FixedOffset;
use chrono::NaiveDateTime;
use model::vocab::rdf;
use model::vocab::xsd;
use model::*;
use ordered_float::OrderedFloat;
use rust_decimal::Decimal;
use std::collections::BTreeMap;
@ -14,9 +16,7 @@ use std::str;
use std::str::FromStr;
use std::sync::RwLock;
use url::Url;
use utils::MutexPoisonError;
use uuid::Uuid;
use Result;
const EMPTY_STRING_ID: u64 = 0;
const RDF_LANG_STRING_ID: u64 = 1;

@ -1,3 +1,8 @@
use crate::store::encoded::EncodedQuadsStore;
use crate::store::encoded::StoreDataset;
use crate::store::numeric_encoder::*;
use crate::utils::MutexPoisonError;
use crate::Result;
use byteorder::ByteOrder;
use byteorder::LittleEndian;
use rocksdb::ColumnFamily;
@ -11,12 +16,7 @@ use std::path::Path;
use std::str;
use std::str::FromStr;
use std::sync::Mutex;
use store::encoded::EncodedQuadsStore;
use store::encoded::StoreDataset;
use store::numeric_encoder::*;
use url::Url;
use utils::MutexPoisonError;
use Result;
/// `rudf::model::Dataset` trait implementation based on the [RocksDB](https://rocksdb.org/) key-value store
///

@ -19,10 +19,10 @@ use std::hash::Hasher;
use std::str::FromStr;
py_module_initializer!(rudf, initrudf, PyInit_rudf, |py, m| {
try!(m.add(py, "__doc__", "Rudf Python bindings"));
try!(m.add_class::<NamedNode>(py));
try!(m.add_class::<BlankNode>(py));
try!(m.add_class::<Literal>(py));
r#try!(m.add(py, "__doc__", "Rudf Python bindings"));
r#try!(m.add_class::<NamedNode>(py));
r#try!(m.add_class::<BlankNode>(py));
r#try!(m.add_class::<Literal>(py));
Ok(())
});

Loading…
Cancel
Save