[−][src]Module sophia::graph::inmem
In-memory implementations of RDF graphs.
This module provides building blocks
for defining implementations of Graph
and MutableGraph
,
with fine-tuned trade-offs between memory footprint and performance.
It also provides two pre-defined trade-offs:
FastGraph
and LightGraph
,
provided in different flavours
(default, small
, sync
).
Customized trade-off
By combining a given core implementation with various wrappers, you can easily make a Graph type with the exact trade-offs that you need.
For example, if one needs a small graph (less than 2^16 terms), that can be exchanged across threads, and whose arcs will mostly be traversed backward (from object to subject), an appropriate type definition would be:
use sophia::term::factory::ArcTermFactory; use sophia::graph::inmem::*; type MyGraph = OpsWrapper<GenericGraph<u16, ArcTermFactory>>; let g = MyGraph::new();
Modules
small | Flavours of Graph implementations with a smaller memory-footprint. |
sync | Flavours of Graph implementations which are safe to share across threads. |
Structs
HashGraph | A generic implementation of |
OpsWrapper | A |
SpoWrapper | A |
TermIndexMapU | An in-memory implemention of |
Traits
GraphWrapper | A graph wrapper wraps a |
IndexedGraphWrapper | An indexed graph wrapper wraps an |
Unsigned | This trait is used by |
Type Definitions
FastGraph | A heavily indexed graph. Fast to query but slow to load, with a relatively high memory footprint. |
GenericGraph | A generic in-memory graph. |
LightGraph | A graph with no triple index. Fast to load but slow to query, with a relatively low memory footprint. |