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

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


                gnid = nt.getNodeIdForNode(gn) ;
                if ( NodeId.isDoesNotExist(gnid) )
                Log.warn(tdbstats.class, "No such graph: "+gn) ;
            }
               
            NodeTupleTable ntt = dsg.getQuadTable().getNodeTupleTable() ;
            Iterator<Tuple<NodeId>> iter = unionGraph
                ? SolverLib.unionGraph(ntt)
                : ntt.find(gnid, null, null, null) ;
            for ( ; iter.hasNext(); )
            {
                Tuple<NodeId> t = iter.next() ;
                stats.record(t.get(0), t.get(1), t.get(2), t.get(3)) ;
            }
View Full Code Here


    public static QueryIterator execute(GraphTDB graph, BasicPattern pattern,
                                        QueryIterator input, Filter<Tuple<NodeId>> filter,
                                        ExecutionContext execCxt)
    {
        // Maybe default graph or named graph.
        NodeTupleTable ntt = graph.getNodeTupleTable() ;
        return execute(ntt, graph.getGraphName(), pattern, input, filter, execCxt) ;
    }
View Full Code Here

     */
    public static QueryIterator execute(DatasetGraphTDB ds, Node graphNode, BasicPattern pattern,
                                        QueryIterator input, Filter<Tuple<NodeId>> filter,
                                        ExecutionContext execCxt)
    {
        NodeTupleTable ntt = ds.chooseNodeTupleTable(graphNode) ;
        return execute(ntt, graphNode, pattern, input, filter, execCxt) ;
    }
View Full Code Here

                                                 Filter<Tuple<NodeId>> filter, ExecutionContext execCxt) {
        NodeId nid = TDBInternal.getNodeId(ds, graphNode) ;
        boolean exists = !NodeId.isDoesNotExist(nid) ;
        if ( exists ) {
            // Node exists but is it used in the quad position?
            NodeTupleTable ntt = ds.getQuadTable().getNodeTupleTable() ;
            // Don't worry about abortable - this iterator should be fast
            // (with normal indexing - at least one G???).
            // Either it finds a starting point, or it doesn't.  We are only
            // interested in the first .hasNext.
            Iterator<Tuple<NodeId>> iter1 = ntt.find(nid, NodeId.NodeIdAny, NodeId.NodeIdAny, NodeId.NodeIdAny) ;
            if ( filter != null )
                iter1 = Iter.filter(iter1, filter) ;
            exists = iter1.hasNext() ;
        }
View Full Code Here

        NodeTableBuilder(DatasetGraphTDB dsg, ProgressLogger monitor, OutputStream outputTriples, OutputStream outputQuads)
        {
            this.dsg = dsg ;
            this.monitor = monitor ;
            NodeTupleTable ntt = dsg.getTripleTable().getNodeTupleTable() ;
            this.nodeTable = ntt.getNodeTable() ;
            this.writerTriples = new WriteRows(outputTriples, 3, 20000) ;
            this.writerQuads = new WriteRows(outputQuads, 4, 20000) ;
            this.stats = new StatsCollectorNodeId(nodeTable) ;
        }
View Full Code Here

    /** Non-reordering execution of a basic graph pattern, given a iterator of bindings as input */
    public static QueryIterator execute(GraphTDB graph, BasicPattern pattern,
                                        QueryIterator input, Filter<Tuple<NodeId>> filter,
                                        ExecutionContext execCxt)
    {
        NodeTupleTable ntt = graph.getNodeTupleTable() ;
        return execute(ntt, null, pattern, input, filter, execCxt) ;
    }
View Full Code Here

       
        // Delete in batches.
        // That way, there is no active iterator when a delete
        // from the indexes happens.
       
        NodeTupleTable t = g.getNodeTupleTable() ;
        Node gn = g.getGraphNode() ;
       
        @SuppressWarnings("unchecked")
        Tuple<NodeId>[] array = (Tuple<NodeId>[])new Tuple<?>[sliceSize] ;
       
        while (true)
        {
            // Convert/cache s,p,o?
            // The Node Cache will catch these so don't worry unduely.
            Iterator<Tuple<NodeId>> iter = null ;
            if ( gn == null )
                iter = t.findAsNodeIds(s, p, o) ;
            else
                iter = t.findAsNodeIds(gn, s, p, o) ;
           
            if ( iter == null )
                // Finished?
                return ;
           
            // Get a slice
            int len = 0 ;
            for ( ; len < sliceSize ; len++ )
            {
                if ( !iter.hasNext() ) break ;
                array[len] = iter.next() ;
            }
           
            // Delete them.
            for ( int i = 0 ; i < len ; i++ )
            {
                t.getTupleTable().delete(array[i]) ;
                array[i] = null ;
            }
            // Finished?
            if ( len < sliceSize )
                break ;
View Full Code Here

        loadTriples$(dest, input) ;
    }

    private static BulkStreamRDF destinationDefaultGraph(DatasetGraphTDB dsg, boolean showProgress)
    {
        NodeTupleTable ntt = dsg.getTripleTable().getNodeTupleTable() ;
        return destinationGraph(dsg, ntt, showProgress) ;
    }
View Full Code Here

    private static BulkStreamRDF destinationNamedGraph(DatasetGraphTDB dsg, Node graphName, boolean showProgress)
    {
        if ( graphName == null )
            return destinationDefaultGraph(dsg,showProgress) ;
       
        NodeTupleTable ntt = dsg.getQuadTable().getNodeTupleTable() ;
        NodeTupleTable ntt2 = new NodeTupleTableView(ntt, graphName) ;
        return destinationGraph(dsg, ntt2, showProgress) ;
    }
View Full Code Here

        NodeTableBuilder(DatasetGraphTDB dsg, ProgressLogger monitor, OutputStream outputTriples, OutputStream outputQuads)
        {
            this.dsg = dsg ;
            this.monitor = monitor ;
            NodeTupleTable ntt = dsg.getTripleTable().getNodeTupleTable() ;
            this.nodeTable = ntt.getNodeTable() ;
            this.writerTriples = new WriteRows(outputTriples, 3, 20000) ;
            this.writerQuads = new WriteRows(outputQuads, 4, 20000) ;
            this.stats = new StatsCollectorNodeId() ;
        }
View Full Code Here

TOP

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

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.