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

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


    private static PrefixMapping pmap = ARQConstants.getGlobalPrefixMap() ;
   
    private static void test(String string, String result)
    {
        Expr expr = ExprUtils.parse(string, pmap) ;
        NodeValue nv = expr.eval(null, new FunctionEnvBase()) ;
        Node r = NodeFactory.parseNode(result) ;
        NodeValue nvr = NodeValue.makeNode(r) ;
       
        assertTrue("Not same value: Expected: "+nvr+" : Actual = "+nv, NodeValue.sameAs(nvr, nv))
        // test result must be lexical form exact.
        assertEquals(r, nv.asNode()) ;
    }
View Full Code Here


        DatasetGraph dsg = TDBFactory.createDatasetGraph(loc) ;
       
        if ( root.hasProperty(pUnionDefaultGraph) )
        {
            Node b = root.getProperty(pUnionDefaultGraph).getObject().asNode() ;
            NodeValue nv = NodeValue.makeNode(b) ;
            if ( nv.isBoolean() )
                dsg.getContext().set(TDB.symUnionDefaultGraph, nv.getBoolean()) ;
            else
                Log.warn(DatasetAssemblerTDB.class,
                         "Failed to recognize value for union graph setting (ignored): "+b) ;
        }
       
View Full Code Here

   
    // == Workers
   
    static void testAdd(String s1, String s2, String s3)
    {
        NodeValue nv3 = NodeValue.parse(s3) ;
        NodeValue nv = testAdd(s1, s2) ;
        assertEquals(nv3, nv) ;
    }
View Full Code Here

        assertEquals(nv3, nv) ;
    }
   
    static NodeValue testAdd(String s1, String s2)
    {
        NodeValue nv1 = NodeValue.parse(s1) ;
        NodeValue nv2 = NodeValue.parse(s2) ;
        return NodeValueOps.additionNV(nv1, nv2) ;
    }
View Full Code Here

        return NodeValueOps.additionNV(nv1, nv2) ;
    }
   
    static void testSub(String s1, String s2, String s3)
    {
        NodeValue nv3 = NodeValue.parse(s3) ;
        NodeValue nv = testSub(s1, s2) ;
        assertEquals(nv3, nv) ;
    }
View Full Code Here

        assertEquals(nv3, nv) ;
    }
   
    static NodeValue testSub(String s1, String s2)
    {
        NodeValue nv1 = NodeValue.parse(s1) ;
        NodeValue nv2 = NodeValue.parse(s2) ;
        return NodeValueOps.subtractionNV(nv1, nv2) ;
    }
View Full Code Here

        return NodeValueOps.subtractionNV(nv1, nv2) ;
    }

    static void testMult(String s1, String s2, String s3)
    {
        NodeValue nv3 = NodeValue.parse(s3) ;
        NodeValue nv = testMult(s1, s2) ;
        assertEquals(nv3, nv) ;
    }
View Full Code Here

        assertEquals(nv3, nv) ;
    }
   
    static NodeValue testMult(String s1, String s2)
    {
        NodeValue nv1 = NodeValue.parse(s1) ;
        NodeValue nv2 = NodeValue.parse(s2) ;
        return NodeValueOps.multiplicationNV(nv1, nv2) ;
    }
View Full Code Here

        return NodeValueOps.multiplicationNV(nv1, nv2) ;
    }

    static void testDiv(String s1, String s2, String s3)
    {
        NodeValue nv3 = NodeValue.parse(s3) ;
        NodeValue nv = testDiv(s1, s2) ;
        assertEquals(nv3, nv) ;
    }
View Full Code Here

        assertEquals(nv3, nv) ;
    }
   
    static NodeValue testDiv(String s1, String s2)
    {
        NodeValue nv1 = NodeValue.parse(s1) ;
        NodeValue nv2 = NodeValue.parse(s2) ;
        return NodeValueOps.divisionNV(nv1, nv2) ;
    }
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.