Skip to main content

Loaded

Struct Loaded 

Source
pub struct Loaded {
    pub graph: Graph,
    pub prefixes: Vec<(String, String)>,
    pub base: Option<String>,
}
Expand description

A loaded shapes graph plus the prefixes declared in the document.

Fields§

§graph: Graph§prefixes: Vec<(String, String)>§base: Option<String>

Implementations§

Source§

impl Loaded

Source

pub fn from_turtle(data: &[u8], base: Option<&str>) -> Result<Self, ParseError>

Parse a Turtle document into an in-memory graph.

Source

pub fn from_ntriples(data: &[u8]) -> Result<Self, ParseError>

Source

pub fn from_path( path: &Path, format: RdfFormat, base: Option<&str>, ) -> Result<Self, ParseError>

Source

pub fn objects( &self, subject: &NamedOrBlankNode, predicate: NamedNodeRef<'_>, ) -> Vec<Term>

All objects of (subject, predicate).

Source

pub fn object( &self, subject: &NamedOrBlankNode, predicate: NamedNodeRef<'_>, ) -> Option<Term>

The first object of (subject, predicate), if any.

Source

pub fn has_type(&self, subject: &NamedOrBlankNode, ty: NamedNodeRef<'_>) -> bool

Does the subject have (subject, rdf:type, ty)?

Source

pub fn is_instance_of( &self, subject: &NamedOrBlankNode, ty: NamedNodeRef<'_>, ) -> bool

Does the subject have ty through rdf:type/rdfs:subClassOf*?

Source

pub fn merge_from(&mut self, other: &Loaded)

Merge all triples from other into this graph.

Source

pub fn read_list(&self, head: &Term) -> Vec<Term>

Read an rdf:List starting at head into its member terms.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V