Search in sources :

Example 1 with NodeValue

use of org.apache.jena.sparql.expr.NodeValue in project jena by apache.

the class TestNodeFunctions method testLang5.

@Test(expected = ExprTypeException.class)
public void testLang5() {
    NodeValue nv = NodeValue.makeNode(NodeFactory.createURI("http://example/"));
    NodeValue r = NodeFunctions.lang(nv);
}
Also used : NodeValue(org.apache.jena.sparql.expr.NodeValue) Test(org.junit.Test) BaseTest(org.apache.jena.atlas.junit.BaseTest)

Example 2 with NodeValue

use of org.apache.jena.sparql.expr.NodeValue in project jena by apache.

the class TestNodeFunctions method testLangMatches8.

@Test
public void testLangMatches8() {
    // The language tag of a plain literal is ""
    // A language tag is not allowed to be the empty string (by RFC 3066)
    NodeValue nv = NodeValue.makeString("");
    NodeValue pat = NodeValue.makeString("*");
    NodeValue r = NodeFunctions.langMatches(nv, pat);
    assertEquals(NodeValue.FALSE, r);
}
Also used : NodeValue(org.apache.jena.sparql.expr.NodeValue) Test(org.junit.Test) BaseTest(org.apache.jena.atlas.junit.BaseTest)

Example 3 with NodeValue

use of org.apache.jena.sparql.expr.NodeValue in project jena by apache.

the class TestNodeFunctions method testDatatype5.

@Test(expected = ExprTypeException.class)
public void testDatatype5() {
    NodeValue nv = NodeValue.makeNode(NodeFactory.createURI("http://example"));
    NodeValue r = NodeFunctions.datatype(nv);
}
Also used : NodeValue(org.apache.jena.sparql.expr.NodeValue) Test(org.junit.Test) BaseTest(org.apache.jena.atlas.junit.BaseTest)

Example 4 with NodeValue

use of org.apache.jena.sparql.expr.NodeValue in project jena by apache.

the class TestNodeFunctions method testDatatype3.

@Test
public void testDatatype3() {
    NodeValue nv = NodeValue.makeString("abc");
    NodeValue r = NodeFunctions.datatype(nv);
    NodeValue e = NodeValue.makeNode(XSD.xstring.asNode());
    assertEquals(e, r);
}
Also used : NodeValue(org.apache.jena.sparql.expr.NodeValue) Test(org.junit.Test) BaseTest(org.apache.jena.atlas.junit.BaseTest)

Example 5 with NodeValue

use of org.apache.jena.sparql.expr.NodeValue in project jena by apache.

the class TestNodeFunctions method testIsBlank3.

@Test
public void testIsBlank3() {
    NodeValue nv = NodeValue.makeNode(NodeFactory.createURI("http://example/"));
    NodeValue r = NodeFunctions.isBlank(nv);
    assertEquals(NodeValue.FALSE, r);
}
Also used : NodeValue(org.apache.jena.sparql.expr.NodeValue) Test(org.junit.Test) BaseTest(org.apache.jena.atlas.junit.BaseTest)

Aggregations

NodeValue (org.apache.jena.sparql.expr.NodeValue)255 Test (org.junit.Test)197 BaseTest (org.apache.jena.atlas.junit.BaseTest)42 Node (org.apache.jena.graph.Node)31 ExprEvalException (org.apache.jena.sparql.expr.ExprEvalException)26 GeometryWrapper (org.apache.jena.geosparql.implementation.GeometryWrapper)24 Expr (org.apache.jena.sparql.expr.Expr)12 NodeValueNode (org.apache.jena.sparql.expr.nodevalue.NodeValueNode)10 ARQInternalErrorException (org.apache.jena.sparql.ARQInternalErrorException)7 DatatypeFormatException (org.apache.jena.datatypes.DatatypeFormatException)6 ArrayList (java.util.ArrayList)5 SearchEnvelope (org.apache.jena.geosparql.spatial.SearchEnvelope)5 LibTestExpr (org.apache.jena.sparql.expr.LibTestExpr)5 Duration (javax.xml.datatype.Duration)4 SpatialArguments (org.apache.jena.geosparql.spatial.property_functions.SpatialArguments)4 BigDecimal (java.math.BigDecimal)3 AssemblerException (org.apache.jena.assembler.exceptions.AssemblerException)3 DatasetGraph (org.apache.jena.sparql.core.DatasetGraph)3 Var (org.apache.jena.sparql.core.Var)3 ValueSpaceClassification (org.apache.jena.sparql.expr.ValueSpaceClassification)3