Avoids global macros importation

pull/10/head
Tpt 6 years ago
parent 1e0d803272
commit 4b2f8c121b
  1. 7
      lib/src/lib.rs
  2. 3
      lib/src/model/vocab.rs
  3. 1
      lib/src/rio/ntriples/mod.rs
  4. 1
      lib/src/rio/turtle/mod.rs
  5. 2
      lib/src/rio/xml.rs
  6. 2
      lib/src/sparql/algebra.rs
  7. 1
      lib/src/sparql/parser.rs
  8. 1
      lib/src/sparql/plan.rs
  9. 1
      lib/src/sparql/xml_results.rs
  10. 1
      lib/src/store/encoded.rs
  11. 1
      lib/src/store/numeric_encoder.rs
  12. 1
      lib/src/store/rocksdb.rs
  13. 1
      lib/src/utils.rs
  14. 8
      lib/tests/rdf_test_cases.rs
  15. 9
      lib/tests/sparql_test_cases.rs
  16. 10
      python/src/lib.rs
  17. 24
      server/src/main.rs

@ -37,13 +37,6 @@
clippy::unicode_not_nfc clippy::unicode_not_nfc
)] )]
#[macro_use]
extern crate failure;
#[macro_use]
extern crate lazy_static;
#[cfg(feature = "rocksdb")]
extern crate rocksdb;
pub mod model; pub mod model;
pub mod rio; pub mod rio;
pub mod sparql; pub mod sparql;

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

