Removes all deprecated items

pull/46/head
Tpt 4 years ago
parent 56ef29f787
commit db6dbea1ec
  1. 56
      lib/src/io/format.rs
  2. 2
      lib/src/io/mod.rs
  3. 11
      lib/src/lib.rs
  4. 5
      lib/src/model/named_node.rs
  5. 81
      lib/src/model/triple.rs
  6. 28
      lib/src/sparql/mod.rs
  7. 44
      lib/src/sparql/model.rs

@ -1,21 +1,3 @@
/// A file serialization format.
///
/// Is implemented by [`GraphFormat`](../enum.GraphFormat.html) for graph files and [`DatasetFormat`](../enum.DatasetFormat.html) for dataset files.
#[deprecated(note = "Use directly the methods on the implementing types")]
pub trait FileSyntax: Sized {
/// Its canonical IRI according to the [Unique URIs for file formats registry](https://www.w3.org/ns/formats/).
fn iri(self) -> &'static str;
/// Its [IANA media type](https://tools.ietf.org/html/rfc2046).
fn media_type(self) -> &'static str;
/// Its [IANA-registered](https://tools.ietf.org/html/rfc2046) file extension.
fn file_extension(self) -> &'static str;
/// Looks for a known format from a media type.
fn from_mime_type(media_type: &str) -> Option<Self>;
}
/// [RDF graph](https://www.w3.org/TR/rdf11-concepts/#dfn-graph) serialization formats.
///
/// This enumeration is non exhaustive. New formats like JSON-LD will be added in the future.
@ -105,25 +87,6 @@ impl GraphFormat {
}
}
#[allow(deprecated)]
impl FileSyntax for GraphFormat {
fn iri(self) -> &'static str {
self.iri()
}
fn media_type(self) -> &'static str {
self.media_type()
}
fn file_extension(self) -> &'static str {
self.file_extension()
}
fn from_mime_type(media_type: &str) -> Option<Self> {
Self::from_media_type(media_type)
}
}
/// [RDF dataset](https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-dataset) serialization formats.
///
/// This enumeration is non exhaustive. New formats like JSON-LD will be added in the future.
@ -205,22 +168,3 @@ impl DatasetFormat {
}
}
}
#[allow(deprecated)]
impl FileSyntax for DatasetFormat {
fn iri(self) -> &'static str {
self.iri()
}
fn media_type(self) -> &'static str {
self.media_type()
}
fn file_extension(self) -> &'static str {
self.file_extension()
}
fn from_mime_type(media_type: &str) -> Option<Self> {
Self::from_media_type(media_type)
}
}

@ -5,8 +5,6 @@ pub mod read;
pub mod write;
pub use self::format::DatasetFormat;
#[allow(deprecated)]
pub use self::format::FileSyntax;
pub use self::format::GraphFormat;
pub use self::read::DatasetParser;
pub use self::read::GraphParser;

@ -113,17 +113,6 @@ pub mod model;
pub mod sparql;
pub mod store;
#[deprecated(note = "Use oxigraph::sparql::EvaluationError instead")]
pub type Error = crate::sparql::EvaluationError;
#[deprecated(note = "Use Result<_, oxigraph::sparql::EvaluationError> instead")]
pub type Result<T> = ::std::result::Result<T, crate::sparql::EvaluationError>;
#[deprecated(note = "Use oxigraph::io::DatasetFormat instead")]
pub type DatasetSyntax = crate::io::DatasetFormat;
#[deprecated(note = "Use oxigraph::io::FileSyntax instead")]
#[allow(deprecated)]
pub use crate::io::FileSyntax;
#[deprecated(note = "Use oxigraph::io::GraphFormat instead")]
pub type GraphSyntax = crate::io::GraphFormat;
pub use crate::store::memory::MemoryStore;
#[cfg(feature = "rocksdb")]
pub use crate::store::rocksdb::RocksDbStore;

