Package com.hp.hpl.jena.sparql.engine.iterator

Examples of com.hp.hpl.jena.sparql.engine.iterator.QueryIterNullIterator


   * if optimization is possible (e.g., the relation is empty).
   * @return A query iterator over the contents of the node relation
   */
  public static QueryIterator create(NodeRelation table, ExecutionContext execCxt) {
    if (table.baseRelation().condition().isFalse()) {
      return new QueryIterNullIterator(execCxt);
    }
    if (table.baseRelation().isTrivial()) {
      return QueryIterSingleton.create(
          BindingMaker.createFor(table).makeBinding(ResultRow.NO_ATTRIBUTES),
          execCxt);
View Full Code Here


public class IterLib
{
    public static QueryIterator noResults(ExecutionContext execCxt)
    {
        return new QueryIterNullIterator(execCxt) ;
    }
View Full Code Here

    { }
   
    @Override
    public QueryIterator iterator(ExecutionContext execCxt)
    {
        return new QueryIterNullIterator(execCxt) ;
    }
View Full Code Here

    {
        if ( includeOnNoMatch )
            return QueryIterSingleton.create(bindingLeft, execContext) ;
        else
            // No rows - no match
            return new QueryIterNullIterator(execContext) ;
    }
View Full Code Here

               
        if ( out.size() == 0 && includeOnNoMatch )
            out.add(bindingLeft) ;
       
        if ( out.size() == 0 )
            return new QueryIterNullIterator(execContext) ;
        return new QueryIterPlainWrapper(out.iterator(), execContext) ;
    }
View Full Code Here

            if ( conditions != null )
                matches = conditions.isSatisfied(bindingLeft, execContext) ;
        }
       
        if ( ! matches && ! includeOnNoMatch)
            return new QueryIterNullIterator(execContext) ;
        // Matches, or does not match and it's a left join - return the left binding.
        return QueryIterSingleton.create(bindingLeft, execContext) ;
    }
View Full Code Here

        Node nodeVar = argSubject.getArg() ;
        String pattern = NodeUtils.stringLiteral(argObject.getArg()) ;
        if ( pattern == null )
        {
            Log.warn(this, "Pattern must be a plain literal or xsd:string: "+argObject.getArg()) ;
            return new QueryIterNullIterator(execCxt) ;
        }

        if ( false )
            // Old (ARQ 1) way - not recommended.
            return buildSyntax(input, nodeVar, pattern, execCxt) ;
View Full Code Here

    // Subject is bound : still two cases: object bound (do a check) and object unbound (assign the local name)
    private QueryIterator execFixedSubject(Node nodeURI, Node nodeLocalname, Binding binding, ExecutionContext execCxt)
    {
        if ( ! nodeURI.isURI() )
            // Subject bound but not a URI
            return new QueryIterNullIterator(execCxt) ;

        // Subject is bound and a URI - get the localname as a Node
        Node localname = Node.createLiteral(nodeURI.getLocalName()) ;
       
        // Object - unbound variable or a value?
        if ( ! nodeLocalname.isVariable() )
        {
            // Object bound or a query constant.  Is it the same as the calculated value?
            if ( nodeLocalname.equals(localname) )
                // Same
                return QueryIterSingleton.create(binding, execCxt) ;
            // No - different - no match.
            return new QueryIterNullIterator(execCxt) ;
        }
       
        // Object unbound variable - assign the localname to it.
        return QueryIterSingleton.create(binding, Var.alloc(nodeLocalname), localname, execCxt) ;
    }
View Full Code Here

    {
        if ( ! nodeLocalname.isVariable() )
        {
            if ( ! nodeLocalname.isLiteral() )
                // Not a variable, not a literal=> can't match
                return new QueryIterNullIterator(execCxt) ;
       
            if( ! NodeUtils.isStringLiteral(nodeLocalname) )
                // If a typed literal, must be XSD string.
                return new QueryIterNullIterator(execCxt) ;
        }
       
        //Set bindings = new HashSet() ;    // Use a Set if you want unique results.
        List<Binding> bindings = new ArrayList<Binding>() ;   // Use a list if you want counting results.
        Graph graph = execCxt.getActiveGraph() ;
View Full Code Here

           
            if ( scoreLimit < 0 )
                scoreLimit = 0.0f ;

            if ( ! isValidSearchString(searchString) )
                return new QueryIterNullIterator(execCxt) ;
        }
        else
        {
            searchString = argObject.getArg() ;
            limit = Query.NOLIMIT ;
            scoreLimit = 0.0f ;
        }
       
        if ( !isValidSearchString(searchString) )
            return IterLib.noResults(execCxt) ;

        String qs = asString(searchString) ;
       
        if ( qs == null )
        {
            Log.warn(this, "Not a string (it was a moment ago!): "+searchString) ;
            return new QueryIterNullIterator(execCxt) ;
        }
       
        Var scoreVar = (score==null)?null:Var.alloc(score) ;
       
        if ( match.isVariable() )
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sparql.engine.iterator.QueryIterNullIterator

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.