pub trait Term:
Debug
+ Clone
+ Display
+ PartialEq
+ Eq
+ Hash {
// Required methods
fn kind(&self) -> TermKind;
fn lexical_form(&self) -> String;
// Provided methods
fn is_iri(&self) -> bool { ... }
fn is_blank_node(&self) -> bool { ... }
fn is_literal(&self) -> bool { ... }
fn is_triple(&self) -> bool { ... }
}Expand description
Represents any RDF term that can appear in an RDF graph.
In RDF, terms are the fundamental building blocks of triples. A term can be an IRI (Internationalized Resource Identifier), a blank node, a literal value, or (in RDF-star) a quoted triple.
Required Methods§
Sourcefn kind(&self) -> TermKind
fn kind(&self) -> TermKind
Returns the kind of RDF term this represents.
This method allows distinguishing between different types of RDF terms at runtime.
Sourcefn lexical_form(&self) -> String
fn lexical_form(&self) -> String
Returns the lexical representation of this term as a string.
Provided Methods§
Sourcefn is_blank_node(&self) -> bool
fn is_blank_node(&self) -> bool
Returns true if this term is a blank node.
Sourcefn is_literal(&self) -> bool
fn is_literal(&self) -> bool
Returns true if this term is a literal.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl Term for Term
Implements the Term trait for OxTerm.
impl Term for Term
Implements the Term trait for OxTerm.
This is the main implementation for RDF terms, supporting IRIs, blank nodes, literals, and RDF-star quoted triples.
Source§fn kind(&self) -> TermKind
fn kind(&self) -> TermKind
Returns the kind of RDF term.
§Returns
TermKind::Irifor named nodesTermKind::BlankNodefor blank nodesTermKind::Literalfor literal valuesTermKind::Triplefor RDF-star quoted triples
Source§fn lexical_form(&self) -> String
fn lexical_form(&self) -> String
§Returns
- For IRIs: the full IRI string
- For blank nodes: the blank node identifier (e.g., “_:b0”)
- For literals: the literal value without datatype or language tag
- For triples: the string representation of the entire triple