Package com.hp.hpl.jena.sdb.layout2.index

Examples of com.hp.hpl.jena.sdb.layout2.index.SlotCompilerIndex


        }
       
        // ---- Choose the table to access
        // The default graph table may be a specialized table (e.g. triples, not quads).
       
        TableDescQuads tableDesc = null ;
        String alias = null ;
       
        if ( accessStoredDefaultGraph )
        {
            tableDesc = request.getStore().getTripleTableDesc() ;
            alias = request.genId(AliasesSql.TriplesTableBase) ;
        }
        else
        {
            tableDesc = request.getStore().getQuadTableDesc() ;
            alias = request.genId(AliasesSql.QuadTableBase) ;
        }
       
        SqlTable table = new SqlTable(alias, tableDesc.getTableName()) ;
        if ( accessStoredDefaultGraph )
            table.addNote(FmtUtils.stringForTriple(quad.asTriple(), request.getPrefixMapping())) ;
        else
            table.addNote(FmtUtils.stringForQuad(quad, request.getPrefixMapping())) ;

        // Only constrain the G column
        // IF there is a graph column (so it's not the triples table)
        // AND if we are not unioning the named graphs.
       
        if ( ! accessStoredDefaultGraph && ! accessUnionGraph )
                slotCompiler.processSlot(request, table, conditions, quad.getGraph(),
                                     tableDesc.getGraphColName()) ;
        slotCompiler.processSlot(request, table, conditions, quad.getSubject(),
                                 tableDesc.getSubjectColName()) ;
        slotCompiler.processSlot(request, table, conditions, quad.getPredicate(),
                                 tableDesc.getPredicateColName()) ;
        slotCompiler.processSlot(request, table, conditions, quad.getObject(),
                                 tableDesc.getObjectColName()) ;
       
        return SqlBuilder.restrict(request, table, conditions) ;
    }
View Full Code Here


    {
        super(connection, desc,
              new FmtLayout2IndexHSQL(connection),
              new LoaderTuplesNodes(connection, TupleLoaderIndexHSQL.class),
              new QueryCompilerFactoryIndex(),
              new SQLBridgeFactory2(), new TableDescTriples(), new TableDescQuads(), new TableNodesIndex()) ;
       
        ((LoaderTuplesNodes) this.getLoader()).setStore(this);
    }
View Full Code Here

              //new LoaderHashHSQL(connection),
              new LoaderTuplesNodes(connection, TupleLoaderHashHSQL.class),
              new QueryCompilerFactoryHash(),
              new SQLBridgeFactory2(),
              new TableDescTriples(),
              new TableDescQuads(),
              new TableNodesHash()) ;
       
        ((LoaderTuplesNodes) this.getLoader()).setStore(this);
    }
