Package com.hp.hpl.jena.query

Examples of com.hp.hpl.jena.query.QueryExecException


    @Override
    public Model execDescribe(Model model)
    {
        if ( ! query.isDescribeType() )
            throw new QueryExecException("Attempt to get a DESCRIBE result from a "+labelForQuery(query)+" query") ;
        //Was: query.setQueryResultStar(true) ; but why?
        query.setResultVars() ;
        // If there was no WhereClause, use an empty pattern (one solution, no columns).
        if ( query.getQueryPattern() == null )
            query.setQueryPattern(new ElementGroup()) ;
View Full Code Here


    @Override
    public boolean execAsk()
    {
        if ( ! query.isAskType() )
            throw new QueryExecException("Attempt to have boolean from a "+labelForQuery(query)+" query") ;

        startQueryIterator() ;
        boolean r = queryIterator.hasNext() ;
        this.close() ;
        return r ;
View Full Code Here

        if ( dataset != null )
            return dataset.asDatasetGraph() ;
       
        if ( ! query.hasDatasetDescription() )
            //Query.Log.warn(this, "No data for query (no URL, no model)");
            throw new QueryExecException("No dataset description for query");
       
        String baseURI = query.getBaseURI() ;
        if ( baseURI == null )
            baseURI = IRIResolver.chooseBaseURI() ;
       
View Full Code Here

    public static final Symbol queryTimeout = ARQConstants.allocSymbol(base, "queryTimeout");

    public static QueryIterator exec(OpService op, Context context)
    {
        if ( ! op.getService().isURI() )
            throw new QueryExecException("Service URI not bound: "+op.getService()) ;
       
        // This relies on the observation that the query was originally correct,
        // so reversing the scope renaming is safe (it merely restores the algebra expression).
        // Any variables that reappear should be internal ones that were hidden by renaming
        // in the first place.
View Full Code Here

              query.setConnectTimeout(x);
            }
          }
          catch (NumberFormatException ex)
          {
            throw new QueryExecException("Can't interpret string for timeout: " + obj);
          }
        }
        else
        {
          throw new QueryExecException("Can't interpret timeout: " + obj);
        }
      }
    }
View Full Code Here

        if ( serviceURL.indexOf('?') >= 0 )
            serviceParams = true ;

        if ( queryParamPattern.matcher(serviceURL).matches() )
            throw new QueryExecException("SERVICE URL overrides the 'query' SPARQL protocol parameter") ;

        this.serviceURL = serviceURL ;
    }
View Full Code Here

   
    @Override
    protected QueryIterator execOneList(Binding binding, Node listNode, Node predicate, Node member, ExecutionContext execCxt)
    {
        if ( Var.isVar(listNode) )
            throw new QueryExecException("List : subject not a list or variable bound to a list") ;
        // Case : arg 1 (the list) is bound and arg 2 not bound => generate possibilities
        // Case : arg 1 is bound and arg 2 is bound => test for membership.

        if ( Var.isVar(member) )
            return members(binding, listNode,  Var.alloc(member) , execCxt) ;
View Full Code Here

        // Subject bound to something other a literal.
        if ( subject.isURI() || subject.isBlank() )
            return IterLib.noResults(execCxt) ;

        if ( Var.isVar(subject) && Var.isVar(object) )
            throw new QueryExecException("str: Both subject and object are unbound variables") ;
       
        if ( Var.isVar(object) )
            throw new QueryExecException("str: Object is an unbound variables") ;
       
        if ( object.isBlank() )
            throw new QueryExecException("str: object is a blank node") ;
       
        Node strValue =  Node.createLiteral(NodeFunctions.str(object)) ;
       
        if ( Var.isVar(subject) )
            return IterLib.oneResult(binding, Var.alloc(subject), strValue, execCxt) ;
View Full Code Here

    public Binding accept(Binding binding)
    {
        if ( binding.contains(var) )
        {
            if ( mustBeNewVar )
                throw new QueryExecException("Already set: "+var) ;
           
            Node n2 = binding.get(var) ;
            if ( ! n2.equals(node) )
                // And filter out.
                return null ;
View Full Code Here

            QueryIterator qIter = opExt.eval(input, execCxt) ;
            if ( qIter != null )
                return qIter ;
        } catch (UnsupportedOperationException ex) { }
        // null or UnsupportedOperationException
        throw new QueryExecException("Encountered unsupported OpExt: "+opExt.getName()) ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.query.QueryExecException

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.