[][src]Trait rome::graph::BlankNodePtr

pub trait BlankNodePtr<'g> {
    fn to_blank_node_or_iri<I>(&self) -> BlankNodeOrIRI<'g, Self, I>
    where
        Self: Clone,
        I: IRIPtr<'g>
, { ... }
fn to_resource<I, L>(&self) -> Resource<'g, Self, I, L>
    where
        Self: Clone,
        I: IRIPtr<'g>,
        L: LiteralPtr<'g>
, { ... } }

Instances of this trait point to a blank node in a graph.

Different graph implementations can represent blank nodes in a different way. The essense of the blank node is the same in all graphs and is capured by this trait.

Blank nodes are tied to their graph. Their lifetime 'g is the same as the lifetime of the graph to which they belong.

Provided Methods

Convert this BlankNodePtr to a BlankNodeOrIRI.

This is a convenience wrapper around the constructor for the enum BlankNodeOrIRI.

let blank_node = creator.create_blank_node();
let blank_node_or_iri = blank_node.to_blank_node_or_iri();
assert_eq!(Some(&blank_node), blank_node_or_iri.as_blank_node());

Convert this BlankNodePtr to a Resource.

This is a convenience wrapper around the constructor for the enum Resource.

let literal = graph.find_literal("hello", XSD_STRING, None).unwrap();
let resource = literal.to_resource();
assert_eq!(Some(&literal), resource.as_literal());

Implementors