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

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


            throw new ARQInternalErrorException(Utils.className(this)+": Null args list") ;
       
        if ( args.size() != 3 )
            throw new ExprEvalException(Utils.className(this)+": Wrong number of arguments: Wanted 3, got "+args.size()) ;
       
        NodeValue v1 = args.get(0) ;
        NodeValue v2 = args.get(1) ;
        NodeValue v3 = args.get(2) ;
       
        return exec(v1, v2, v3) ;
    }
View Full Code Here


            throw new ARQInternalErrorException(Utils.className(this)+": Null args list") ;
       
        if ( args.size() != 4 )
            throw new ExprEvalException(Utils.className(this)+": Wrong number of arguments: Wanted 4, got "+args.size()) ;
       
        NodeValue v1 = args.get(0) ;
        NodeValue v2 = args.get(1) ;
        NodeValue v3 = args.get(2) ;
        NodeValue v4 = args.get(3) ;
       
        return exec(v1, v2, v3, v4) ;
    }
View Full Code Here

            throw new ARQInternalErrorException("FunctionBase1: Null args list") ;
       
        if ( args.size() != 1 )
            throw new ExprEvalException("FunctionBase1: Wrong number of arguments: Wanted 1, got "+args.size()) ;
       
        NodeValue v1 = args.get(0) ;
       
        return exec(v1) ;
    }
View Full Code Here

        {
            if ( count == 0 ) return noValuesToAvg ;
            if ( super.errorCount != 0 )
                //throw new ExprEvalException("avg: error in group") ;
                return null ;
            NodeValue nvCount = NodeValue.makeInteger(count) ;
            return XSDFuncOp.numDivide(total, nvCount) ;
        }
View Full Code Here

       
        List<NodeValue> evalArgs = new ArrayList<NodeValue>() ;
        for ( Iterator<Expr> iter = args.iterator() ; iter.hasNext() ; )
        {
            Expr e = iter.next() ;
            NodeValue x = e.eval(binding, env) ;
            evalArgs.add(x) ;
        }
       
        NodeValue nv =  exec(evalArgs) ;
        arguments = null ;
        return nv ;
    }
View Full Code Here

   
    @Override
    final public void accumulate(Binding binding, FunctionEnv functionEnv)
    {
        try {
            NodeValue nv = expr.eval(binding, functionEnv) ;
            if ( values.contains(nv) )
                return ;
            values.add(nv) ;
            accumulateDistinct(nv, binding, functionEnv) ;
            count++ ;
View Full Code Here

            BuilderLib.broken(item, "Not an integer: "+item) ;
        Node node = item.getNode() ;
        if ( ! node.isLiteral() )
            BuilderLib.broken(item, "Not an integer: "+item) ;

        NodeValue nv = NodeValue.makeNode(node) ;
        if ( ! nv.isInteger() )
            BuilderLib.broken(item, "Not an integer: "+item) ;
        return nv.getInteger() ;
    }
View Full Code Here

        @Override
        public NodeValue getAccValue()
        {
            if ( count == 0 ) return noValuesToAvg ;
            NodeValue nvCount = NodeValue.makeInteger(count) ;
            return XSDFuncOp.numDivide(total, nvCount) ;
        }
View Full Code Here

    public Node getValue(Binding key)
    {
        Accumulator acc = buckets.get(key) ;
        if ( acc == null )
            throw new ARQInternalErrorException("Null for accumulator") ;
        NodeValue nv = acc.getValue();
        if ( nv == null )
            return null ;
        return nv.asNode() ;
    }
View Full Code Here

   
    @Override
    final public void accumulate(Binding binding, FunctionEnv functionEnv)
    {
        try {
            NodeValue nv = expr.eval(binding, functionEnv) ;
            accumulate(nv, binding, functionEnv) ;
            count++ ;
        } catch (ExprEvalException ex)
        {
            errorCount++ ;
View Full Code Here

TOP

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

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.