View Full Code Here

    }
   
    @Override
    protected void formatTableQuads()
    {
        TableDescQuads desc = new TableDescQuads() ;
        dropTable(desc.getTableName()) ;
        try {
            String x = sqlStr(
                              "CREATE TABLE %s (",
                              "    %2$s int NOT NULL,",
                              "    %3$s int NOT NULL,",
                              "    %4$s int NOT NULL,",
                              "    %5$s int NOT NULL,",
                              "    PRIMARY KEY (%2$s, %3$s, %4$s, %5$s)",
                              ")") ;
            x = String.format(x, desc.getTableName(),
                          desc.getGraphColName(),
                              desc.getSubjectColName(),
                              desc.getPredicateColName(),
                              desc.getObjectColName()) ;
           
            connection().exec(sqlStr(
                                 "CREATE TABLE "+desc.getTableName()+" (",
                                 "    g int NOT NULL,",
                                 "    s int NOT NULL,",
                                 "    p int NOT NULL,",
                                 "    o int NOT NULL,",
                                 "    PRIMARY KEY (g, s, p, o)",
View Full Code Here

    public StoreBaseHash(SDBConnection connection, StoreDesc desc, StoreFormatter formatter, StoreLoader loader, QueryCompilerFactory compilerF, SQLBridgeFactory sqlBridgeF, SQLGenerator sqlGenerator)
    {
        super(connection, desc,
              formatter, loader, compilerF, sqlBridgeF, sqlGenerator,
              new TableDescTriples(),
              new TableDescQuads() ,
              new TableNodesHash()) ;
    }
View Full Code Here

        }
       
        // ---- Choose the table to access
        // The default graph table may be a specialized table (e.g. triples, not quads).
       
        TableDescQuads tableDesc = null ;
        String alias = null ;
       
        if ( accessStoredDefaultGraph )
        {
            tableDesc = request.getStore().getTripleTableDesc() ;
            alias = request.genId(AliasesSql.TriplesTableBase) ;
        }
        else
        {
            tableDesc = request.getStore().getQuadTableDesc() ;
            alias = request.genId(AliasesSql.QuadTableBase) ;
        }
       
        SqlTable table = new SqlTable(alias, tableDesc.getTableName()) ;
        if ( accessStoredDefaultGraph )
            table.addNote(FmtUtils.stringForTriple(quad.asTriple(), request.getPrefixMapping())) ;
        else
            table.addNote(FmtUtils.stringForQuad(quad, request.getPrefixMapping())) ;

        // Only constrain the G column
        // IF there is a graph column (so it's not the triples table)
        // AND if we are not unioning the named graphs.
       
        if ( ! accessStoredDefaultGraph && ! accessUnionGraph )
                slotCompiler.processSlot(request, table, conditions, quad.getGraph(),
                                     tableDesc.getGraphColName()) ;
        slotCompiler.processSlot(request, table, conditions, quad.getSubject(),
                                 tableDesc.getSubjectColName()) ;
        slotCompiler.processSlot(request, table, conditions, quad.getPredicate(),
                                 tableDesc.getPredicateColName()) ;
        slotCompiler.processSlot(request, table, conditions, quad.getObject(),
                                 tableDesc.getObjectColName()) ;
       
        return SqlBuilder.restrict(request, table, conditions) ;
    }
View Full Code Here

        if ( ! Var.isVar(g) )
            throw new SDBInternalError("OpDatasetNames - not a variable: "+g) ;
        Var v = Var.alloc(g) ;

        // Inner SELECT SQL: (SELECT DISTINCT g FROM Quads)
        TableDescQuads quads = request.getStore().getQuadTableDesc() ;
        SqlTable sqlTableQ = new SqlTable(quads.getTableName()) ;
        sqlTableQ.setIdColumnForVar(v, new SqlColumn(sqlTableQ, quads.getGraphColName())) ;
        SqlNode sqlNodeQ = SqlSelectBlock.distinct(request, sqlTableQ) ;
       
        // Will have the value left join added later.
        return new OpSQL(sqlNodeQ, opDatasetNames, request) ;
    }
View Full Code Here

    public StoreBaseIndex(SDBConnection connection, StoreDesc desc, StoreFormatter formatter, StoreLoader loader, QueryCompilerFactory compilerF, SQLBridgeFactory sqlBridgeF, SQLGenerator sqlGenerator)
    {
        super(connection, desc,
              formatter, loader, compilerF, sqlBridgeF, sqlGenerator,
              new TableDescTriples(),
              new TableDescQuads(),
              new TableNodesIndex()) ;
    }
View Full Code Here

    {
        super(connection, desc,
              new FmtLayout2IndexHSQL(connection),
              new LoaderTuplesNodes(connection, TupleLoaderIndexHSQL.class),
              new QueryCompilerFactoryIndex(),
              new SQLBridgeFactory2(), new TableDescTriples(), new TableDescQuads(), new TableNodesIndex()) ;
       
        ((LoaderTuplesNodes) this.getLoader()).setStore(this);
    }
View Full Code Here

              new FmtLayout2HashHSQL(connection),
              //new LoaderHashHSQL(connection),
              new LoaderTuplesNodes(connection, TupleLoaderHashHSQL.class),
              new QueryCompilerFactoryHash(),
              new SQLBridgeFactory2(),
              new TableDescTriples(),
              new TableDescQuads(),
              new TableNodesHash()) ;
       
        ((LoaderTuplesNodes) this.getLoader()).setStore(this);
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sdb.layout2.index.SlotCompilerIndex

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.