java.lang.Object
org.apache.jena.graph.impl.GraphBase
org.apache.jena.mem.GraphMemBase
org.apache.jena.mem2.GraphMem2
org.apache.jena.mem2.GraphMem2Roaring
- All Implemented Interfaces:
org.apache.jena.atlas.lib.Copyable<GraphMem2>
,Graph
,GraphWithPerform
A graph that stores triples in memory. This class is not thread-safe.
Purpose: GraphMem2Roaring is ideal for handling extremely large graphs. If you frequently work with such massive data structures, this implementation could be your top choice.
Graph#contains is faster than GraphMem2Fast
.
Removing triples is a bit slower than GraphMem2Legacy
.
Better performance than GraphMem2Fast for operations with triple matches for the pattern S_O, SP_, and _PO on
large graphs,due to bit-operations to find intersecting triples.
Memory consumption is about 7-99% higher than GraphMem2Legacy
Suitable for really large graphs like bsbm-5m.nt.gz, bsbm-25m.nt.gz, and possibly even larger.
Simple and straightforward implementation.
No heritage of GraphMem.
Internal structure:
- One indexed hash set (same as GraphMem2Fast uses) that holds all triples.
- Three hash maps indexed by subjects, predicates, and objects with RoaringBitmaps as values.
- The bitmaps contain the indices of the triples in the central hash set.
-
Field Summary
Fields inherited from class org.apache.jena.graph.impl.GraphBase
TOSTRING_TRIPLE_BASE, TOSTRING_TRIPLE_LIMIT
Fields inherited from interface org.apache.jena.graph.Graph
emptyGraph
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.jena.mem2.GraphMem2
clear, destroy, getCapabilities, graphBaseContains, graphBaseFind, graphBaseSize, performAdd, performDelete, stream, stream
Methods inherited from class org.apache.jena.mem.GraphMemBase
close, openAgain
Methods inherited from class org.apache.jena.graph.impl.GraphBase
add, contains, contains, delete, dependsOn, find, find, forTestingOnly_graphBaseFind, getEventManager, getPrefixMapping, getTransactionHandler, isClosed, isEmpty, isIsomorphicWith, notifyAdd, notifyDelete, remove, size, toString, toString
-
Constructor Details
-
GraphMem2Roaring
public GraphMem2Roaring()
-
-
Method Details
-
copy
Description copied from class:GraphMem2
Creates a copy of this graph. Since the triples and nodes are immutable, the copy contains the same triples and nodes as this graph. Modifications to the copy will not affect this graph.
-