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 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 SRDF for SRDFGraph
impl SRDF for SRDFGraph
fn predicates_for_subject( &self, subject: &Self::Subject, ) -> Result<HashSet<Self::IRI>, Self::Err>
fn objects_for_subject_predicate( &self, subject: &Self::Subject, pred: &Self::IRI, ) -> Result<HashSet<Self::Term>, Self::Err>
fn subjects_with_predicate_object( &self, pred: &Self::IRI, object: &Self::Term, ) -> Result<HashSet<Self::Subject>, Self::Err>
fn outgoing_arcs( &self, subject: &Self::Subject, ) -> Result<HashMap<Self::IRI, HashSet<Self::Term>>, Self::Err>
fn incoming_arcs( &self, object: &Self::Term, ) -> Result<HashMap<Self::IRI, HashSet<Self::Subject>>, Self::Err>
Source§fn outgoing_arcs_from_list(
&self,
subject: &Self::Subject,
preds: &[Self::IRI],
) -> Result<(HashMap<Self::IRI, HashSet<Self::Term>>, Vec<Self::IRI>), Self::Err>
fn outgoing_arcs_from_list( &self, subject: &Self::Subject, preds: &[Self::IRI], ) -> Result<(HashMap<Self::IRI, HashSet<Self::Term>>, Vec<Self::IRI>), 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.fn triples_with_predicate( &self, pred: &Self::IRI, ) -> Result<Vec<Triple<Self>>, Self::Err>
Source§impl SRDFBasic for SRDFGraph
impl SRDFBasic for SRDFGraph
Source§type Err = SRDFGraphError
type Err = SRDFGraphError
RDF errors
Source§fn subject_as_iri(subject: &OxSubject) -> Option<OxNamedNode>
fn subject_as_iri(subject: &OxSubject) -> Option<OxNamedNode>
Returns the RDF subject as an IRI if it is an IRI, None if it isn’t
Source§fn subject_as_bnode(subject: &OxSubject) -> Option<OxBlankNode>
fn subject_as_bnode(subject: &OxSubject) -> Option<OxBlankNode>
Returns the RDF subject as a Blank Node if it is a blank node, None if it isn’t
Source§fn subject_is_iri(subject: &OxSubject) -> bool
fn subject_is_iri(subject: &OxSubject) -> bool
Returns
true
if the subject is an IRISource§fn subject_is_bnode(subject: &OxSubject) -> bool
fn subject_is_bnode(subject: &OxSubject) -> bool
Returns
true
if the subject is a Blank Nodefn term_as_iri(object: &OxTerm) -> Option<&OxNamedNode>
fn term_as_bnode(object: &OxTerm) -> Option<OxBlankNode>
fn term_as_literal(object: &OxTerm) -> Option<OxLiteral>
fn term_is_iri(object: &OxTerm) -> bool
fn term_is_bnode(object: &OxTerm) -> bool
fn term_is_literal(object: &OxTerm) -> bool
fn subject_as_term(subject: &Self::Subject) -> Self::Term
fn term_as_subject(object: &Self::Term) -> Option<Self::Subject>
fn lexical_form(literal: &OxLiteral) -> &str
fn lang(literal: &OxLiteral) -> Option<String>
fn datatype(literal: &OxLiteral) -> OxNamedNode
fn iri_s2iri(iri_s: &IriS) -> OxNamedNode
fn iri_as_term(iri: OxNamedNode) -> OxTerm
fn iri_as_subject(iri: OxNamedNode) -> OxSubject
fn iri2iri_s(iri: &OxNamedNode) -> IriS
fn term_s2term(term: &OxTerm) -> Self::Term
fn term_as_object(term: &OxTerm) -> Object
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>
fn bnode_id2bnode(id: &str) -> Self::BNode
fn bnode_as_term(bnode: Self::BNode) -> Self::Term
fn object_as_term(obj: &Object) -> Self::Term
fn bnode_as_subject(bnode: Self::BNode) -> Self::Subject
fn term_as_boolean(object: &Self::Term) -> Option<bool>
fn object_as_subject(obj: &Object) -> Option<Self::Subject>
fn literal_as_boolean(literal: &Self::Literal) -> Option<bool>
fn literal_as_integer(literal: &Self::Literal) -> Option<isize>
fn literal_as_string(literal: &Self::Literal) -> Option<String>
fn term_as_iri_s(term: &Self::Term) -> Option<IriS>
fn term_as_integer(term: &Self::Term) -> Option<isize>
fn term_as_string(term: &Self::Term) -> Option<String>
fn subject_as_object(subject: &Self::Subject) -> Object
fn datatype_str(literal: &Self::Literal) -> String
fn iri_s2subject(iri_s: &IriS) -> Self::Subject
fn iri_s2term(iri_s: &IriS) -> Self::Term
fn bnode_id2term(id: &str) -> Self::Term
fn bnode_id2subject(id: &str) -> Self::Subject
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_triple(
&mut self,
subj: &Self::Subject,
pred: &Self::IRI,
obj: &Self::Term,
) -> Result<(), Self::Err>
fn add_triple( &mut self, subj: &Self::Subject, pred: &Self::IRI, obj: &Self::Term, ) -> Result<(), Self::Err>
Adds an RDF triple to the current RDF graph
Source§fn remove_triple(
&mut self,
subj: &Self::Subject,
pred: &Self::IRI,
obj: &Self::Term,
) -> Result<(), Self::Err>
fn remove_triple( &mut self, subj: &Self::Subject, pred: &Self::IRI, obj: &Self::Term, ) -> 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