pub struct SRDFSparql { /* private fields */ }
Expand description
Implements SRDF interface as a SPARQL endpoint
Implementations§
Source§impl SRDFSparql
impl SRDFSparql
pub fn new( iri: &IriS, prefixmap: &PrefixMap, ) -> Result<SRDFSparql, SRDFSparqlError>
pub fn iri(&self) -> &IriS
pub fn prefixmap(&self) -> &PrefixMap
pub fn wikidata() -> Result<SRDFSparql, SRDFSparqlError>
pub fn with_prefixmap(self, pm: PrefixMap) -> SRDFSparql
pub fn show_literal(&self, lit: &OxLiteral) -> String
Trait Implementations§
Source§impl AsyncSRDF for SRDFSparql
impl AsyncSRDF for SRDFSparql
type IRI = NamedNode
type BNode = BlankNode
type Literal = Literal
type Subject = Subject
type Term = Term
type Err = SRDFSparqlError
fn get_predicates_subject<'life0, 'life1, 'async_trait>(
&'life0 self,
subject: &'life1 OxSubject,
) -> Pin<Box<dyn Future<Output = Result<HashSet<OxNamedNode>, SRDFSparqlError>> + 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>, SRDFSparqlError>> + 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>, SRDFSparqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§impl Clone for SRDFSparql
impl Clone for SRDFSparql
Source§fn clone(&self) -> SRDFSparql
fn clone(&self) -> SRDFSparql
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SRDFSparql
impl Debug for SRDFSparql
Source§impl FromStr for SRDFSparql
impl FromStr for SRDFSparql
Source§impl QuerySRDF for SRDFSparql
impl QuerySRDF for SRDFSparql
fn query_select( &self, query: &str, ) -> Result<QuerySolutions<Self>, SRDFSparqlError>
fn query_ask(&self, query: &str) -> Result<bool, SRDFSparqlError>
Source§impl SRDF for SRDFSparql
impl SRDF for SRDFSparql
fn predicates_for_subject( &self, subject: &OxSubject, ) -> Result<HashSet<OxNamedNode>, SRDFSparqlError>
fn objects_for_subject_predicate( &self, subject: &OxSubject, pred: &OxNamedNode, ) -> Result<HashSet<OxTerm>, SRDFSparqlError>
fn subjects_with_predicate_object( &self, pred: &OxNamedNode, object: &OxTerm, ) -> Result<HashSet<OxSubject>, SRDFSparqlError>
fn outgoing_arcs( &self, subject: &Self::Subject, ) -> Result<HashMap<Self::IRI, HashSet<Self::Term>>, SRDFSparqlError>
fn incoming_arcs( &self, object: &Self::Term, ) -> Result<HashMap<Self::IRI, HashSet<Self::Subject>>, SRDFSparqlError>
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 SRDFSparql
impl SRDFBasic for SRDFSparql
Source§type Err = SRDFSparqlError
type Err = SRDFSparqlError
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 term_as_subject(object: &Self::Term) -> Option<OxSubject>
fn subject_as_term(subject: &Self::Subject) -> OxTerm
fn lexical_form(literal: &OxLiteral) -> &str
fn lang(literal: &OxLiteral) -> Option<String>
fn datatype(literal: &OxLiteral) -> OxNamedNode
fn iri_as_term(iri: OxNamedNode) -> OxTerm
fn iri_s2iri(iri_s: &IriS) -> Self::IRI
fn term_s2term(term: &OxTerm) -> Self::Term
fn term_as_object(term: &Self::Term) -> Object
fn iri2iri_s(iri: &Self::IRI) -> IriS
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: &OxNamedNode) -> String
fn qualify_subject(&self, subj: &OxSubject) -> String
fn qualify_term(&self, term: &OxTerm) -> String
fn iri_as_subject(iri: Self::IRI) -> Self::Subject
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
Auto Trait Implementations§
impl Freeze for SRDFSparql
impl !RefUnwindSafe for SRDFSparql
impl Send for SRDFSparql
impl Sync for SRDFSparql
impl Unpin for SRDFSparql
impl !UnwindSafe for SRDFSparql
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