pub struct SRDFGraph { /* private fields */ }
Implementations§
Source§impl SRDFGraph
impl SRDFGraph
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn quads(&self) -> impl Iterator<Item = Quad> + '_
pub fn is_empty(&self) -> bool
pub fn merge_from_reader<R: Read>( &mut self, read: R, format: &RDFFormat, base: Option<&str>, reader_mode: &ReaderMode, ) -> Result<(), SRDFGraphError>
pub fn merge_prefixes( &mut self, prefixmap: PrefixMap, ) -> Result<(), SRDFGraphError>
pub fn from_reader<R: Read>( read: R, format: &RDFFormat, base: Option<&str>, reader_mode: &ReaderMode, ) -> Result<SRDFGraph, SRDFGraphError>
pub fn resolve(&self, str: &str) -> Result<OxNamedNode, SRDFGraphError>
pub fn show_blanknode(&self, bn: &OxBlankNode) -> String
pub fn show_literal(&self, lit: &OxLiteral) -> String
pub fn from_str( data: &str, format: &RDFFormat, base: Option<&str>, reader_mode: &ReaderMode, ) -> Result<SRDFGraph, SRDFGraphError>
pub fn add_triple_ref<'a, S, P, O>( &mut self, subj: S, pred: P, obj: O, ) -> Result<(), SRDFGraphError>
pub fn merge_from_path<P: AsRef<Path>>( &mut self, path: P, format: &RDFFormat, base: Option<&str>, reader_mode: &ReaderMode, ) -> Result<(), SRDFGraphError>
pub fn from_path<P: AsRef<Path>>( path: P, format: &RDFFormat, base: Option<&str>, reader_mode: &ReaderMode, ) -> Result<SRDFGraph, SRDFGraphError>
pub fn parse_data( data: &String, format: &RDFFormat, base: &Path, reader_mode: &ReaderMode, ) -> Result<SRDFGraph, SRDFGraphError>
pub fn prefixmap(&self) -> PrefixMap
Trait Implementations§
Source§impl AsyncSRDF for SRDFGraph
impl AsyncSRDF for SRDFGraph
type IRI = NamedNode
type BNode = BlankNode
type Literal = Literal
type Subject = Subject
type Term = Term
type Err = SRDFGraphError
fn get_predicates_subject<'life0, 'life1, 'async_trait>(
&'life0 self,
subject: &'life1 OxSubject,
) -> Pin<Box<dyn Future<Output = Result<HashSet<OxNamedNode>, SRDFGraphError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_objects_for_subject_predicate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
subject: &'life1 OxSubject,
pred: &'life2 OxNamedNode,
) -> Pin<Box<dyn Future<Output = Result<HashSet<OxTerm>, SRDFGraphError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_subjects_for_object_predicate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
object: &'life1 OxTerm,
pred: &'life2 OxNamedNode,
) -> Pin<Box<dyn Future<Output = Result<HashSet<OxSubject>, SRDFGraphError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§impl FocusRDF for SRDFGraph
impl FocusRDF for SRDFGraph
Source§fn get_focus_as_term(&self) -> Result<&Self::Term, RDFParseError>
fn get_focus_as_term(&self) -> Result<&Self::Term, RDFParseError>
Get the current focus as a Term
Source§fn get_focus_as_subject(&self) -> Result<Self::Subject, RDFParseError>
fn get_focus_as_subject(&self) -> Result<Self::Subject, RDFParseError>
Get the current focus as a Subject
Source§impl Query for SRDFGraph
impl Query for SRDFGraph
fn triples(&self) -> Result<impl Iterator<Item = Self::Triple>, Self::Err>
Source§fn triples_matching<S, P, O>(
&self,
subject: S,
predicate: P,
object: O,
) -> Result<impl Iterator<Item = Self::Triple>, Self::Err>
fn triples_matching<S, P, O>( &self, subject: S, predicate: P, object: O, ) -> Result<impl Iterator<Item = Self::Triple>, Self::Err>
Note to implementors: this function needs to retrieve all the triples of
the graph. Therefore, for use-cases where the graph is large, this
function should be implemented in a way that it does not retrieve all
triples at once. As an example, for implementations of SPARQL, this
function should be implemented to retrieve just the triples that match
the given subject, predicate and object.
fn triples_with_subject<S: Matcher<Self::Subject>>( &self, subject: S, ) -> Result<impl Iterator<Item = Self::Triple>, Self::Err>
fn triples_with_predicate<P: Matcher<Self::IRI>>( &self, predicate: P, ) -> Result<impl Iterator<Item = Self::Triple>, Self::Err>
fn triples_with_object<O: Matcher<Self::Term>>( &self, object: O, ) -> Result<impl Iterator<Item = Self::Triple>, Self::Err>
fn incoming_arcs( &self, object: Self::Term, ) -> Result<IncomingArcs<Self>, Self::Err>
Source§fn outgoing_arcs(
&self,
subject: Self::Subject,
) -> Result<OutgoingArcs<Self>, Self::Err>
fn outgoing_arcs( &self, subject: Self::Subject, ) -> Result<OutgoingArcs<Self>, Self::Err>
get all outgoing arcs from a subject
Source§fn outgoing_arcs_from_list(
&self,
subject: &Self::Subject,
preds: &[Self::IRI],
) -> Result<OutgoingArcsFromList<Self>, Self::Err>
fn outgoing_arcs_from_list( &self, subject: &Self::Subject, preds: &[Self::IRI], ) -> Result<OutgoingArcsFromList<Self>, Self::Err>
get outgoing arcs from a
node
taking into account only a controlled list of preds
It returns a HashMap with the outgoing arcs and their values and a list of the predicates that have values and are not in the controlled list.Source§impl Rdf for SRDFGraph
impl Rdf for SRDFGraph
type IRI = NamedNode
type BNode = BlankNode
type Literal = Literal
type Subject = Subject
type Term = Term
type Triple = Triple
type Err = SRDFGraphError
Source§fn resolve_prefix_local(
&self,
prefix: &str,
local: &str,
) -> Result<IriS, PrefixMapError>
fn resolve_prefix_local( &self, prefix: &str, local: &str, ) -> Result<IriS, PrefixMapError>
Resolves a a prefix and a local name and obtains the corresponding full
IriS
fn qualify_iri(&self, node: &Self::IRI) -> String
fn qualify_subject(&self, subj: &OxSubject) -> String
fn qualify_term(&self, term: &OxTerm) -> String
fn prefixmap(&self) -> Option<PrefixMap>
Source§impl SRDFBuilder for SRDFGraph
impl SRDFBuilder for SRDFGraph
Source§fn add_base(&mut self, base: &Option<IriS>) -> Result<(), Self::Err>
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>
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>
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_bnode(&mut self) -> Result<Self::BNode, Self::Err>
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 add_triple<S, P, O>(
&mut self,
subj: S,
pred: P,
obj: O,
) -> Result<(), Self::Err>
fn add_triple<S, P, O>( &mut self, subj: S, pred: P, obj: O, ) -> Result<(), Self::Err>
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>
fn remove_triple<S, P, O>( &mut self, subj: S, pred: P, obj: O, ) -> Result<(), Self::Err>
Removes an RDF triple to the current RDF graph
Auto Trait Implementations§
impl Freeze for SRDFGraph
impl RefUnwindSafe for SRDFGraph
impl Send for SRDFGraph
impl Sync for SRDFGraph
impl Unpin for SRDFGraph
impl UnwindSafe for SRDFGraph
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
Mutably borrows from an owned value. Read more