@ -11,6 +11,7 @@ mod grammar {
use crate::rio::utils::unescape_characters; use crate::rio::utils::unescape_characters;
use crate::utils::StaticSliceMap; use crate::utils::StaticSliceMap;
use lazy_static::lazy_static;
use std::borrow::Cow; use std::borrow::Cow;
const UNESCAPE_CHARACTERS: [u8; 8] = [b't', b'b', b'n', b'r', b'f', b'"', b'\'', b'\\']; const UNESCAPE_CHARACTERS: [u8; 8] = [b't', b'b', b'n', b'r', b'f', b'"', b'\'', b'\\'];

@ -12,6 +12,7 @@ mod grammar {
use crate::model::*; use crate::model::*;
use crate::rio::utils::unescape_characters; use crate::rio::utils::unescape_characters;
use crate::utils::StaticSliceMap; use crate::utils::StaticSliceMap;
use lazy_static::lazy_static;
use std::borrow::Cow; use std::borrow::Cow;
use std::collections::BTreeMap; use std::collections::BTreeMap;
use std::collections::HashMap; use std::collections::HashMap;

@ -4,6 +4,8 @@ use crate::model::vocab::rdf;
use crate::model::Triple; use crate::model::Triple;
use crate::model::*; use crate::model::*;
use crate::Result; use crate::Result;
use failure::format_err;
use lazy_static::lazy_static;
use quick_xml::events::BytesEnd; use quick_xml::events::BytesEnd;
use quick_xml::events::BytesStart; use quick_xml::events::BytesStart;
use quick_xml::events::BytesText; use quick_xml::events::BytesText;

@ -3,6 +3,8 @@
use crate::model::*; use crate::model::*;
use crate::utils::Escaper; use crate::utils::Escaper;
use crate::Result; use crate::Result;
use failure::format_err;
use lazy_static::lazy_static;
use std::collections::BTreeMap; use std::collections::BTreeMap;
use std::collections::BTreeSet; use std::collections::BTreeSet;
use std::fmt; use std::fmt;

@ -15,6 +15,7 @@ mod grammar {
use crate::rio::utils::unescape_unicode_codepoints; use crate::rio::utils::unescape_unicode_codepoints;
use crate::sparql::algebra::*; use crate::sparql::algebra::*;
use crate::utils::StaticSliceMap; use crate::utils::StaticSliceMap;
use lazy_static::lazy_static;
use std::borrow::Cow; use std::borrow::Cow;
use std::collections::BTreeMap; use std::collections::BTreeMap;
use std::collections::HashMap; use std::collections::HashMap;

@ -5,6 +5,7 @@ use crate::store::encoded::EncodedQuadsStore;
use crate::store::numeric_encoder::EncodedTerm; use crate::store::numeric_encoder::EncodedTerm;
use crate::store::numeric_encoder::ENCODED_DEFAULT_GRAPH; use crate::store::numeric_encoder::ENCODED_DEFAULT_GRAPH;
use crate::Result; use crate::Result;
use failure::format_err;
use std::collections::BTreeSet; use std::collections::BTreeSet;
pub type EncodedTuple = Vec<Option<EncodedTerm>>; pub type EncodedTuple = Vec<Option<EncodedTerm>>;

@ -5,6 +5,7 @@ use crate::sparql::algebra::BindingsIterator;
use crate::sparql::algebra::QueryResult; use crate::sparql::algebra::QueryResult;
use crate::sparql::algebra::Variable; use crate::sparql::algebra::Variable;
use crate::Result; use crate::Result;
use failure::format_err;
use quick_xml::events::BytesDecl; use quick_xml::events::BytesDecl;
use quick_xml::events::BytesEnd; use quick_xml::events::BytesEnd;
use quick_xml::events::BytesStart; use quick_xml::events::BytesStart;

@ -1,6 +1,7 @@
use crate::model::*; use crate::model::*;
use crate::store::numeric_encoder::*; use crate::store::numeric_encoder::*;
use crate::Result; use crate::Result;
use failure::format_err;
use std::fmt; use std::fmt;
use std::iter::empty; use std::iter::empty;
use std::iter::once; use std::iter::once;

@ -7,6 +7,7 @@ use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
use chrono::DateTime; use chrono::DateTime;
use chrono::FixedOffset; use chrono::FixedOffset;
use chrono::NaiveDateTime; use chrono::NaiveDateTime;
use failure::format_err;
use ordered_float::OrderedFloat; use ordered_float::OrderedFloat;
use rust_decimal::Decimal; use rust_decimal::Decimal;
use std::collections::BTreeMap; use std::collections::BTreeMap;

@ -5,6 +5,7 @@ use crate::utils::MutexPoisonError;
use crate::Result; use crate::Result;
use byteorder::ByteOrder; use byteorder::ByteOrder;
use byteorder::LittleEndian; use byteorder::LittleEndian;
use failure::format_err;
use rocksdb::ColumnFamily; use rocksdb::ColumnFamily;
use rocksdb::DBRawIterator; use rocksdb::DBRawIterator;
use rocksdb::Options; use rocksdb::Options;

@ -1,4 +1,5 @@
use failure::Backtrace; use failure::Backtrace;
use failure::Fail;
use std::sync::PoisonError; use std::sync::PoisonError;
pub trait Escaper { pub trait Escaper {

@ -1,10 +1,5 @@
///! Integration tests based on [RDF 1.1 Test Cases](https://www.w3.org/TR/rdf11-testcases/) ///! Integration tests based on [RDF 1.1 Test Cases](https://www.w3.org/TR/rdf11-testcases/)
use failure::format_err;
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate failure;
use reqwest::Client; use reqwest::Client;
use reqwest::Response; use reqwest::Response;
use rudf::model::vocab::rdf; use rudf::model::vocab::rdf;
@ -261,6 +256,7 @@ impl<'a> TestManifest<'a> {
} }
pub mod mf { pub mod mf {
use lazy_static::lazy_static;
use rudf::model::NamedNode; use rudf::model::NamedNode;
use std::str::FromStr; use std::str::FromStr;

@ -1,9 +1,5 @@
///! Integration tests based on [SPARQL 1.1 Test Cases](https://www.w3.org/2009/sparql/docs/tests/README.html) ///! Integration tests based on [SPARQL 1.1 Test Cases](https://www.w3.org/2009/sparql/docs/tests/README.html)
#[macro_use] use failure::format_err;
extern crate lazy_static;
#[macro_use]
extern crate failure;
use reqwest::Client; use reqwest::Client;
use reqwest::Response; use reqwest::Response;
use rudf::model::vocab::rdf; use rudf::model::vocab::rdf;
@ -318,6 +314,7 @@ impl RDFClient {
} }
mod rs { mod rs {
use lazy_static::lazy_static;
use rudf::model::NamedNode; use rudf::model::NamedNode;
use std::str::FromStr; use std::str::FromStr;
@ -478,6 +475,7 @@ impl<'a> TestManifest<'a> {
} }
pub mod mf { pub mod mf {
use lazy_static::lazy_static;
use rudf::model::NamedNode; use rudf::model::NamedNode;
use std::str::FromStr; use std::str::FromStr;
@ -501,6 +499,7 @@ pub mod mf {
} }
pub mod qt { pub mod qt {
use lazy_static::lazy_static;
use rudf::model::NamedNode; use rudf::model::NamedNode;
use std::str::FromStr; use std::str::FromStr;

@ -1,15 +1,7 @@
#![allow(clippy::zero_ptr, clippy::transmute_ptr_to_ptr)] #![allow(clippy::zero_ptr, clippy::transmute_ptr_to_ptr)]
#[macro_use]
extern crate cpython;
use cpython::exc::ValueError; use cpython::exc::ValueError;
use cpython::CompareOp; use cpython::*;
use cpython::PyErr;
use cpython::PyResult;
use cpython::Python;
use cpython::PythonObject;
use cpython::ToPyObject;
use rudf::model; use rudf::model;
use rudf::Error; use rudf::Error;
use std::collections::hash_map::DefaultHasher; use std::collections::hash_map::DefaultHasher;

@ -1,20 +1,7 @@
#[macro_use]
extern crate failure;
use gotham;
#[macro_use]
extern crate gotham_derive;
use hyper;
#[macro_use]
extern crate lazy_static;
use mime;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate tera;
use clap::App; use clap::App;
use clap::Arg; use clap::Arg;
use clap::ArgMatches; use clap::ArgMatches;
use failure::format_err;
use futures::future; use futures::future;
use futures::Future; use futures::Future;
use futures::Stream; use futures::Stream;
@ -27,13 +14,18 @@ use gotham::router::builder::build_router;
use gotham::router::builder::DefineSingleRoute; use gotham::router::builder::DefineSingleRoute;
use gotham::router::builder::DrawRoutes; use gotham::router::builder::DrawRoutes;
use gotham::router::Router; use gotham::router::Router;
use gotham::start;
use gotham::state::FromState; use gotham::state::FromState;
use gotham::state::State; use gotham::state::State;
use gotham_derive::*;
use hyper;
use hyper::header::CONTENT_TYPE; use hyper::header::CONTENT_TYPE;
use hyper::Body; use hyper::Body;
use hyper::HeaderMap; use hyper::HeaderMap;
use hyper::Response; use hyper::Response;
use hyper::StatusCode; use hyper::StatusCode;
use lazy_static::lazy_static;
use mime;
use mime::Mime; use mime::Mime;
use rudf::model::Graph; use rudf::model::Graph;
use rudf::rio::ntriples::read_ntriples; use rudf::rio::ntriples::read_ntriples;
@ -44,10 +36,12 @@ use rudf::sparql::SparqlDataset;
use rudf::store::MemoryDataset; use rudf::store::MemoryDataset;
use rudf::store::MemoryGraph; use rudf::store::MemoryGraph;
use rudf::store::RocksDbDataset; use rudf::store::RocksDbDataset;
use serde_derive::Deserialize;
use std::fs::File; use std::fs::File;
use std::panic::RefUnwindSafe; use std::panic::RefUnwindSafe;
use std::str::FromStr; use std::str::FromStr;
use std::sync::Arc; use std::sync::Arc;
use tera::compile_templates;
use tera::Context; use tera::Context;
use tera::Tera; use tera::Tera;
use url::form_urlencoded; use url::form_urlencoded;
@ -112,7 +106,7 @@ fn main_with_dataset<D: SparqlDataset + Send + Sync + RefUnwindSafe + 'static>(
let addr = matches.value_of("bind").unwrap_or("127.0.0.1:7878"); let addr = matches.value_of("bind").unwrap_or("127.0.0.1:7878");
println!("Listening for requests at http://{}", addr); println!("Listening for requests at http://{}", addr);
gotham::start(addr.to_string(), router(dataset, addr.to_string())); start(addr.to_string(), router(dataset, addr.to_string()));
Ok(()) Ok(())
} }

Loading…
Cancel
Save