Module rdftk_core::model::data_set[][src]

Expand description

Provides an implementation of the W3C RDF 1.1: On Semantics of RDF Datasets recommendation. Additional semantics taken from RDF 1.1 TriG, RDF Dataset Language.

Example

use rdftk_core::model::data_set::{DataSet, DataSetRef};
use rdftk_core::model::graph::GraphRef;
use rdftk_core::model::statement::StatementRef;

fn simple_dataset_writer(data_set: &DataSetRef)
{
    let data_set = data_set.borrow();
    if let Some(graph) = data_set.default_graph() {
        println!("{{");
        simple_graph_writer(graph);
        println!("}}");
    }
    for (name, graph) in data_set.graphs() {
        println!("{} {{", name);
        simple_graph_writer(graph);
        println!("}}");
    }
}

fn simple_graph_writer(graph: &GraphRef)
{
    let graph = graph.borrow();
    for statement in graph.statements() {
        println!("    {}", statement);
    }
}

Re-exports

pub use name::GraphName;
pub use name::GraphNameRef;

Modules

name

An extension to the core Graph to support named graphs. The semantics of a named graph has been derived from RDF 1.1 TriG, RDF Dataset Language, and RDF 1.1: On Semantics of RDF Datasets.

Traits

DataSet

A DataSet is a mapping from GraphName to Graph; this introduces the notion of a named graph although in actuality the graph itself is not named as the name is the key within the data set. Note that this trait represents an immutable data set, a type should also implement the MutableDataSet trait for mutation.

DataSetFactory

A data set factory provides an interface to create a new data set. This allows for implementations where underlying shared resources are required and so may be owned by the factory.

Type Definitions

DataSetFactoryRef

The reference type for a graph factory returned by a graph.

DataSetRef

The reference type for a graph data set.