Struct BlankNode
pub struct BlankNode(/* private fields */);Expand description
An owned RDF blank node.
The common way to create a new blank node is to use the BlankNode::default() function.
It is also possible to create a blank node from a blank node identifier using the BlankNode::new() function.
The blank node identifier must be valid according to N-Triples, Turtle, and SPARQL grammars.
The default string formatter is returning an N-Triples, Turtle, and SPARQL compatible representation:
use oxrdf::BlankNode;
assert_eq!("_:a122", BlankNode::new("a122")?.to_string());Implementations§
§impl BlankNode
impl BlankNode
pub fn new(id: impl Into<String>) -> Result<BlankNode, BlankNodeIdParseError>
pub fn new(id: impl Into<String>) -> Result<BlankNode, BlankNodeIdParseError>
Creates a blank node from a unique identifier.
The blank node identifier must be valid according to N-Triples, Turtle, and SPARQL grammars.
In most cases, it is much more convenient to create a blank node using BlankNode::default()
that creates a random ID that could be easily inlined by Oxigraph stores.
pub fn new_unchecked(id: impl Into<String>) -> BlankNode
pub fn new_unchecked(id: impl Into<String>) -> BlankNode
Creates a blank node from a unique identifier without validation.
It is the caller’s responsibility to ensure that id is a valid blank node identifier
according to N-Triples, Turtle, and SPARQL grammars.
BlankNode::new() is a safe version of this constructor and should be used for untrusted data.
pub fn new_from_unique_id(id: u128) -> BlankNode
pub fn new_from_unique_id(id: u128) -> BlankNode
Creates a blank node from a unique numerical id.
In most cases, it is much more convenient to create a blank node using BlankNode::default().
pub fn into_string(self) -> String
pub fn into_string(self) -> String
Returns the underlying ID of this blank node.