[][src]Trait grdf::Graph

pub trait Graph<T = Term> {
    type Triples: Iterator<Item = Triple<&'a T>>;
    type Subjects: Iterator<Item = (&'a T, Self::Predicates)>;
    type Predicates: Iterator<Item = (&'a T, Self::Objects)>;
    type Objects: Iterator<Item = &'a T>;
    pub fn triples<'a>(&'a self) -> Self::Triples
    where
        T: 'a
;
pub fn subjects<'a>(&'a self) -> Self::Subjects
    where
        T: 'a
;
pub fn predicates<'a>(&'a self, subject: &T) -> Self::Predicates
    where
        T: 'a
;
pub fn objects<'a>(&'a self, subject: &T, predicate: &T) -> Self::Objects
    where
        T: 'a
;
pub fn contains(&self, triple: Triple<&T>) -> bool; }

gRDF graph.

A graph is a collection of RDF triples. It also defines a set of iterator to easily explore the graph.

Associated Types

type Triples: Iterator<Item = Triple<&'a T>>[src]

Triple iterators.

type Subjects: Iterator<Item = (&'a T, Self::Predicates)>[src]

Graph subjects iterator.

Each subject is given with its associated predicates (and objects).

type Predicates: Iterator<Item = (&'a T, Self::Objects)>[src]

Subject predicates iterator.

Iterate through all the predicates associated to a given subject. Each predicate is also given with the associated objects.

type Objects: Iterator<Item = &'a T>[src]

Objects iterator.

Iterate through a set of objects.

Loading content...

Required methods

pub fn triples<'a>(&'a self) -> Self::Triples where
    T: 'a, 
[src]

pub fn subjects<'a>(&'a self) -> Self::Subjects where
    T: 'a, 
[src]

Iterate through all the subjects of the graph.

pub fn predicates<'a>(&'a self, subject: &T) -> Self::Predicates where
    T: 'a, 
[src]

Iterate through all the predicates associated to the given subject.

pub fn objects<'a>(&'a self, subject: &T, predicate: &T) -> Self::Objects where
    T: 'a, 
[src]

Iterate through all the objects associated to the given subject and predicate.

pub fn contains(&self, triple: Triple<&T>) -> bool[src]

Checks if the given triple is defined in the graph.

Loading content...

Implementors

impl<T: Hash + Eq> Graph<T> for HashGraph<T>[src]

type Objects = Objects<'a, T>

type Predicates = Predicates<'a, T>

type Subjects = Subjects<'a, T>

type Triples = Iter<'a, T>

Loading content...