Skip to main content

Crate rdf_types

Crate rdf_types 

Source
Expand description

The Resource Description Framework (RDF) is a very simple graph data model defined by the World Wide Web Consortium (W3C) to represent arbitrary pieces of information, primarily intended for the web. Nodes of the graph are called resources, and resources are connected together using relations, which are resources themselves.

This crate provides generic, purely semantic (as opposed to syntactic) building blocks to work with RDF data, regardless of how resources are represented:

  • Triple and Quad are simple tuple types representing a triple/quad of resources (a quad additionally carries an optional named graph);
  • Domain and its FiniteDomain, GenDomain and ConstGenDomain refinements abstract over a set of resources, independently of any graph or dataset;
  • Graph and Dataset abstract over, respectively, a collection of triples and a collection of quads, with refinements to iterate over their triples/quads and resources, perform pattern matching, and mutate them. BTreeGraph/IndexedBTreeGraph and BTreeDataset/IndexedBTreeDataset are ready-to-use implementations backed by B-trees.

Every trait and type above is generic over the resource type, and comes with fallible (Try*) and asynchronous (Async*) counterparts, so they can be implemented on top of I/O-backed or otherwise fallible storage.

This crate does not provide any lexical or syntactic representation of RDF resources (IRIs, blank node identifiers, literals, etc.), nor the notion of interpretation mapping such lexical resources to semantic ones. See the rdf-syntax crate for that.

Modules§

btree_dataset
btree_graph
diff
Diff between two RDF datasets.
indexed_btree_dataset
indexed_btree_graph
pattern
Triple/quad patterns, used to describe a set of triples/quads by leaving some of their components unspecified (variables).
util
Small iterator adapters shared by the fallible/owned trait implementations of this crate.

Structs§

BTreeBijection
Blank node identifier bijection between two (isomorphic) datasets.
BTreeDataset
BTree-based RDF dataset.
BTreeGraph
BTree-based RDF graph.
IndexedBTreeDataset
Indexed BTree-based RDF dataset, optimized for pattern matching operations.
IndexedBTreeGraph
Indexed BTree-based RDF graph, optimized for pattern matching operations.
Quad
RDF quad.
QuadObjects
Iterator over the objects of a dataset matching a given graph, subject and predicate.
QuadPredicatesObjects
Iterator over the predicates of a dataset matching a given graph and subject, along with, for each predicate, the objects matching it.
StaticDomain
Trivial domain implementation that just fixes the resource type R, without tracking any actual resource.
Triple
RDF triple.
TripleObjects
Iterator over the objects of a graph matching a given subject and predicate.
TriplePredicatesObjects
Iterator over the predicates of a graph matching a given subject, along with, for each predicate, the objects matching it.

Enums§

Cow
A clone-on-write smart pointer.

Traits§

AsyncConstGenDomain
Domain that can spawn fresh new resources from a shared reference.
AsyncDatasetMut
Async mutable dataset.
AsyncFiniteDataset
Async finite dataset.
AsyncFiniteDomain
Asynchronous finite domain.
AsyncFiniteGraph
Async finite graph.
AsyncGenDomain
Domain that can spawn fresh new resources.
AsyncGraphMut
Async mutable graph.
AsyncPatternMatchingDataset
Async pattern-matching-capable dataset.
AsyncPatternMatchingGraph
Async pattern-matching-capable graph.
ConstGenDomain
Domain that can spawn fresh new resources from a shared reference.
Dataset
RDF dataset.
DatasetMut
Mutable dataset.
Domain
RDF resource domain.
FiniteDataset
Dataset that can be traversed using a provided quad iterator.
FiniteDomain
Finite domain.
FiniteGraph
Graph that can be traversed using a provided triple iterator.
GenDomain
Domain that can spawn fresh new resources.
Graph
RDF graph.
GraphMut
Mutable graph.
MultiPatternMatchingDataset
Multi-pattern-matching-capable dataset.
MultiPatternMatchingGraph
Multi-pattern-matching-capable graph.
NamedGraphFiniteDataset
Dataset that can enumerate the distinct resources it uses to name a graph.
ObjectFiniteDataset
Dataset that can enumerate the distinct resources it uses as an object.
ObjectFiniteGraph
Graph that can enumerate the distinct resources it uses as an object.
PatternMatchingDataset
Pattern-matching-capable dataset.
PatternMatchingDatasetMut
Pattern-matching-capable mutable dataset.
PatternMatchingGraph
Pattern-matching-capable graph.
PatternMatchingGraphMut
Pattern-matching-capable mutable graph.
PredicateFiniteDataset
Dataset that can enumerate the distinct resources it uses as a predicate.
PredicateFiniteGraph
Graph that can enumerate the distinct resources it uses as a predicate.
ResourceFiniteDataset
Dataset that can enumerate the distinct resources it mentions (in any position of any quad).
ResourceFiniteGraph
Graph that can enumerate the distinct resources it mentions (in any position of any triple).
SubjectFiniteDataset
Dataset that can enumerate the distinct resources it uses as a subject.
SubjectFiniteGraph
Graph that can enumerate the distinct resources it uses as a subject.
TryConstGenDomain
Fallible domain that can spawn fresh new resources from a shared reference.
TryDataset
Fallible dataset.
TryDatasetMut
Fallible mutable dataset.
TryDomain
Fallible domain.
TryFiniteDataset
Fallible dataset that can be traversed using a provided quad iterator.
TryFiniteDomain
Fallible finite domain.
TryFiniteGraph
Fallible graph that can be traversed using a provided triple iterator.
TryGenDomain
Fallible domain that can spawn fresh new resources.
TryGraph
Fallible graph.
TryGraphMut
Fallible mutable graph.
TryPatternMatchingDataset
Pattern-matching-capable fallible dataset.
TryPatternMatchingGraph
Pattern-matching-capable fallible graph.

Functions§

are_isomorphic
Checks that there is an isomorphism between the datasets a and b.
find_bijection
Finds a blank node identifier bijection from a to b. If such bijection exists, there is an isomorphism between a and b.