Examples of SqlNode


Examples of com.hp.hpl.jena.sdb.core.sqlnode.SqlNode

    }
   
    @Override
    protected void buildValues()
    {
        SqlNode sqlNode = getSqlNode() ;
        for ( Var v : getProject() )
            sqlNode = insertValueGetter(request, sqlNode, v) ;
        setSqlNode(sqlNode) ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.sdb.core.sqlnode.SqlNode

        nTable.setValueColumnForVar(var, c2) ;
        // Condition for value: triple table column = node table id/hash
        nTable.addNote("Var: "+var) ;

        SqlExpr cond = new S_Equal(c1, c2) ;
        SqlNode n = SqlBuilder.leftJoin(request, sqlNode, nTable, cond) ;
        return n ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.sdb.core.sqlnode.SqlNode

                // All variables.
                Collection<Var> tmp = OpVars.visibleVars(opSQL.getOriginal()) ;
                projectVars = new ArrayList<Var>(tmp) ;
            }

            SqlNode sqlNode = opSQL.getSqlNode() ;
           
            SQLBridgeFactory f = request.getStore().getSQLBridgeFactory() ;
           
            SQLBridge bridge = f.create(request, sqlNode, projectVars) ;
            bridge.build();
View Full Code Here

Examples of com.hp.hpl.jena.sdb.core.sqlnode.SqlNode

        }

        private Op transformSlice(OpSlice opSlice, OpSQL opSQL)
        {
            // (slice X)
            SqlNode sqlSubOp = opSQL.getSqlNode() ;
            SqlNode n = SqlSelectBlock.slice(request, sqlSubOp, opSlice.getStart(), opSlice.getLength()) ;
            OpSQL x = new OpSQL(n, opSlice, request) ;
            x.setBridge(opSQL.getBridge()) ;
            return x ;
        }
View Full Code Here

Examples of com.hp.hpl.jena.sdb.core.sqlnode.SqlNode

            if ( ! SDB_QC.isOpSQL(subOp) )
                // Can't cope - just pass the slice to the general superclass.
                return super.transform(opSlice, opProject) ;

            OpSQL opSQL = (OpSQL)subOp ;
            SqlNode sqlSubOp = opSQL.getSqlNode() ;
            List<Var> pv = opProject.getVars() ;
            // Do as (slice X)
            SqlNode n = SqlSelectBlock.slice(request, sqlSubOp, opSlice.getStart(), opSlice.getLength()) ;
            // Put back project - as an OpProject to leave for the bridge.
            OpSQL x = new OpSQL(n, opProject, request) ;
            x.setBridge(opSQL.getBridge()) ;
            // Bridge will be set later.
            // Is OpProject needed?
View Full Code Here

Examples of com.hp.hpl.jena.sdb.core.sqlnode.SqlNode

            if ( ! request.DistinctTranslation )
                return super.transform(opDistinct, subOp) ;
           
            if ( ! SDB_QC.isOpSQL(subOp) )
                return super.transform(opDistinct, subOp) ;
            SqlNode sqlSubOp = ((OpSQL)subOp).getSqlNode() ;
            SqlNode n = SqlSelectBlock.distinct(request, sqlSubOp) ;
            return new OpSQL(n, opDistinct, request) ;
        }
View Full Code Here

Examples of com.hp.hpl.jena.sdb.core.sqlnode.SqlNode

public class SqlStageList extends ArrayList<SqlStage>
{
    public SqlNode build(SDBRequest request, SlotCompiler slotCompiler)
    {
        SqlNode sqlNode = null ;
        // See QuadCompilerBase.compile
        for ( SqlStage s : this )
        {
            SqlNode sNode = s.build(request, slotCompiler) ;
            if ( sNode != null )
                sqlNode = SqlBuilder.innerJoin(request, sqlNode, sNode) ;
        }
       
        return sqlNode ;
View Full Code Here

Examples of com.hp.hpl.jena.sdb.core.sqlnode.SqlNode

    @Override
    public Op transform(OpQuadPattern quadPattern)
    {
        QuadBlock qBlk = new QuadBlock(quadPattern) ;
        SqlNode node = quadBlockCompiler.compile(qBlk) ;
        return new OpSQL(node, quadPattern, request) ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.sdb.core.sqlnode.SqlNode

        if ( true )
            return super.transform(opJoin, left, right) ;
       
        if ( ! SDB_QC.isOpSQL(left) || ! SDB_QC.isOpSQL(right) )
            return super.transform(opJoin, left, right) ;
        SqlNode sqlLeft = ((OpSQL)left).getSqlNode() ;
        SqlNode sqlRight = ((OpSQL)right).getSqlNode() ;
       
        // This is wrong.  If right is more than single triple pattern,
        // the generated SQL wil attempt to use NodeTable lookups from the
        // LHS but they are out of scope.
       
View Full Code Here

Examples of com.hp.hpl.jena.sdb.core.sqlnode.SqlNode

        // Condition(s) in the left join.  Punt for now.
        if ( opJoin.getExprs() != null )
            return super.transform(opJoin, left, right) ;
       
        SqlNode sqlLeft = ((OpSQL)left).getSqlNode() ;
        SqlNode sqlRight = ((OpSQL)right).getSqlNode() ;
       
        // Check for coalesce.
        // Do optional variables on the right appear only as optional variables on the left?

        Set<ScopeEntry> scopes = sqlLeft.getIdScope().findScopes() ;
       
        // Find optional-on-left
        Set<ScopeEntry> scopes2 = toSet(filter(scopes, ScopeEntry.OptionalFilter)) ;
        Set<Var> leftOptVars = toSet(map(scopes2, ScopeEntry.ToVar)) ;              // Vars from left optionals.
       
        if ( false )
        {
            Iter<ScopeEntry> iter = Iter.iter(scopes) ;
            Set<Var> leftOptVars_ = iter.filter(ScopeEntry.OptionalFilter).map(ScopeEntry.ToVar).toSet() ;
        }
       
        // Find optional-on-right (easier - it's all variables)
        Set<Var> rightOptVars = sqlRight.getIdScope().getVars() ;
       
        // And finally, calculate the intersection of the two.
        // SetUtils extension - one side could be an iterator 
        Set<Var> coalesceVars = intersection(leftOptVars, rightOptVars) ;
       
        // Future simplification : LeftJoinClassifier.nonLinearVars
//        if ( ! coalesceVars.equals(LeftJoinClassifier.nonLinearVars( opJoin.getLeft(), opJoin.getRight() )) )
//        { unexpected }
       
        if ( coalesceVars.size() > )
        {
            String alias = request.genId(AliasesSql.CoalesceAliasBase) ;
            SqlNode sqlNode = SqlBuilder.leftJoinCoalesce(request, alias,
                                                  sqlLeft, sqlRight,
                                                  coalesceVars) ;
            return new OpSQL(sqlNode, opJoin, request) ;
           
            // Punt
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.