pub trait SRDFBasic {
type Subject: Debug + Display + PartialEq + Clone + Eq + Hash;
type IRI: Debug + Display + Hash + Eq + Clone;
type BNode: Debug + Display + PartialEq;
type Literal: Debug + Display + PartialEq + Eq + Hash;
type Term: Debug + Clone + Display + PartialEq + Eq + Hash;
type Err: Display;
Show 44 methods
// Required methods
fn subject_as_iri(subject: &Self::Subject) -> Option<Self::IRI>;
fn subject_as_bnode(subject: &Self::Subject) -> Option<Self::BNode>;
fn subject_is_iri(subject: &Self::Subject) -> bool;
fn subject_is_bnode(subject: &Self::Subject) -> bool;
fn term_as_iri(object: &Self::Term) -> Option<&Self::IRI>;
fn term_as_bnode(object: &Self::Term) -> Option<Self::BNode>;
fn term_as_literal(object: &Self::Term) -> Option<Self::Literal>;
fn term_as_object(term: &Self::Term) -> Object;
fn object_as_term(obj: &Object) -> Self::Term;
fn term_is_iri(object: &Self::Term) -> bool;
fn term_is_bnode(object: &Self::Term) -> bool;
fn term_is_literal(object: &Self::Term) -> bool;
fn term_as_subject(object: &Self::Term) -> Option<Self::Subject>;
fn subject_as_term(subject: &Self::Subject) -> Self::Term;
fn lexical_form(literal: &Self::Literal) -> &str;
fn lang(literal: &Self::Literal) -> Option<String>;
fn datatype(literal: &Self::Literal) -> Self::IRI;
fn iri_s2iri(iri_s: &IriS) -> Self::IRI;
fn term_s2term(term: &OxTerm) -> Self::Term;
fn bnode_id2bnode(id: &str) -> Self::BNode;
fn iri_as_term(iri: Self::IRI) -> Self::Term;
fn iri_as_subject(iri: Self::IRI) -> Self::Subject;
fn bnode_as_term(bnode: Self::BNode) -> Self::Term;
fn bnode_as_subject(bnode: Self::BNode) -> Self::Subject;
fn iri2iri_s(iri: &Self::IRI) -> IriS;
fn qualify_iri(&self, iri: &Self::IRI) -> String;
fn qualify_subject(&self, subj: &Self::Subject) -> String;
fn qualify_term(&self, term: &Self::Term) -> String;
fn prefixmap(&self) -> Option<PrefixMap>;
fn resolve_prefix_local(
&self,
prefix: &str,
local: &str,
) -> Result<IriS, PrefixMapError>;
// Provided methods
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 { ... }
}
Expand description
Types that implement this trait contain basic comparisons and conversions between nodes in RDF graphs
TODO: Consider splitting this trait in two traits: RDFNodeComparison, RDFNodeConversion
Required Associated Types§
Required Methods§
Sourcefn subject_as_iri(subject: &Self::Subject) -> Option<Self::IRI>
fn subject_as_iri(subject: &Self::Subject) -> Option<Self::IRI>
Returns the RDF subject as an IRI if it is an IRI, None if it isn’t
Sourcefn subject_as_bnode(subject: &Self::Subject) -> Option<Self::BNode>
fn subject_as_bnode(subject: &Self::Subject) -> Option<Self::BNode>
Returns the RDF subject as a Blank Node if it is a blank node, None if it isn’t
Sourcefn subject_is_iri(subject: &Self::Subject) -> bool
fn subject_is_iri(subject: &Self::Subject) -> bool
Returns true
if the subject is an IRI
Sourcefn subject_is_bnode(subject: &Self::Subject) -> bool
fn subject_is_bnode(subject: &Self::Subject) -> bool
Returns true
if the subject is a Blank Node
fn term_as_iri(object: &Self::Term) -> Option<&Self::IRI>
fn term_as_bnode(object: &Self::Term) -> Option<Self::BNode>
fn term_as_literal(object: &Self::Term) -> Option<Self::Literal>
fn term_as_object(term: &Self::Term) -> Object
fn object_as_term(obj: &Object) -> Self::Term
fn term_is_iri(object: &Self::Term) -> bool
fn term_is_bnode(object: &Self::Term) -> bool
fn term_is_literal(object: &Self::Term) -> bool
fn term_as_subject(object: &Self::Term) -> Option<Self::Subject>
fn subject_as_term(subject: &Self::Subject) -> Self::Term
fn lexical_form(literal: &Self::Literal) -> &str
fn lang(literal: &Self::Literal) -> Option<String>
fn datatype(literal: &Self::Literal) -> Self::IRI
fn iri_s2iri(iri_s: &IriS) -> Self::IRI
fn term_s2term(term: &OxTerm) -> Self::Term
fn bnode_id2bnode(id: &str) -> Self::BNode
fn iri_as_term(iri: Self::IRI) -> Self::Term
fn iri_as_subject(iri: Self::IRI) -> Self::Subject
fn bnode_as_term(bnode: Self::BNode) -> Self::Term
fn bnode_as_subject(bnode: Self::BNode) -> Self::Subject
fn iri2iri_s(iri: &Self::IRI) -> IriS
fn qualify_iri(&self, iri: &Self::IRI) -> String
fn qualify_subject(&self, subj: &Self::Subject) -> String
fn qualify_term(&self, term: &Self::Term) -> String
fn prefixmap(&self) -> Option<PrefixMap>
Sourcefn 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
Provided Methods§
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
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.