|
|
@ -256,23 +256,19 @@ impl<I: StrId> Hash for EncodedTerm<I> { |
|
|
|
|
|
|
|
|
|
|
|
impl<I: StrId> EncodedTerm<I> { |
|
|
|
impl<I: StrId> EncodedTerm<I> { |
|
|
|
pub fn is_named_node(&self) -> bool { |
|
|
|
pub fn is_named_node(&self) -> bool { |
|
|
|
match self { |
|
|
|
matches!(self, |
|
|
|
Self::NamedNode { .. } => true, |
|
|
|
Self::NamedNode { .. }) |
|
|
|
_ => false, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub fn is_blank_node(&self) -> bool { |
|
|
|
pub fn is_blank_node(&self) -> bool { |
|
|
|
match self { |
|
|
|
matches!(self, |
|
|
|
Self::NumericalBlankNode { .. } |
|
|
|
Self::NumericalBlankNode { .. } |
|
|
|
| Self::SmallBlankNode { .. } |
|
|
|
| Self::SmallBlankNode { .. } |
|
|
|
| Self::BigBlankNode { .. } => true, |
|
|
|
| Self::BigBlankNode { .. }) |
|
|
|
_ => false, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub fn is_literal(&self) -> bool { |
|
|
|
pub fn is_literal(&self) -> bool { |
|
|
|
match self { |
|
|
|
matches!(self, |
|
|
|
Self::SmallStringLiteral { .. } |
|
|
|
Self::SmallStringLiteral { .. } |
|
|
|
| Self::BigStringLiteral { .. } |
|
|
|
| Self::BigStringLiteral { .. } |
|
|
|
| Self::SmallSmallLangStringLiteral { .. } |
|
|
|
| Self::SmallSmallLangStringLiteral { .. } |
|
|
@ -296,20 +292,15 @@ impl<I: StrId> EncodedTerm<I> { |
|
|
|
| Self::GMonthLiteral(_) |
|
|
|
| Self::GMonthLiteral(_) |
|
|
|
| Self::DurationLiteral(_) |
|
|
|
| Self::DurationLiteral(_) |
|
|
|
| Self::YearMonthDurationLiteral(_) |
|
|
|
| Self::YearMonthDurationLiteral(_) |
|
|
|
| Self::DayTimeDurationLiteral(_) => true, |
|
|
|
| Self::DayTimeDurationLiteral(_)) |
|
|
|
_ => false, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub fn is_unknown_typed_literal(&self) -> bool { |
|
|
|
pub fn is_unknown_typed_literal(&self) -> bool { |
|
|
|
match self { |
|
|
|
matches!(self, Self::SmallTypedLiteral { .. } | Self::BigTypedLiteral { .. }) |
|
|
|
Self::SmallTypedLiteral { .. } | Self::BigTypedLiteral { .. } => true, |
|
|
|
|
|
|
|
_ => false, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub fn is_default_graph(&self) -> bool { |
|
|
|
pub fn is_default_graph(&self) -> bool { |
|
|
|
*self == EncodedTerm::DefaultGraph |
|
|
|
matches!(self, Self::DefaultGraph) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub fn map_id<J: StrId>(self, mapping: impl Fn(I) -> J) -> EncodedTerm<J> { |
|
|
|
pub fn map_id<J: StrId>(self, mapping: impl Fn(I) -> J) -> EncodedTerm<J> { |
|
|
|