Trait SRDFBuilder

Source
pub trait SRDFBuilder: Query {
    // Required methods
    fn empty() -> Self;
    fn add_base(&mut self, base: &Option<IriS>) -> Result<(), Self::Err>;
    fn add_prefix(&mut self, alias: &str, iri: &IriS) -> Result<(), Self::Err>;
    fn add_prefix_map(&mut self, prefix_map: PrefixMap) -> Result<(), Self::Err>;
    fn add_triple<S, P, O>(
        &mut self,
        subj: S,
        pred: P,
        obj: O,
    ) -> Result<(), Self::Err>
       where S: Into<Self::Subject>,
             P: Into<Self::IRI>,
             O: Into<Self::Term>;
    fn remove_triple<S, P, O>(
        &mut self,
        subj: S,
        pred: P,
        obj: O,
    ) -> Result<(), Self::Err>
       where S: Into<Self::Subject>,
             P: Into<Self::IRI>,
             O: Into<Self::Term>;
    fn add_type<S, T>(&mut self, node: S, type_: T) -> Result<(), Self::Err>
       where S: Into<Self::Subject>,
             T: Into<Self::Term>;
    fn add_bnode(&mut self) -> Result<Self::BNode, Self::Err>;
    fn serialize<W: Write>(
        &self,
        format: &RDFFormat,
        writer: &mut W,
    ) -> Result<(), Self::Err>;
}
Expand description

Types that implement this trait can build RDF data

Required Methods§

Source

fn empty() -> Self

Returns an empty RDF graph

Source

fn add_base(&mut self, base: &Option<IriS>) -> Result<(), Self::Err>

Adds an optional IRI as base

Source

fn add_prefix(&mut self, alias: &str, iri: &IriS) -> Result<(), Self::Err>

Adds a prefix declaration to the current RDF graph

Source

fn add_prefix_map(&mut self, prefix_map: PrefixMap) -> Result<(), Self::Err>

Adds a prefix map declaration to the current RDF graph

Source

fn add_triple<S, P, O>( &mut self, subj: S, pred: P, obj: O, ) -> Result<(), Self::Err>
where S: Into<Self::Subject>, P: Into<Self::IRI>, O: Into<Self::Term>,

Adds an RDF triple to the current RDF graph

Source

fn remove_triple<S, P, O>( &mut self, subj: S, pred: P, obj: O, ) -> Result<(), Self::Err>
where S: Into<Self::Subject>, P: Into<Self::IRI>, O: Into<Self::Term>,

Removes an RDF triple to the current RDF graph

Source

fn add_type<S, T>(&mut self, node: S, type_: T) -> Result<(), Self::Err>
where S: Into<Self::Subject>, T: Into<Self::Term>,

Adds an rdf:type declaration to the current RDF graph

Source

fn add_bnode(&mut self) -> Result<Self::BNode, Self::Err>

Adds an Blank node to the RDF graph and get the node identifier

Source

fn serialize<W: Write>( &self, format: &RDFFormat, writer: &mut W, ) -> Result<(), Self::Err>

Serialize the current graph to a Write implementation

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.

Implementors§