Package com.hp.hpl.jena.sdb.store

Examples of com.hp.hpl.jena.sdb.store.TupleLoader


        in = new FileInputStream("T.sse") ;
        Item x = SSE.parse(in) ;
        TransGraphNode tg = TransGraphNode.build(x) ;

        Store store = makeMemHash() ;
        TupleLoader loader = new TupleLoaderOneHash(store.getConnection()) ;

        // ---- Config
        String tableName = "classes" ;

        // ---- Load auxillary table
        String subColName = "sub" ;
        String superColName = "super" ;
        TableDesc tableDesc = new TableDesc(tableName, subColName, superColName) ;
        TupleTable tuples = new TupleTable(store, tableDesc) ;
       
        // ---- Create auxillary table
       
        String colType = store.getNodeTableDesc().getNodeRefTypeString() ;
        try {
            String sqlCreateStr =
                String.format("CREATE TABLE %s ( sub %s not null, super %s not null )",
                              tableName, colType, colType) ;
            store.getConnection().execUpdate(sqlCreateStr) ;
        } catch (SQLException ex) { throw new SDBExceptionSQL(ex) ; }
       
        loader.setTableDesc(tableDesc) ;
       
        loader.start() ;
        for (Pair<Node, Node> p : tg )
            loader.load(p.getLeft(), p.getRight()) ;
        loader.finish() ;
       
        // ---- Dump it.
        tuples.dump() ;
        store.close() ;
    }
View Full Code Here


   
    static StoreLoader loaderSimple(SDBConnection connection)
    {
        // Temporary - simple loader for development.
        //new LoaderTuplesNodes(connection, TupleLoaderHashDerby.class),
        TupleLoader tLoader = new TupleLoaderOneHash(connection, new TableDescTriples()) ;
        StoreLoader sLoader = new TupleGraphLoader(tLoader) ;
        return sLoader ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sdb.store.TupleLoader

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.