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

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


   
    /** Example setup - in-memory dataset with two graphs, one triple in each */
    private static Dataset setup()
    {
        Dataset ds = TDBFactory.createDataset() ;
        DatasetGraphTDB dsg = (DatasetGraphTDB)(ds.asDatasetGraph()) ;
        Quad q1 = SSE.parseQuad("(<http://example/g1> <http://example/s> <http://example/p> <http://example/o1>)") ;
        Quad q2 = SSE.parseQuad("(<http://example/g2> <http://example/s> <http://example/p> <http://example/o2>)") ;
        dsg.add(q1) ;
        dsg.add(q2) ;
        return ds ;
    }
View Full Code Here


    }
       
    /** 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) ;
View Full Code Here

     * Returns NodeId.NodeDoesNotExist when the node is not found.
     * Returns null when not a TDB-backed dataset.
     */
    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

    /** Return the node for a NodeId (if any).
     *  Returns null if the NodeId does not exist in the dataset.
     */
    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 static void replay(Transaction transaction)
    {
        if ( syslog.isDebugEnabled())
            syslog.debug("Replay "+transaction.getLabel()) ;
        Journal journal = transaction.getJournal() ;
        DatasetGraphTDB dsg = transaction.getBaseDataset() ;
        // Currently, we (crudely) replay the whole journal.
        replay(journal, dsg.getConfig()) ;
    }
View Full Code Here

        dsgW2.commit() ;
        dsgW2.end() ;
       
        sConn.forceRecoverFromJournal() ;
        DatasetGraphTDB dsg = sConn.getBaseDataset() ;
        assertTrue(dsg.contains(q1)) ;
        assertTrue(dsg.contains(q2)) ;
    }
View Full Code Here

        dsgW3.commit() ;
        dsgW3.end() ;

        dsgR1.end() ;
       
        DatasetGraphTDB dsg = sConn.getBaseDataset() ;
        assertTrue(dsg.contains(q1)) ;
        assertTrue(dsg.contains(q2)) ;
        assertTrue(dsg.contains(q3)) ;
    }
View Full Code Here

    }

    @Override
    protected void exec()
    {
        DatasetGraphTDB dsg = super.getDatasetGraphTDB() ;
        // Just creating the DSG does a recovery so this is not (currently) necessary:
        // This may change (not immediately recovering on start up).
        JournalControl.recovery(dsg) ;
    }
View Full Code Here

        List<String> tripleIndexes = Arrays.asList(Names.tripleIndexes) ;
        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

       
        // (filter (quadpattern ...))
        if ( opFilter.getSubOp() instanceof OpQuadPattern )
        {
            OpQuadPattern quadPattern = (OpQuadPattern)opFilter.getSubOp() ;
            DatasetGraphTDB ds = (DatasetGraphTDB)execCxt.getDataset() ;
            return optimizeExecuteQuads(ds, input,
                                        quadPattern.getGraphNode(), quadPattern.getBasicPattern(),
                                        opFilter.getExprs(), execCxt) ;
        }
   
View Full Code Here

TOP

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

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.