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:
TripleandQuadare simple tuple types representing a triple/quad of resources (a quad additionally carries an optional named graph);Domainand itsFiniteDomain,GenDomainandConstGenDomainrefinements abstract over a set of resources, independently of any graph or dataset;GraphandDatasetabstract 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/IndexedBTreeGraphandBTreeDataset/IndexedBTreeDatasetare 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§
- BTree
Bijection - Blank node identifier bijection between two (isomorphic) datasets.
- BTree
Dataset - BTree-based RDF dataset.
- BTree
Graph - BTree-based RDF graph.
- IndexedB
Tree Dataset - Indexed BTree-based RDF dataset, optimized for pattern matching operations.
- IndexedB
Tree Graph - Indexed BTree-based RDF graph, optimized for pattern matching operations.
- Quad
- RDF quad.
- Quad
Objects - Iterator over the objects of a dataset matching a given graph, subject and predicate.
- Quad
Predicates Objects - Iterator over the predicates of a dataset matching a given graph and subject, along with, for each predicate, the objects matching it.
- Static
Domain - Trivial domain implementation that just fixes the resource type
R, without tracking any actual resource. - Triple
- RDF triple.
- Triple
Objects - Iterator over the objects of a graph matching a given subject and predicate.
- Triple
Predicates Objects - 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§
- Async
Const GenDomain - Domain that can spawn fresh new resources from a shared reference.
- Async
Dataset Mut - Async mutable dataset.
- Async
Finite Dataset - Async finite dataset.
- Async
Finite Domain - Asynchronous finite domain.
- Async
Finite Graph - Async finite graph.
- Async
GenDomain - Domain that can spawn fresh new resources.
- Async
Graph Mut - Async mutable graph.
- Async
Pattern Matching Dataset - Async pattern-matching-capable dataset.
- Async
Pattern Matching Graph - Async pattern-matching-capable graph.
- Const
GenDomain - Domain that can spawn fresh new resources from a shared reference.
- Dataset
- RDF dataset.
- Dataset
Mut - Mutable dataset.
- Domain
- RDF resource domain.
- Finite
Dataset - Dataset that can be traversed using a provided quad iterator.
- Finite
Domain - Finite domain.
- Finite
Graph - Graph that can be traversed using a provided triple iterator.
- GenDomain
- Domain that can spawn fresh new resources.
- Graph
- RDF graph.
- Graph
Mut - Mutable graph.
- Multi
Pattern Matching Dataset - Multi-pattern-matching-capable dataset.
- Multi
Pattern Matching Graph - Multi-pattern-matching-capable graph.
- Named
Graph Finite Dataset - Dataset that can enumerate the distinct resources it uses to name a graph.
- Object
Finite Dataset - Dataset that can enumerate the distinct resources it uses as an object.
- Object
Finite Graph - Graph that can enumerate the distinct resources it uses as an object.
- Pattern
Matching Dataset - Pattern-matching-capable dataset.
- Pattern
Matching Dataset Mut - Pattern-matching-capable mutable dataset.
- Pattern
Matching Graph - Pattern-matching-capable graph.
- Pattern
Matching Graph Mut - Pattern-matching-capable mutable graph.
- Predicate
Finite Dataset - Dataset that can enumerate the distinct resources it uses as a predicate.
- Predicate
Finite Graph - Graph that can enumerate the distinct resources it uses as a predicate.
- Resource
Finite Dataset - Dataset that can enumerate the distinct resources it mentions (in any position of any quad).
- Resource
Finite Graph - Graph that can enumerate the distinct resources it mentions (in any position of any triple).
- Subject
Finite Dataset - Dataset that can enumerate the distinct resources it uses as a subject.
- Subject
Finite Graph - Graph that can enumerate the distinct resources it uses as a subject.
- TryConst
GenDomain - Fallible domain that can spawn fresh new resources from a shared reference.
- TryDataset
- Fallible dataset.
- TryDataset
Mut - Fallible mutable dataset.
- TryDomain
- Fallible domain.
- TryFinite
Dataset - Fallible dataset that can be traversed using a provided quad iterator.
- TryFinite
Domain - Fallible finite domain.
- TryFinite
Graph - Fallible graph that can be traversed using a provided triple iterator.
- TryGen
Domain - Fallible domain that can spawn fresh new resources.
- TryGraph
- Fallible graph.
- TryGraph
Mut - Fallible mutable graph.
- TryPattern
Matching Dataset - Pattern-matching-capable fallible dataset.
- TryPattern
Matching Graph - Pattern-matching-capable fallible graph.
Functions§
- are_
isomorphic - Checks that there is an isomorphism between the datasets
aandb. - find_
bijection - Finds a blank node identifier bijection from
atob. If such bijection exists, there is an isomorphism betweenaandb.