Package com.hp.hpl.jena.query

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


  public void build(PropFuncArg argSubject, Node predicate,
      PropFuncArg argObject, ExecutionContext execCxt) {
    super.build(argSubject, predicate, argObject, execCxt);

    if (!argSubject.isNode())
      throw new QueryBuildException("Subject is not a single node: "
          + argSubject);

    if (argObject.isList()) {
      List<Node> list = argObject.getArgList();
      if (list.size() < 3)
        throw new QueryBuildException("Not enough arguments in list");

      if (list.size() > 5)
        throw new QueryBuildException("Too many arguments in list : "
            + list);
    }
  }
View Full Code Here


        // Subject possibilities become ?foo or (?foo ?score)
        DatasetGraph dsg = execCxt.getDataset() ;
        server = chooseTextIndex(dsg) ;

        if (!argSubject.isNode())
            throw new QueryBuildException("Subject is not a single node: " + argSubject) ;

        if (argObject.isList()) {
            List<Node> list = argObject.getArgList() ;
            if (list.size() == 0)
                throw new QueryBuildException("Zero-length argument list") ;

            if (list.size() > 4)
                throw new QueryBuildException("Too many arguments in list : " + list) ;
        }
    }
View Full Code Here

        try
        {
            return (Procedure)extClass.newInstance() ;
        } catch (Exception e)
        {
            throw new QueryBuildException("Can't instantiate procedure for "+uri, e) ;
        }
    }
View Full Code Here

    @Override
    public void build(PropFuncArg argSubject, Node predicate, PropFuncArg argObject, ExecutionContext execCxt)
    {
        if ( subjArgType.equals(PropFuncArgType.PF_ARG_SINGLE) )
            if ( argSubject.isList() )
                throw new QueryBuildException("List arguments (subject) to "+predicate.getURI()) ;
       
        if ( subjArgType.equals(PropFuncArgType.PF_ARG_LIST) && ! argSubject.isList() )
                throw new QueryBuildException("Single argument, list expected (subject) to "+predicate.getURI()) ;

        if ( objFuncArgType.equals(PropFuncArgType.PF_ARG_SINGLE) && argObject.isList() )
        {
            if ( ! argObject.isNode() )
                // But allow rdf:nil.
                throw new QueryBuildException("List arguments (object) to "+predicate.getURI()) ;
        }
       
        if ( objFuncArgType.equals(PropFuncArgType.PF_ARG_LIST) )
            if ( ! argObject.isList() )
                throw new QueryBuildException("Single argument, list expected (object) to "+predicate.getURI()) ;
    }
View Full Code Here

    public PropertyFunction create(String uri)
    {
        try
        { return (PropertyFunction)extClass.newInstance() ; }
        catch (Exception e)
        { throw new QueryBuildException("Can't instantiate PropertyFunction for "+uri, e) ; }
    }
View Full Code Here

{
    @Override
    public void checkBuild(String uri, ExprList args)
    {
        if ( args.size() != 3 )
            throw new QueryBuildException("Function '"+Utils.className(this)+"' takes three arguments") ;
    }
View Full Code Here

{
    @Override
    public void checkBuild(String uri, ExprList args)
    {
        if ( args.size() != 4 )
            throw new QueryBuildException("Function '"+Utils.className(this)+"' takes four arguments") ;
    }
View Full Code Here

{
    @Override
    public void checkBuild(String uri, ExprList args)
    {
        if ( args.size() != 1 )
            throw new QueryBuildException("Function '"+Utils.className(this)+"' takes one argument") ;
    }
View Full Code Here

        try
        {
            return (Function)extClass.newInstance() ;
        } catch (Exception e)
        {
            throw new QueryBuildException("Can't instantiate function for "+uri, e) ;
        }
    }
View Full Code Here

{
    @Override
    public void checkBuild(String uri, ExprList args)
    {
        if ( args.size() != 2 )
            throw new QueryBuildException("Function '"+Utils.className(this)+"' takes two arguments") ;
    }
View Full Code Here

TOP

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

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.