Search in sources :

Example 31 with NodeTable

use of org.apache.jena.tdb2.store.nodetable.NodeTable in project jena by apache.

the class LoaderOps method ntBPTree.

/**
 * Get the BPlusTree index for a {@Link NodeTable}
 */
public static BPlusTree ntBPTree(NodeTable nt) {
    NodeTableTRDF ntt = (NodeTableTRDF) (nt.baseNodeTable());
    Index idx = ntt.getIndex();
    return (BPlusTree) idx;
}
Also used : NodeTableTRDF(org.apache.jena.tdb2.store.nodetable.NodeTableTRDF) RangeIndex(org.apache.jena.dboe.index.RangeIndex) TupleIndex(org.apache.jena.tdb2.store.tupletable.TupleIndex) Index(org.apache.jena.dboe.index.Index) BPlusTree(org.apache.jena.dboe.trans.bplustree.BPlusTree)

Example 32 with NodeTable

use of org.apache.jena.tdb2.store.nodetable.NodeTable in project jena by apache.

the class LoaderOps method ntDataFile.

/**
 * Get the node storage for a {@Link NodeTable}
 */
public static TransBinaryDataFile ntDataFile(NodeTable nt) {
    NodeTableTRDF ntt = (NodeTableTRDF) (nt.baseNodeTable());
    BinaryDataFile bdf = ntt.getData();
    TransBinaryDataFile tbdf = (TransBinaryDataFile) bdf;
    return tbdf;
}
Also used : NodeTableTRDF(org.apache.jena.tdb2.store.nodetable.NodeTableTRDF) TransBinaryDataFile(org.apache.jena.dboe.trans.data.TransBinaryDataFile) TransBinaryDataFile(org.apache.jena.dboe.trans.data.TransBinaryDataFile) BinaryDataFile(org.apache.jena.dboe.base.file.BinaryDataFile)

Example 33 with NodeTable

use of org.apache.jena.tdb2.store.nodetable.NodeTable in project jena by apache.

the class DataToTuplesInline method startBulk.

@Override
public void startBulk() {
    coordinator = CoLib.newCoordinator();
    CoLib.add(coordinator, nodeTable);
    // Prefixes
    NodeTupleTable p = prefixes.getNodeTupleTable();
    CoLib.add(coordinator, p.getNodeTable());
    CoLib.add(coordinator, p.getTupleTable().getIndexes());
    CoLib.start(coordinator);
    transaction = coordinator.begin(TxnType.WRITE);
}
Also used : NodeTupleTable(org.apache.jena.tdb2.store.nodetupletable.NodeTupleTable)

Example 34 with NodeTable

use of org.apache.jena.tdb2.store.nodetable.NodeTable in project jena by apache.

the class DataToTuplesInline method nodes.

private static Tuple<NodeId> nodes(NodeTable nt, Quad quad) {
    NodeId g = idForNode(nt, quad.getGraph());
    NodeId s = idForNode(nt, quad.getSubject());
    NodeId p = idForNode(nt, quad.getPredicate());
    NodeId o = idForNode(nt, quad.getObject());
    return TupleFactory.tuple(g, s, p, o);
}
Also used : NodeId(org.apache.jena.tdb2.store.NodeId)

Example 35 with NodeTable

use of org.apache.jena.tdb2.store.nodetable.NodeTable in project jena by apache.

the class NodeTableOps method bulkNodeIdToNodeImpl.

/**
 * Convert a bulk operation into a loop
 */
public static List<Node> bulkNodeIdToNodeImpl(NodeTable nt, List<NodeId> nodeIds) {
    List<Node> nodes = new ArrayList<>(nodeIds.size());
    for (NodeId nodeId : nodeIds) {
        Node n = nt.getNodeForNodeId(nodeId);
        nodes.add(n);
    }
    return nodes;
}
Also used : Node(org.apache.jena.graph.Node) ArrayList(java.util.ArrayList) NodeId(org.apache.jena.tdb2.store.NodeId)

Aggregations

NodeId (org.apache.jena.tdb2.store.NodeId)21 NodeTable (org.apache.jena.tdb2.store.nodetable.NodeTable)16 Node (org.apache.jena.graph.Node)14 Tuple (org.apache.jena.atlas.lib.tuple.Tuple)6 Quad (org.apache.jena.sparql.core.Quad)6 NodeTupleTable (org.apache.jena.tdb2.store.nodetupletable.NodeTupleTable)6 ArrayList (java.util.ArrayList)5 Triple (org.apache.jena.graph.Triple)5 NodeTableTRDF (org.apache.jena.tdb2.store.nodetable.NodeTableTRDF)5 Iterator (java.util.Iterator)3 Predicate (java.util.function.Predicate)3 RecordFactory (org.apache.jena.dboe.base.record.RecordFactory)3 Index (org.apache.jena.dboe.index.Index)3 RangeIndex (org.apache.jena.dboe.index.RangeIndex)3 Binding (org.apache.jena.sparql.engine.binding.Binding)3 TupleIndex (org.apache.jena.tdb2.store.tupletable.TupleIndex)3 Function (java.util.function.Function)2 Iter (org.apache.jena.atlas.iterator.Iter)2 InternalErrorException (org.apache.jena.atlas.lib.InternalErrorException)2 TupleFactory (org.apache.jena.atlas.lib.tuple.TupleFactory)2