Search in sources :

Example 21 with NodeTable

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

the class TDB2StorageBuilder method buildPrefixTable.

private StoragePrefixesTDB buildPrefixTable(NodeTable prefixNodes) {
    String primary = params.getPrimaryIndexPrefix();
    String[] indexes = params.getPrefixIndexes();
    TupleIndex[] prefixIndexes = makeTupleIndexes(primary, indexes);
    if (prefixIndexes.length != 1)
        error(log, "Wrong number of triple table tuples indexes: " + prefixIndexes.length);
    // No cache - the prefix mapping is a cache
    // NodeTable prefixNodes = makeNodeTable(location, pnNode2Id, pnId2Node, -1, -1, -1);
    NodeTupleTable prefixTable = new NodeTupleTableConcrete(primary.length(), prefixIndexes, prefixNodes);
    StoragePrefixesTDB x = new StoragePrefixesTDB(txnSystem, prefixTable);
    // DatasetPrefixesTDB prefixes = new DatasetPrefixesTDB(prefixTable);
    log.debug("Prefixes: " + primary + " :: " + String.join(",", indexes));
    return x;
}
Also used : NodeTupleTable(org.apache.jena.tdb2.store.nodetupletable.NodeTupleTable) NodeTupleTableConcrete(org.apache.jena.tdb2.store.nodetupletable.NodeTupleTableConcrete) TupleIndex(org.apache.jena.tdb2.store.tupletable.TupleIndex)

Example 22 with NodeTable

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

the class TestNodeTableStored method createEmptyNodeTable.

@Override
protected NodeTable createEmptyNodeTable() {
    FileOps.ensureDir(location.getDirectoryPath());
    FileOps.clearDirectory(location.getDirectoryPath());
    StoreParams params = StoreParamsBuilder.create().nodeId2NodeCacheSize(10).node2NodeIdCacheSize(10).nodeMissCacheSize(10).build();
    return BuildTestLib.makeNodeTable(location, "test", params);
}
Also used : StoreParams(org.apache.jena.tdb2.params.StoreParams)

Example 23 with NodeTable

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

the class DataToTuples 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 24 with NodeTable

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

the class DataToTuples method nodes.

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

Example 25 with NodeTable

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

the class DataToTuplesInlineSingle 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)

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