Spargebra: Makes GroundTermPattern::Triple properly gated with the rdf-star feature

It is only RDF-star specific
rules
Tpt 2 years ago
parent b8c5628e3b
commit 2bd5da4a5a
  1. 2
      Cargo.lock
  2. 2
      lib/Cargo.toml
  3. 2
      lib/spargebra/Cargo.toml
  4. 5
      lib/spargebra/src/term.rs

2
Cargo.lock generated

@ -1638,7 +1638,7 @@ dependencies = [
[[package]] [[package]]
name = "spargebra" name = "spargebra"
version = "0.2.7" version = "0.2.8-dev"
dependencies = [ dependencies = [
"oxilangtag", "oxilangtag",
"oxiri", "oxiri",

@ -40,7 +40,7 @@ lazy_static = "1"
json-event-parser = "0.1" json-event-parser = "0.1"
oxrdf = { version = "0.1.5", path="oxrdf", features = ["rdf-star", "oxsdatatypes"] } oxrdf = { version = "0.1.5", path="oxrdf", features = ["rdf-star", "oxsdatatypes"] }
oxsdatatypes = { version = "0.1.1", path="oxsdatatypes" } oxsdatatypes = { version = "0.1.1", path="oxsdatatypes" }
spargebra = { version = "0.2.7", path="spargebra", features = ["rdf-star", "sep-0002", "sep-0006"] } spargebra = { version = "0.2.8-dev", path="spargebra", features = ["rdf-star", "sep-0002", "sep-0006"] }
sparesults = { version = "0.1.7", path="sparesults", features = ["rdf-star"] } sparesults = { version = "0.1.7", path="sparesults", features = ["rdf-star"] }
[target.'cfg(not(target_family = "wasm"))'.dependencies] [target.'cfg(not(target_family = "wasm"))'.dependencies]

@ -1,6 +1,6 @@
[package] [package]
name = "spargebra" name = "spargebra"
version = "0.2.7" version = "0.2.8-dev"
authors = ["Tpt <thomas@pellissier-tanon.fr>"] authors = ["Tpt <thomas@pellissier-tanon.fr>"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
readme = "README.md" readme = "README.md"

@ -577,6 +577,7 @@ pub enum GroundTermPattern {
NamedNode(NamedNode), NamedNode(NamedNode),
Literal(Literal), Literal(Literal),
Variable(Variable), Variable(Variable),
#[cfg(feature = "rdf-star")]
Triple(Box<GroundTriplePattern>), Triple(Box<GroundTriplePattern>),
} }
@ -587,6 +588,7 @@ impl GroundTermPattern {
Self::NamedNode(term) => write!(f, "{term}"), Self::NamedNode(term) => write!(f, "{term}"),
Self::Literal(term) => write!(f, "{term}"), Self::Literal(term) => write!(f, "{term}"),
Self::Variable(var) => write!(f, "{var}"), Self::Variable(var) => write!(f, "{var}"),
#[cfg(feature = "rdf-star")]
Self::Triple(triple) => triple.fmt_sse(f), Self::Triple(triple) => triple.fmt_sse(f),
} }
} }
@ -599,6 +601,7 @@ impl fmt::Display for GroundTermPattern {
Self::NamedNode(term) => term.fmt(f), Self::NamedNode(term) => term.fmt(f),
Self::Literal(term) => term.fmt(f), Self::Literal(term) => term.fmt(f),
Self::Variable(var) => var.fmt(f), Self::Variable(var) => var.fmt(f),
#[cfg(feature = "rdf-star")]
Self::Triple(triple) => write!(f, "<<{triple}>>"), Self::Triple(triple) => write!(f, "<<{triple}>>"),
} }
} }
@ -618,6 +621,7 @@ impl From<Literal> for GroundTermPattern {
} }
} }
#[cfg(feature = "rdf-star")]
impl From<GroundTriplePattern> for GroundTermPattern { impl From<GroundTriplePattern> for GroundTermPattern {
#[inline] #[inline]
fn from(triple: GroundTriplePattern) -> Self { fn from(triple: GroundTriplePattern) -> Self {
@ -818,6 +822,7 @@ pub struct GroundTriplePattern {
impl GroundTriplePattern { impl GroundTriplePattern {
/// Formats using the [SPARQL S-Expression syntax](https://jena.apache.org/documentation/notes/sse.html). /// Formats using the [SPARQL S-Expression syntax](https://jena.apache.org/documentation/notes/sse.html).
#[allow(dead_code)]
pub(crate) fn fmt_sse(&self, f: &mut impl Write) -> fmt::Result { pub(crate) fn fmt_sse(&self, f: &mut impl Write) -> fmt::Result {
write!(f, "(triple ")?; write!(f, "(triple ")?;
self.subject.fmt_sse(f)?; self.subject.fmt_sse(f)?;

Loading…
Cancel
Save