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

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


    /** 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) ;
        return getNode(dsg, nodeId) ;
    }
View Full Code Here


    @Override
    protected void exec()
    {
        // This formats the location correctly.
        // But we're not really interested in it all.
        DatasetGraphTDB dsg = DatasetBuilderStd.build(location) ;
       
        // so close indexes and the prefix table.
        dsg.getTripleTable().getNodeTupleTable().getTupleTable().close();
        dsg.getQuadTable().getNodeTupleTable().getTupleTable().close();
        // Later - attach prefix table to parser.
        dsg.getPrefixes().close() ;
       
        ProgressLogger monitor = new ProgressLogger(cmdLog, "Data", BulkLoader.DataTickPoint,BulkLoader.superTick) ;
        OutputStream outputTriples = null ;
        OutputStream outputQuads = null ;
       
        try {
            outputTriples = new FileOutputStream(dataFileTriples) ;
            outputQuads = new FileOutputStream(dataFileQuads) ;
        }
        catch (FileNotFoundException e) { throw new AtlasException(e) ; }
       
        NodeTableBuilder sink = new NodeTableBuilder(dsg, monitor, outputTriples, outputQuads) ;
        monitor.start() ;
        sink.startBulk() ;
        for( String filename : datafiles)
        {
            if ( datafiles.size() > 0 )
                cmdLog.info("Load: "+filename+" -- "+Utils.nowAsString()) ;
            RiotReader.parse(filename, sink) ;
        }
        sink.finishBulk() ;
        IO.close(outputTriples) ;
        IO.close(outputQuads) ;
       
        // ---- Stats
       
        // See Stats class.
        if ( ! location.isMem() )
            Stats.write(dsg.getLocation().getPath(Names.optStats), sink.getCollector().results()) ;
       
        // ---- Monitor
        long time = monitor.finish() ;

        long total = monitor.getTicks() ;
View Full Code Here

        {
            // doingDynamicDatasetBySpecialDataset => done earlier.
            op = A2.unionDefaultGraphQuads(op) ;
            // Rewrite so that any explicitly named "default graph" is union graph.
            // And set the default graph to be the union graph as well.
            DatasetGraphTDB ds = ((DatasetGraphTDB)dsg).duplicate() ;
            ds.setEffectiveDefaultGraph(new GraphNamedTDB(ds, Quad.unionGraph)) ;
            Explain.explain("REWRITE(Union default graph)", op, context) ;
            dsg = ds ;
        }
        QueryIterator results = super.eval(op, dsg, input, context) ;
        results = new QueryIteratorMaterializeBinding(results) ;
View Full Code Here

            return ;
       
        if ( ! sConn.haveUsedInTransaction() && get() != null )
        {
            // Non-transactional behaviour.
            DatasetGraphTDB dsg = get() ;
            dsg.sync() ;
            dsg.close() ;
            StoreConnection.release(dsg.getLocation()) ;
            isClosed = true ;
            return ;
        }
       
        if ( isInTransaction() )
View Full Code Here

        this.blockMgrs = dsg.getConfig().blockMgrs ;
        this.nodeTables = dsg.getConfig().nodeTables ;
        this.txn = transaction ;
        this.dsg = dsg ;
       
        DatasetGraphTDB dsgTDB ;
           
        switch(mode)
        {
            case READ : dsgTDB = buildReadonly() ; break ;
            case WRITE : dsgTDB = buildWritable() break ;
View Full Code Here

    private DatasetGraphTDB buildReadonly()
    {
        BlockMgrBuilder blockMgrBuilder = new BlockMgrBuilderReadonly() ;
        NodeTableBuilder nodeTableBuilder = new NodeTableBuilderReadonly() ;
        DatasetBuilderStd x = new DatasetBuilderStd(blockMgrBuilder, nodeTableBuilder) ;
        DatasetGraphTDB dsg2 = x._build(dsg.getLocation(), dsg.getConfig().params, false, dsg.getReorderTransform()) ;
       
        return dsg2 ;
    }
View Full Code Here

    private DatasetGraphTDB buildWritable()
    {
        BlockMgrBuilder blockMgrBuilder = new BlockMgrBuilderTx() ;
        NodeTableBuilder nodeTableBuilder = new NodeTableBuilderTx() ;
        DatasetBuilderStd x = new DatasetBuilderStd(blockMgrBuilder, nodeTableBuilder) ;
        DatasetGraphTDB dsg2 = x._build(dsg.getLocation(), dsg.getConfig().params, true, dsg.getReorderTransform()) ;
        dsg2.getContext().putAll(dsg.getContext()) ;
        return dsg2 ;
    }
View Full Code Here

    public final static RecordFactory nodeRecordFactory = new RecordFactory(LenNodeHash, SizeOfNodeId) ;
   
    /** Create a TDB graph using a specifc index builder - mainly for testing */
    public static GraphTriplesTDB createGraph(IndexBuilder indexBuilder, Location location)
    {
        DatasetGraphTDB ds = _createDatasetGraph(indexBuilder, location, tripleIndexes, quadIndexes) ;
        return (GraphTriplesTDB)ds.getDefaultGraph() ;
   
View Full Code Here

        NodeTable nodeTable = NodeTableFactory.create(indexBuilder, location) ;
        TripleTable triples = createTripleTable(indexBuilder, nodeTable, location, graphIndexDesc, policy) ;
        QuadTable quads = createQuadTable(indexBuilder, nodeTable, location, quadIndexDesc, policy) ;
        @SuppressWarnings("deprecation")
        DatasetPrefixesTDB prefixes = DatasetPrefixesTDB.create(indexBuilder, location, policy) ;
        return new DatasetGraphTDB(triples, quads, prefixes, chooseOptimizer(location), null) ;
    }
View Full Code Here

    @Override
    protected void exec()
    {
        // This formats the location correctly.
        // But we're not really interested in it all.
        DatasetGraphTDB dsg = DatasetBuilderStd.build(location) ;
       
        // so close indexes and the prefix table.
        dsg.getTripleTable().getNodeTupleTable().getTupleTable().close();
        dsg.getQuadTable().getNodeTupleTable().getTupleTable().close();
        // Later - attach prefix table to parser.
        dsg.getPrefixes().close() ;
       
        ProgressLogger monitor = new ProgressLogger(cmdLog, "Data", BulkLoader.DataTickPoint,BulkLoader.superTick) ;
        OutputStream outputTriples = null ;
        OutputStream outputQuads = null ;
       
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.