@ -25,11 +25,6 @@ impl NamedNode {
Ok(Self::new_from_iri(Iri::parse(iri.into())?))
}
#[deprecated(note = "Use the `new` method")]
pub fn parse(iri: impl Into<String>) -> Result<Self, IriParseError> {
Self::new(iri)
}
#[inline]
pub(crate) fn new_from_iri(iri: Iri<String>) -> Self {
Self::new_unchecked(iri.into_inner())

@ -430,36 +430,6 @@ impl Triple {
}
}
#[deprecated(note = "Use directly the `subject` field")]
pub const fn subject(&self) -> &NamedOrBlankNode {
&self.subject
}
#[deprecated(note = "Use directly the `subject` field")]
pub fn subject_owned(self) -> NamedOrBlankNode {
self.subject
}
#[deprecated(note = "Use directly the `predicate` field")]
pub const fn predicate(&self) -> &NamedNode {
&self.predicate
}
#[deprecated(note = "Use directly the `predicate` field")]
pub fn predicate_owned(self) -> NamedNode {
self.predicate
}
#[deprecated(note = "Use directly the `object` field")]
pub const fn object(&self) -> &Term {
&self.object
}
#[deprecated(note = "Use directly the `object` field")]
pub fn object_owned(self) -> Term {
self.object
}
/// Encodes that this triple is in a [RDF dataset](https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-dataset)
#[inline]
pub fn in_graph(self, graph_name: impl Into<GraphName>) -> Quad {
@ -858,57 +828,6 @@ impl Quad {
}
}
#[deprecated(note = "Use directly the `subject` field")]
pub const fn subject(&self) -> &NamedOrBlankNode {
&self.subject
}
#[deprecated(note = "Use directly the `subject` field")]
pub fn subject_owned(self) -> NamedOrBlankNode {
self.subject
}
#[deprecated(note = "Use directly the `predicate` field")]
pub const fn predicate(&self) -> &NamedNode {
&self.predicate
}
#[deprecated(note = "Use directly the `predicate` field")]
pub fn predicate_owned(self) -> NamedNode {
self.predicate
}
#[deprecated(note = "Use directly the `object` field")]
pub const fn object(&self) -> &Term {
&self.object
}
#[deprecated(note = "Use directly the `object` field")]
pub fn object_owned(self) -> Term {
self.object
}
#[deprecated(note = "Use directly the `graph_name` field")]
pub const fn graph_name(&self) -> &GraphName {
&self.graph_name
}
#[deprecated(note = "Use directly the `graph_name` field")]
pub fn graph_name_owned(self) -> GraphName {
self.graph_name
}
#[deprecated(note = "Use `Triple::from` instead")]
#[inline]
pub fn into_triple(self) -> Triple {
Triple::new(self.subject, self.predicate, self.object)
}
#[deprecated(note = "Use directly the struct fields")]
pub fn destruct(self) -> (NamedOrBlankNode, NamedNode, Term, GraphName) {
(self.subject, self.predicate, self.object, self.graph_name)
}
#[inline]
pub fn as_ref(&self) -> QuadRef<'_> {
QuadRef {

@ -13,34 +13,24 @@ mod xml_results;
use crate::model::NamedNode;
use crate::sparql::algebra::QueryVariants;
use crate::sparql::dataset::DatasetView;
pub use crate::sparql::error::EvaluationError;
use crate::sparql::eval::SimpleEvaluator;
pub use crate::sparql::model::QueryResult;
pub use crate::sparql::model::QueryResultFormat;
pub use crate::sparql::model::QuerySolution;
pub use crate::sparql::model::QuerySolutionsIterator;
pub use crate::sparql::model::QueryTriplesIterator;
use crate::sparql::plan::{PlanNode, TripleTemplate};
use crate::sparql::plan_builder::PlanBuilder;
use crate::store::ReadableEncodedStore;
use std::convert::TryInto;
use std::rc::Rc;
#[deprecated(note = "Please directly use QuerySolutionsIterator type instead")]
pub type BindingsIterator<'a> = QuerySolutionsIterator;
pub use crate::sparql::model::QueryResult;
pub use crate::sparql::model::QueryResultFormat;
#[deprecated(note = "Use QueryResultFormat instead")]
pub type QueryResultSyntax = QueryResultFormat;
use crate::sparql::dataset::DatasetView;
pub use crate::sparql::error::EvaluationError;
pub use crate::sparql::model::Variable;
pub use crate::sparql::parser::ParseError;
pub use crate::sparql::parser::Query;
use crate::sparql::plan::{PlanNode, TripleTemplate};
use crate::sparql::plan_builder::PlanBuilder;
use crate::store::numeric_encoder::StrEncodingAware;
use crate::store::ReadableEncodedStore;
use std::convert::TryInto;
use std::error::Error;
/// A prepared [SPARQL query](https://www.w3.org/TR/sparql11-query/)
#[deprecated(
note = "Not useful anymore. The exec method is already implemented by the different PreparedQuery structures"
)]
pub trait PreparedQuery {}
use std::rc::Rc;
/// A prepared [SPARQL query](https://www.w3.org/TR/sparql11-query/)
pub(crate) struct SimplePreparedQuery<S: ReadableEncodedStore + 'static>(

@ -1,7 +1,6 @@
use crate::error::invalid_input_error;
use crate::io::GraphFormat;
use crate::io::GraphSerializer;
#[allow(deprecated)]
use crate::io::{FileSyntax, GraphFormat};
use crate::model::*;
use crate::sparql::error::EvaluationError;
use crate::sparql::json_results::write_json_results;
@ -198,25 +197,6 @@ impl QueryResultFormat {
}
}
#[allow(deprecated)]
impl FileSyntax for QueryResultFormat {
fn iri(self) -> &'static str {
self.iri()
}
fn media_type(self) -> &'static str {
self.media_type()
}
fn file_extension(self) -> &'static str {
self.file_extension()
}
fn from_mime_type(media_type: &str) -> Option<Self> {
Self::from_media_type(media_type)
}
}
/// An iterator over query result solutions
///
/// ```
@ -260,23 +240,6 @@ impl QuerySolutionsIterator {
pub fn variables(&self) -> &[Variable] {
&*self.variables
}
#[deprecated(note = "Please directly use QuerySolutionsIterator as an iterator instead")]
pub fn into_values_iter(
self,
) -> Box<dyn Iterator<Item = Result<Vec<Option<Term>>, EvaluationError>>> {
self.iter
}
#[deprecated(note = "Please directly use QuerySolutionsIterator as an iterator instead")]
pub fn destruct(
self,
) -> (
Vec<Variable>,
Box<dyn Iterator<Item = Result<Vec<Option<Term>>, EvaluationError>>>,
) {
((*self.variables).clone(), self.iter)
}
}
impl Iterator for QuerySolutionsIterator {
@ -443,11 +406,6 @@ impl Variable {
&self.name
}
#[deprecated(note = "Please use as_str instead")]
pub fn name(&self) -> Result<&str, EvaluationError> {
Ok(self.as_str())
}
#[inline]
pub fn into_string(self) -> String {
self.name

Loading…
Cancel
Save