Class GraphMem2Roaring

All Implemented Interfaces:
org.apache.jena.atlas.lib.Copyable<GraphMem2>, Graph, GraphWithPerform

public class GraphMem2Roaring extends GraphMem2
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.

  • Constructor Details

    • GraphMem2Roaring

      public GraphMem2Roaring()
  • Method Details

    • copy

      public GraphMem2Roaring 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.
      Specified by:
      copy in interface org.apache.jena.atlas.lib.Copyable<GraphMem2>
      copy in class GraphMem2
      independent copy of the current graph