@ -139,6 +139,7 @@ impl fmt::Display for Literal {
pub enum Subject {
pub enum Subject {
NamedNode ( NamedNode ) ,
NamedNode ( NamedNode ) ,
BlankNode ( BlankNode ) ,
BlankNode ( BlankNode ) ,
#[ cfg(feature = " rdf-star " ) ]
Triple ( Box < Triple > ) ,
Triple ( Box < Triple > ) ,
}
}
@ -148,6 +149,7 @@ impl fmt::Display for Subject {
match self {
match self {
Self ::NamedNode ( node ) = > node . fmt ( f ) ,
Self ::NamedNode ( node ) = > node . fmt ( f ) ,
Self ::BlankNode ( node ) = > node . fmt ( f ) ,
Self ::BlankNode ( node ) = > node . fmt ( f ) ,
#[ cfg(feature = " rdf-star " ) ]
Self ::Triple ( triple ) = > write! (
Self ::Triple ( triple ) = > write! (
f ,
f ,
"<<{} {} {}>>" ,
"<<{} {} {}>>" ,
@ -171,6 +173,7 @@ impl From<BlankNode> for Subject {
}
}
}
}
#[ cfg(feature = " rdf-star " ) ]
impl From < Triple > for Subject {
impl From < Triple > for Subject {
#[ inline ]
#[ inline ]
fn from ( triple : Triple ) -> Self {
fn from ( triple : Triple ) -> Self {
@ -186,6 +189,7 @@ impl TryFrom<TermPattern> for Subject {
match term {
match term {
TermPattern ::NamedNode ( t ) = > Ok ( t . into ( ) ) ,
TermPattern ::NamedNode ( t ) = > Ok ( t . into ( ) ) ,
TermPattern ::BlankNode ( t ) = > Ok ( t . into ( ) ) ,
TermPattern ::BlankNode ( t ) = > Ok ( t . into ( ) ) ,
#[ cfg(feature = " rdf-star " ) ]
TermPattern ::Triple ( t ) = > Ok ( Triple ::try_from ( * t ) ? . into ( ) ) ,
TermPattern ::Triple ( t ) = > Ok ( Triple ::try_from ( * t ) ? . into ( ) ) ,
TermPattern ::Literal ( _ ) | TermPattern ::Variable ( _ ) = > Err ( ( ) ) ,
TermPattern ::Literal ( _ ) | TermPattern ::Variable ( _ ) = > Err ( ( ) ) ,
}
}
@ -198,6 +202,7 @@ impl TryFrom<TermPattern> for Subject {
#[ derive(Eq, PartialEq, Debug, Clone, Hash) ]
#[ derive(Eq, PartialEq, Debug, Clone, Hash) ]
pub enum GroundSubject {
pub enum GroundSubject {
NamedNode ( NamedNode ) ,
NamedNode ( NamedNode ) ,
#[ cfg(feature = " rdf-star " ) ]
Triple ( Box < GroundTriple > ) ,
Triple ( Box < GroundTriple > ) ,
}
}
@ -206,6 +211,7 @@ impl fmt::Display for GroundSubject {
fn fmt ( & self , f : & mut fmt ::Formatter < ' _ > ) -> fmt ::Result {
fn fmt ( & self , f : & mut fmt ::Formatter < ' _ > ) -> fmt ::Result {
match self {
match self {
Self ::NamedNode ( node ) = > node . fmt ( f ) ,
Self ::NamedNode ( node ) = > node . fmt ( f ) ,
#[ cfg(feature = " rdf-star " ) ]
Self ::Triple ( triple ) = > write! (
Self ::Triple ( triple ) = > write! (
f ,
f ,
"<<{} {} {}>>" ,
"<<{} {} {}>>" ,
@ -222,6 +228,7 @@ impl From<NamedNode> for GroundSubject {
}
}
}
}
#[ cfg(feature = " rdf-star " ) ]
impl From < GroundTriple > for GroundSubject {
impl From < GroundTriple > for GroundSubject {
#[ inline ]
#[ inline ]
fn from ( triple : GroundTriple ) -> Self {
fn from ( triple : GroundTriple ) -> Self {
@ -237,6 +244,7 @@ impl TryFrom<Subject> for GroundSubject {
match subject {
match subject {
Subject ::NamedNode ( t ) = > Ok ( t . into ( ) ) ,
Subject ::NamedNode ( t ) = > Ok ( t . into ( ) ) ,
Subject ::BlankNode ( _ ) = > Err ( ( ) ) ,
Subject ::BlankNode ( _ ) = > Err ( ( ) ) ,
#[ cfg(feature = " rdf-star " ) ]
Subject ::Triple ( t ) = > Ok ( GroundTriple ::try_from ( * t ) ? . into ( ) ) ,
Subject ::Triple ( t ) = > Ok ( GroundTriple ::try_from ( * t ) ? . into ( ) ) ,
}
}
}
}
@ -250,6 +258,7 @@ impl TryFrom<GroundTerm> for GroundSubject {
match term {
match term {
GroundTerm ::NamedNode ( t ) = > Ok ( t . into ( ) ) ,
GroundTerm ::NamedNode ( t ) = > Ok ( t . into ( ) ) ,
GroundTerm ::Literal ( _ ) = > Err ( ( ) ) ,
GroundTerm ::Literal ( _ ) = > Err ( ( ) ) ,
#[ cfg(feature = " rdf-star " ) ]
GroundTerm ::Triple ( t ) = > Ok ( ( * t ) . into ( ) ) ,
GroundTerm ::Triple ( t ) = > Ok ( ( * t ) . into ( ) ) ,
}
}
}
}
@ -265,6 +274,7 @@ pub enum Term {
NamedNode ( NamedNode ) ,
NamedNode ( NamedNode ) ,
BlankNode ( BlankNode ) ,
BlankNode ( BlankNode ) ,
Literal ( Literal ) ,
Literal ( Literal ) ,
#[ cfg(feature = " rdf-star " ) ]
Triple ( Box < Triple > ) ,
Triple ( Box < Triple > ) ,
}
}
@ -275,6 +285,7 @@ impl fmt::Display for Term {
Self ::NamedNode ( node ) = > node . fmt ( f ) ,
Self ::NamedNode ( node ) = > node . fmt ( f ) ,
Self ::BlankNode ( node ) = > node . fmt ( f ) ,
Self ::BlankNode ( node ) = > node . fmt ( f ) ,
Self ::Literal ( literal ) = > literal . fmt ( f ) ,
Self ::Literal ( literal ) = > literal . fmt ( f ) ,
#[ cfg(feature = " rdf-star " ) ]
Self ::Triple ( triple ) = > write! (
Self ::Triple ( triple ) = > write! (
f ,
f ,
"<<{} {} {}>>" ,
"<<{} {} {}>>" ,
@ -305,6 +316,7 @@ impl From<Literal> for Term {
}
}
}
}
#[ cfg(feature = " rdf-star " ) ]
impl From < Triple > for Term {
impl From < Triple > for Term {
#[ inline ]
#[ inline ]
fn from ( triple : Triple ) -> Self {
fn from ( triple : Triple ) -> Self {
@ -318,6 +330,7 @@ impl From<Subject> for Term {
match resource {
match resource {
Subject ::NamedNode ( node ) = > node . into ( ) ,
Subject ::NamedNode ( node ) = > node . into ( ) ,
Subject ::BlankNode ( node ) = > node . into ( ) ,
Subject ::BlankNode ( node ) = > node . into ( ) ,
#[ cfg(feature = " rdf-star " ) ]
Subject ::Triple ( t ) = > ( * t ) . into ( ) ,
Subject ::Triple ( t ) = > ( * t ) . into ( ) ,
}
}
}
}
@ -332,6 +345,7 @@ impl TryFrom<TermPattern> for Term {
TermPattern ::NamedNode ( t ) = > Ok ( t . into ( ) ) ,
TermPattern ::NamedNode ( t ) = > Ok ( t . into ( ) ) ,
TermPattern ::BlankNode ( t ) = > Ok ( t . into ( ) ) ,
TermPattern ::BlankNode ( t ) = > Ok ( t . into ( ) ) ,
TermPattern ::Literal ( t ) = > Ok ( t . into ( ) ) ,
TermPattern ::Literal ( t ) = > Ok ( t . into ( ) ) ,
#[ cfg(feature = " rdf-star " ) ]
TermPattern ::Triple ( t ) = > Ok ( Triple ::try_from ( * t ) ? . into ( ) ) ,
TermPattern ::Triple ( t ) = > Ok ( Triple ::try_from ( * t ) ? . into ( ) ) ,
TermPattern ::Variable ( _ ) = > Err ( ( ) ) ,
TermPattern ::Variable ( _ ) = > Err ( ( ) ) ,
}
}
@ -345,6 +359,7 @@ impl TryFrom<TermPattern> for Term {
pub enum GroundTerm {
pub enum GroundTerm {
NamedNode ( NamedNode ) ,
NamedNode ( NamedNode ) ,
Literal ( Literal ) ,
Literal ( Literal ) ,
#[ cfg(feature = " rdf-star " ) ]
Triple ( Box < GroundTriple > ) ,
Triple ( Box < GroundTriple > ) ,
}
}
@ -354,6 +369,7 @@ impl fmt::Display for GroundTerm {
match self {
match self {
Self ::NamedNode ( node ) = > node . fmt ( f ) ,
Self ::NamedNode ( node ) = > node . fmt ( f ) ,
Self ::Literal ( literal ) = > literal . fmt ( f ) ,
Self ::Literal ( literal ) = > literal . fmt ( f ) ,
#[ cfg(feature = " rdf-star " ) ]
Self ::Triple ( triple ) = > write! (
Self ::Triple ( triple ) = > write! (
f ,
f ,
"<<{} {} {}>>" ,
"<<{} {} {}>>" ,
@ -377,6 +393,7 @@ impl From<Literal> for GroundTerm {
}
}
}
}
#[ cfg(feature = " rdf-star " ) ]
impl From < GroundTriple > for GroundTerm {
impl From < GroundTriple > for GroundTerm {
#[ inline ]
#[ inline ]
fn from ( triple : GroundTriple ) -> Self {
fn from ( triple : GroundTriple ) -> Self {
@ -393,6 +410,7 @@ impl TryFrom<Term> for GroundTerm {
Term ::NamedNode ( t ) = > Ok ( t . into ( ) ) ,
Term ::NamedNode ( t ) = > Ok ( t . into ( ) ) ,
Term ::BlankNode ( _ ) = > Err ( ( ) ) ,
Term ::BlankNode ( _ ) = > Err ( ( ) ) ,
Term ::Literal ( t ) = > Ok ( t . into ( ) ) ,
Term ::Literal ( t ) = > Ok ( t . into ( ) ) ,
#[ cfg(feature = " rdf-star " ) ]
Term ::Triple ( t ) = > Ok ( GroundTriple ::try_from ( * t ) ? . into ( ) ) ,
Term ::Triple ( t ) = > Ok ( GroundTriple ::try_from ( * t ) ? . into ( ) ) ,
}
}
}
}
@ -694,6 +712,7 @@ pub enum TermPattern {
NamedNode ( NamedNode ) ,
NamedNode ( NamedNode ) ,
BlankNode ( BlankNode ) ,
BlankNode ( BlankNode ) ,
Literal ( Literal ) ,
Literal ( Literal ) ,
#[ cfg(feature = " rdf-star " ) ]
Triple ( Box < TriplePattern > ) ,
Triple ( Box < TriplePattern > ) ,
Variable ( Variable ) ,
Variable ( Variable ) ,
}
}
@ -705,6 +724,7 @@ impl fmt::Display for TermPattern {
Self ::NamedNode ( term ) = > term . fmt ( f ) ,
Self ::NamedNode ( term ) = > term . fmt ( f ) ,
Self ::BlankNode ( term ) = > term . fmt ( f ) ,
Self ::BlankNode ( term ) = > term . fmt ( f ) ,
Self ::Literal ( term ) = > term . fmt ( f ) ,
Self ::Literal ( term ) = > term . fmt ( f ) ,
#[ cfg(feature = " rdf-star " ) ]
Self ::Triple ( triple ) = > write! ( f , "<<{}>>" , triple ) ,
Self ::Triple ( triple ) = > write! ( f , "<<{}>>" , triple ) ,
Self ::Variable ( var ) = > var . fmt ( f ) ,
Self ::Variable ( var ) = > var . fmt ( f ) ,
}
}
@ -732,6 +752,7 @@ impl From<Literal> for TermPattern {
}
}
}
}
#[ cfg(feature = " rdf-star " ) ]
impl From < TriplePattern > for TermPattern {
impl From < TriplePattern > for TermPattern {
#[ inline ]
#[ inline ]
fn from ( triple : TriplePattern ) -> Self {
fn from ( triple : TriplePattern ) -> Self {
@ -751,6 +772,7 @@ impl From<Subject> for TermPattern {
match subject {
match subject {
Subject ::NamedNode ( node ) = > node . into ( ) ,
Subject ::NamedNode ( node ) = > node . into ( ) ,
Subject ::BlankNode ( node ) = > node . into ( ) ,
Subject ::BlankNode ( node ) = > node . into ( ) ,
#[ cfg(feature = " rdf-star " ) ]
Subject ::Triple ( t ) = > TriplePattern ::from ( * t ) . into ( ) ,
Subject ::Triple ( t ) = > TriplePattern ::from ( * t ) . into ( ) ,
}
}
}
}
@ -763,6 +785,7 @@ impl From<Term> for TermPattern {
Term ::NamedNode ( node ) = > node . into ( ) ,
Term ::NamedNode ( node ) = > node . into ( ) ,
Term ::BlankNode ( node ) = > node . into ( ) ,
Term ::BlankNode ( node ) = > node . into ( ) ,
Term ::Literal ( literal ) = > literal . into ( ) ,
Term ::Literal ( literal ) = > literal . into ( ) ,
#[ cfg(feature = " rdf-star " ) ]
Term ::Triple ( t ) = > TriplePattern ::from ( * t ) . into ( ) ,
Term ::Triple ( t ) = > TriplePattern ::from ( * t ) . into ( ) ,
}
}
}
}
@ -832,6 +855,7 @@ impl From<GroundSubject> for GroundTermPattern {
fn from ( term : GroundSubject ) -> Self {
fn from ( term : GroundSubject ) -> Self {
match term {
match term {
GroundSubject ::NamedNode ( node ) = > node . into ( ) ,
GroundSubject ::NamedNode ( node ) = > node . into ( ) ,
#[ cfg(feature = " rdf-star " ) ]
GroundSubject ::Triple ( triple ) = > GroundTriplePattern ::from ( * triple ) . into ( ) ,
GroundSubject ::Triple ( triple ) = > GroundTriplePattern ::from ( * triple ) . into ( ) ,
}
}
}
}
@ -842,6 +866,7 @@ impl From<GroundTerm> for GroundTermPattern {
match term {
match term {
GroundTerm ::NamedNode ( node ) = > node . into ( ) ,
GroundTerm ::NamedNode ( node ) = > node . into ( ) ,
GroundTerm ::Literal ( literal ) = > literal . into ( ) ,
GroundTerm ::Literal ( literal ) = > literal . into ( ) ,
#[ cfg(feature = " rdf-star " ) ]
GroundTerm ::Triple ( triple ) = > GroundTriplePattern ::from ( * triple ) . into ( ) ,
GroundTerm ::Triple ( triple ) = > GroundTriplePattern ::from ( * triple ) . into ( ) ,
}
}
}
}
@ -866,6 +891,7 @@ impl TryFrom<TermPattern> for GroundTermPattern {
TermPattern ::NamedNode ( named_node ) = > named_node . into ( ) ,
TermPattern ::NamedNode ( named_node ) = > named_node . into ( ) ,
TermPattern ::BlankNode ( _ ) = > return Err ( ( ) ) ,
TermPattern ::BlankNode ( _ ) = > return Err ( ( ) ) ,
TermPattern ::Literal ( literal ) = > literal . into ( ) ,
TermPattern ::Literal ( literal ) = > literal . into ( ) ,
#[ cfg(feature = " rdf-star " ) ]
TermPattern ::Triple ( triple ) = > GroundTriplePattern ::try_from ( * triple ) ? . into ( ) ,
TermPattern ::Triple ( triple ) = > GroundTriplePattern ::try_from ( * triple ) ? . into ( ) ,
TermPattern ::Variable ( variable ) = > variable . into ( ) ,
TermPattern ::Variable ( variable ) = > variable . into ( ) ,
} )
} )