Package com.hp.hpl.jena.tdb.store

Examples of com.hp.hpl.jena.tdb.store.NodeId


    }

    @Override
    public NodeId getAllocateNodeId(Node node)
    {
        NodeId nid = NodeId.create(id) ;
        id++ ;
        return nid ;
    }
View Full Code Here


        }

      
        private void process(Node g, Node s, Node p, Node o)
        {
            NodeId sId = nodeTable.getAllocateNodeId(s) ;
            NodeId pId = nodeTable.getAllocateNodeId(p) ;
            NodeId oId = nodeTable.getAllocateNodeId(o) ;
           
            if ( g != null )
            {
                NodeId gId = nodeTable.getAllocateNodeId(g) ;
                writerQuads.write(gId.getId()) ;
                writerQuads.write(sId.getId()) ;
                writerQuads.write(pId.getId()) ;
                writerQuads.write(oId.getId()) ;
                writerQuads.endOfRow() ;
                stats.record(gId, sId, pId, oId) ;
View Full Code Here

        {
            // Makes nodes immediately.  Causing unnecessary NodeTable accesses (e.g. project)
            BindingMap b = BindingFactory.create() ;
            for ( Var v : bindingNodeIds )
            {
                NodeId id = bindingNodeIds.get(v) ;
                Node n = nodeTable.getNodeForNodeId(id) ;
                b.add(v, n) ;
            }
            return b ;
        }
View Full Code Here

                        // Can occur with BindingProject
                        continue ;
                   
                    // Rely on the node table cache for efficency - we will likely be
                    // repeatedly looking up the same node in different bindings.
                    NodeId id = nodeTable.getNodeIdForNode(n) ;
                    // Even put in "does not exist" for a node now known not to be in the DB.
                    b.put(v, id) ;
                }
                return b ;
            }
View Full Code Here

        assertEquals(1, r.getCount()) ;
        assertEquals(1, r.getPredicates().keySet().size()) ;
    }

    @Test public void stats_02() {
        NodeId gid = nt.getNodeIdForNode(NodeFactory.createURI("g1")) ;
        StatsResults r = statsForGraph(gid) ;
        assertEquals(1, r.getCount()) ;
        assertEquals(1, r.getPredicates().keySet().size()) ;
    }
View Full Code Here

        assertEquals(1, r.getCount()) ;
        assertEquals(1, r.getPredicates().keySet().size()) ;
    }
   
    @Test public void stats_03() {
        NodeId gid = nt.getNodeIdForNode(NodeFactory.createURI("g2")) ;
        StatsResults r = statsForGraph(gid) ;
        assertEquals(2, r.getCount()) ;
        assertEquals(1, r.getPredicates().keySet().size()) ;
    }
View Full Code Here

    static void contains(NodeTable nt, Node...nodes)
    {
        for ( Node n : nodes)
        {
            NodeId nodeId = nt.getNodeIdForNode(n) ;
            assertFalse(NodeId.isDoesNotExist(nodeId)) ;
        }
    }
View Full Code Here

        NodeTableTrans ntt = create(txn) ;
        NodeTable nt0 = ntt.getBaseNodeTable() ;
       
        ntt.begin(txn) ;
        // Add a node
        NodeId nodeId = ntt.getAllocateNodeId(node1) ;
        // Check not in the base.
        assertNull(nt0.getNodeForNodeId(nodeId)) ;
        // Check is in the transaction node table.
        assertEquals(NodeId.NodeDoesNotExist, nt0.getNodeIdForNode(node1)) ;
        assertEquals(node1, ntt.getNodeForNodeId(nodeId)) ;
View Full Code Here

        NodeTableTrans ntt = create(txn) ;
        NodeTable nt0 = ntt.getBaseNodeTable() ;
        
        ntt.begin(txn) ;
        // Add a node
        NodeId nodeId = ntt.getAllocateNodeId(node1) ;
        // Check not in the base.
        assertEquals(NodeId.NodeDoesNotExist, nt0.getNodeIdForNode(node1)) ;
        assertNull(nt0.getNodeForNodeId(nodeId)) ;
        // Check is in the transaction node table.
        assertEquals(node1, ntt.getNodeForNodeId(nodeId)) ;
View Full Code Here

        Transaction txn = createTxn(11) ;
        NodeTableTrans ntt = create(txn, node1) ;
        NodeTable nt0 = ntt.getBaseNodeTable() ;
        ntt.begin(txn) ;
        // Add a node
        NodeId nodeId = ntt.getAllocateNodeId(node2) ;
        // Not here
        assertEquals(NodeId.NodeDoesNotExist, nt0.getNodeIdForNode(node2)) ;
        // Is here
        assertEquals(nodeId, ntt.getNodeIdForNode(node2)) ;
        ntt.commitPrepare(txn) ;
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.tdb.store.NodeId

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.