pub enum IriOrBlankNode {
BlankNode(String),
Iri(IriS),
}Expand description
Represents an RDF resource that is either an IRI or a blank node.
§Variants
- BlankNode: An anonymous resource without a global identifier, represented by a local label (e.g., “b0”, “genid1”)
- Iri: A globally identified resource using an Internationalized Resource Identifier
Variants§
Implementations§
Source§impl IriOrBlankNode
impl IriOrBlankNode
Sourcepub fn length(&self) -> usize
pub fn length(&self) -> usize
Returns the length (in bytes) of this resource’s string representation.
- For blank nodes: the length of the identifier string
- For IRIs: the length of the full IRI string
Sourcepub fn iri(iri: &IriS) -> IriOrBlankNode
pub fn iri(iri: &IriS) -> IriOrBlankNode
Sourcepub fn show_qualified(&self, prefixmap: &PrefixMap) -> String
pub fn show_qualified(&self, prefixmap: &PrefixMap) -> String
Formats this resource using qualified names (prefixes) where possible.
This method produces a compact representation by replacing full IRIs with prefixed names when a matching prefix exists in the provided map.
- Blank nodes: formatted as “_:
” - IRIs: qualified using the prefix map (e.g., “ex:resource” instead of “http://example.org/resource”)
§Parameters
prefixmap: A prefix map containing IRI-to-prefix mappings
Trait Implementations§
Source§impl Clone for IriOrBlankNode
impl Clone for IriOrBlankNode
Source§fn clone(&self) -> IriOrBlankNode
fn clone(&self) -> IriOrBlankNode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IriOrBlankNode
impl Debug for IriOrBlankNode
Source§impl<'de> Deserialize<'de> for IriOrBlankNode
impl<'de> Deserialize<'de> for IriOrBlankNode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for IriOrBlankNode
impl Display for IriOrBlankNode
Source§impl From<IriOrBlankNode> for NamedOrBlankNode
Converts an IriOrBlankNode into an oxrdf::NamedOrBlankNode.
impl From<IriOrBlankNode> for NamedOrBlankNode
Converts an IriOrBlankNode into an oxrdf::NamedOrBlankNode.
This enables interoperability with the oxrdf library, allowing seamless
conversion from the custom representation to oxrdf’s subject type.
Source§fn from(value: IriOrBlankNode) -> Self
fn from(value: IriOrBlankNode) -> Self
Source§impl From<IriOrBlankNode> for Term
Converts an IriOrBlankNode into an oxrdf::Term.
impl From<IriOrBlankNode> for Term
Converts an IriOrBlankNode into an oxrdf::Term.
This conversion allows using IriOrBlankNode values in contexts where
oxrdf expects a full term (which can be an IRI, blank node, literal, or triple).
Source§fn from(value: IriOrBlankNode) -> Self
fn from(value: IriOrBlankNode) -> Self
Source§impl From<NamedOrBlankNode> for IriOrBlankNode
Converts an oxrdf::NamedOrBlankNode into an IriOrBlankNode.
impl From<NamedOrBlankNode> for IriOrBlankNode
Converts an oxrdf::NamedOrBlankNode into an IriOrBlankNode.
This enables interoperability with the oxrdf library, allowing conversion
from oxrdf’s subject type into the custom representation.
Source§fn from(value: NamedOrBlankNode) -> Self
fn from(value: NamedOrBlankNode) -> Self
Source§impl Hash for IriOrBlankNode
impl Hash for IriOrBlankNode
Source§impl Ord for IriOrBlankNode
impl Ord for IriOrBlankNode
Source§fn cmp(&self, other: &IriOrBlankNode) -> Ordering
fn cmp(&self, other: &IriOrBlankNode) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for IriOrBlankNode
impl PartialEq for IriOrBlankNode
Source§impl PartialOrd for IriOrBlankNode
impl PartialOrd for IriOrBlankNode
Source§impl Serialize for IriOrBlankNode
impl Serialize for IriOrBlankNode
Source§impl TryFrom<Object> for IriOrBlankNode
Attempts to convert an Object into an IriOrBlankNode.
impl TryFrom<Object> for IriOrBlankNode
Attempts to convert an Object into an IriOrBlankNode.
This conversion succeeds only when the object is an IRI or blank node. It fails with an error if the object is a literal or triple, as these cannot be represented as resources.
§Errors
RDFError::ExpectedIriOrBlankNodeFoundLiteral: When attempting to convert a literal object. Literals cannot be subjects in standard RDF.RDFError::ExpectedIriOrBlankNodeFoundTriple: When attempting to convert an RDF-star triple object in a context where quoted triples are not supported.
Source§impl TryFrom<Term> for IriOrBlankNode
Attempts to convert an oxrdf::Term into an IriOrBlankNode.
impl TryFrom<Term> for IriOrBlankNode
Attempts to convert an oxrdf::Term into an IriOrBlankNode.
This conversion succeeds only when the term is a named node or blank node. It fails if the term is a literal or RDF-star triple.
§Errors
Returns an error if the term is a literal or triple, as these cannot be
represented as IriOrBlankNode.
impl Eq for IriOrBlankNode
impl StructuralPartialEq for IriOrBlankNode
Auto Trait Implementations§
impl Freeze for IriOrBlankNode
impl RefUnwindSafe for IriOrBlankNode
impl Send for IriOrBlankNode
impl Sync for IriOrBlankNode
impl Unpin for IriOrBlankNode
impl UnsafeUnpin for IriOrBlankNode
impl UnwindSafe for IriOrBlankNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.