Package com.hp.hpl.jena.sparql.expr

Examples of com.hp.hpl.jena.sparql.expr.ExprEvalException


                boolean b = n1.getLiteralLexicalForm().equals(n2.getLiteralLexicalForm()) ;
                if ( b )
                    return true ;
            }
            // Two literals, different terms, different language tags.
            NodeValue.raise(new ExprEvalException("Mismatch in RDFterm-equals: "+n1+", "+n2)) ;
        }
        // One or both not a literal.
        return false ;
    }
View Full Code Here


//        if ( node.isBlank() )   return node.getBlankNodeId().getLabelString() ;
//        if ( node.isBlank() )   return "" ;
        if ( node.isBlank() )
            NodeValue.raise(new ExprTypeException("Blank node: "+node)) ;
       
        NodeValue.raise(new ExprEvalException("Not a string: "+node)) ;
        return "[undef]" ;
    }
View Full Code Here

        }
       
        // Simple literal or xsd:string
        String str = simpleLiteralOrXSDString(nv) ;
        if  (str == null )
            throw new ExprEvalException("Can't make an IRI from "+nv) ;

        IRI iri = null ;
        String iriStr = nv.getLiteralLexicalForm() ;
           
        // Level of checking?
        if ( baseIRI != null )
        {
            IRI base = iriFactory.create(baseIRI);
            iri = base.create(iriStr);
        }
        else
            iri = iriFactory.create(iriStr);

        if ( ! iri.isAbsolute() )
            throw new ExprEvalException("Relative IRI string: "+iriStr) ;
        if ( warningsForIRIs && iri.hasViolation(false) )
        {
            String msg = "unknown violation from IRI library" ;
            Iterator<Violation> iter = iri.violations(false) ;
            if ( iter.hasNext() )
View Full Code Here

        return null ;
    }
   
    public static NodeValue strDatatype(NodeValue v1, NodeValue v2)
    {
        if ( ! v1.isString() ) throw new ExprEvalException("Not a string (arg 1): "+v1) ;
        if ( ! v2.isIRI() ) throw new ExprEvalException("Not an IRI (arg 2): "+v2) ;
       
        String lex = v1.asString() ;
        Node dt = v2.asNode() ;
        // Check?
       
View Full Code Here

        return NodeValue.makeNode(n) ;
    }
   
    public static NodeValue strLang(NodeValue v1, NodeValue v2)
    {
        if ( ! v1.isString() ) throw new ExprEvalException("Not a string (arg 1): "+v1) ;
        if ( ! v2.isString() ) throw new ExprEvalException("Not a string (arg 2): "+v2) ;
       
        String lex = v1.asString() ;
        String lang = v2.asString() ;
        // Check?
       
View Full Code Here

                    total = nv ;
                else
                    total = XSDFuncOp.numAdd(nv, total) ;
            }
            else
                throw new ExprEvalException("Not a number: "+nv) ;
        }
View Full Code Here

    }
    @Override
    public NodeValue exec(List<NodeValue> args)
    {
        if ( args.size() > 3 )
            throw new ExprEvalException("substring: Wrong number of arguments: "+
                                        args.size()+" : [wanted 2 or 3]") ;
       
        NodeValue v1 = args.get(0) ;
        NodeValue v2 = args.get(1) ;
        NodeValue v3 = null ;
View Full Code Here

                                            ExecutionContext execCxt)
    {
        // subject a variable.
       
        if ( objectArgs.size() != 2 )
            throw new ExprEvalException("ListIndex : object not a list of length 2") ;
        Node indexNode = objectArgs.get(0) ;
        Node memberNode = objectArgs.get(1) ;
       
        final Collection<Node> x ;
        if ( ! Var.isVar(memberNode) )
View Full Code Here

    protected QueryIterator execOneList(Binding binding,
                                        Node listNode, Node predicate, List<Node> objectArgs,
                                        ExecutionContext execCxt)
    {
        if ( Var.isVar(listNode) )
            throw new ExprEvalException("ListIndex : subject not a list or variable bound to a list") ;

        if ( objectArgs.size() != 2 )
            throw new ExprEvalException("ListIndex : object not a list of length 2") ;

        Node indexNode = objectArgs.get(0) ;
        Node memberNode = objectArgs.get(1) ;
       
        Graph graph = execCxt.getActiveGraph() ;
View Full Code Here

   
    @Override
    public void build(String uri, ExprList args)
    {
        if ( args.size() != 3 && args.size() != 2 )
            throw new ExprEvalException("matches: Wrong number of arguments: Wanted 2 or 3, got "+args.size()) ;
        myArgs = args ;
       
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sparql.expr.ExprEvalException

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.