Package com.hp.hpl.jena.tdb.nodetable

Examples of com.hp.hpl.jena.tdb.nodetable.NodeTable


       
    /** Create a filter to exclude the graph http://example/g2 */
    private static Filter<Tuple<NodeId>> createFilter(Dataset ds)
    {
        DatasetGraphTDB dsg = (DatasetGraphTDB)(ds.asDatasetGraph()) ;
        final NodeTable nodeTable = dsg.getQuadTable().getNodeTupleTable().getNodeTable() ;
        // Filtering operates at a very low level:
        // need to know the internal identifier for the graph name.
        final NodeId target = nodeTable.getNodeIdForNode(Node.createURI(graphToHide)) ;

        System.out.println("Hide graph: "+graphToHide+" --> "+target) ;
       
        // Filter for accept/reject as quad as being visible.
        // Return true for "accept", false for "reject"
View Full Code Here


    public static NodeId getNodeId(DatasetGraph ds, Node node)
    {
        DatasetGraphTDB dsg = getDatasetGraphTDB(ds) ;
        if ( dsg == null )
            return null ;
        NodeTable nodeTable = dsg.getQuadTable().getNodeTupleTable().getNodeTable() ;
        NodeId nodeId = nodeTable.getNodeIdForNode(node) ;
        return nodeId ;
    }
View Full Code Here

    public static Node getNode(DatasetGraph ds, NodeId nodeId)
    {
        DatasetGraphTDB dsg = getDatasetGraphTDB(ds) ;
        if ( dsg == null )
            return null ;
        NodeTable nodeTable = dsg.getQuadTable().getNodeTupleTable().getNodeTable() ;
        Node node = nodeTable.getNodeForNodeId(nodeId) ;
        return node ;
    }
View Full Code Here

public class DebugTDB
{
    public static NodeId lookup(DatasetGraphTDB dsg, Node n)
    {
        NodeTable nt = dsg.getTripleTable().getNodeTupleTable().getNodeTable() ;
        NodeId nid = nt.getNodeIdForNode(n) ;
        return nid ;
    }
View Full Code Here

        }
    }
   
    public static void dumpNodeTable(String label, DatasetGraphTDB dsg)
    {
        NodeTable nt1 = dsg.getTripleTable().getNodeTupleTable().getNodeTable() ;
        NodeTableLib.print(label, nt1) ;
    }
View Full Code Here

    {
        // See DatasetBuilderTxn - same name generation code.
        // [TxTDB:TODO]
       
        RecordFactory recordFactory = new RecordFactory(SystemTDB.LenNodeHash, SystemTDB.SizeOfNodeId) ;
        NodeTable baseNodeTable = dsg.getConfig().nodeTables.get(fileRef) ;
        String objFilename = fileRef.getFilename()+"-"+Names.extJournal ;
        objFilename = dsg.getLocation().absolute(objFilename) ;
        File jrnlFile = new File(objFilename) ;
        if ( jrnlFile.exists() && jrnlFile.length() > 0 )
        {
            syslog.info("Recovering node data: "+fileRef.getFilename()) ;
            ObjectFile dataJrnl = FileFactory.createObjectFileDisk(objFilename) ;
            NodeTableTrans ntt = new NodeTableTrans(null, objFilename, baseNodeTable, new IndexMap(recordFactory), dataJrnl) ;
            ntt.append() ;
            ntt.close() ;
            dataJrnl.close() ;
            baseNodeTable.sync() ;
        }
        if ( jrnlFile.exists() )
            FileOps.delete(objFilename) ;
    }
View Full Code Here

        List<String> quadIndexes = Arrays.asList(Names.quadIndexes) ;
        Location loc = modLocation.getLocation() ;
       
        StoreConnection sConn = StoreConnection.make(loc) ;
        DatasetGraphTDB dsg = sConn.getBaseDataset() ;
        NodeTable nodeTable = dsg.getQuadTable().getNodeTupleTable().getNodeTable() ;
        dump(System.out, nodeTable) ;
    }
View Full Code Here

                            String indexNode2Id, int node2NodeIdCacheSize,
                            String indexId2Node, int nodeId2NodeCacheSize, //

                            int sizeNodeMissCacheSize)
    {
        NodeTable nodeTable = SetupTDB.makeNodeTable(new Location(location),
                                                     indexNode2Id, node2NodeIdCacheSize,
                                                     indexId2Node, nodeId2NodeCacheSize,
                                                     sizeNodeMissCacheSize) ;
    }
View Full Code Here

            if ( 4 != tupleLen )
                throw new TDBException("SolverLib: Graph node specified but tuples are of length "+tupleLen) ;
        }
       
        // Convert from a QueryIterator (Bindings of Var/Node) to BindingNodeId
        NodeTable nodeTable = nodeTupleTable.getNodeTable() ;
       
        Iterator<BindingNodeId> chain = Iter.map(input, SolverLib.convFromBinding(nodeTable)) ;
        List<Abortable> killList = new ArrayList<Abortable>() ;
       
        for ( Triple triple : triples )
View Full Code Here

    }

    public static Set<NodeId> convertToNodeIds(Collection<Node> nodes, DatasetGraphTDB dataset)
    {
        Set<NodeId> graphIds = new HashSet<NodeId>() ;
        NodeTable nt = dataset.getQuadTable().getNodeTupleTable().getNodeTable() ;
        for ( Node n : nodes )
            graphIds.add(nt.getNodeIdForNode(n)) ;
        return graphIds ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.tdb.nodetable.NodeTable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.