Module oxrdf::graph

source ·
Expand description

In-memory implementation of RDF graphs.

Usage example:

use oxrdf::*;

let mut graph = Graph::default();

// insertion
let ex = NamedNodeRef::new("http://example.com")?;
let triple = TripleRef::new(ex, ex, ex);
graph.insert(triple);

// simple filter
let results: Vec<_> = graph.triples_for_subject(ex).collect();
assert_eq!(vec![triple], results);

// Print
assert_eq!(graph.to_string(), "<http://example.com> <http://example.com> <http://example.com> .\n");

See also Dataset if you want to get support of multiple RDF graphs at the same time.

Structs