use of org.apache.jena.sparql.expr.NodeValue in project jena by apache.
the class TestNodeFunctions method testDatatype4.
@Test
public void testDatatype4() {
NodeValue nv = NodeValue.makeNode("abc", "fr", (String) null);
// SPARQL 1.0
// try {
// NodeValue r = NodeFunctions.datatype(nv) ;
// fail("Expect a type exception but call succeeded") ;
// }
// catch (ExprTypeException ex) {}
// SPARQL 1.1 / RDF 1.1
NodeValue r = NodeFunctions.datatype(nv);
NodeValue e = NodeValue.makeNode(NodeConst.rdfLangString);
assertEquals(e, r);
}
use of org.apache.jena.sparql.expr.NodeValue in project jena by apache.
the class TestNodeFunctions method testIsIRI_2.
@Test
public void testIsIRI_2() {
NodeValue nv = NodeValue.makeNode(NodeFactory.createLiteral("http://example/"));
NodeValue r = NodeFunctions.isIRI(nv);
assertEquals(NodeValue.FALSE, r);
}
use of org.apache.jena.sparql.expr.NodeValue in project jena by apache.
the class TestNodeFunctions method testLangMatches9.
@Test
public void testLangMatches9() {
// The language-match of "" is not a legal by RFC 4647 but useful for language tags of ""
NodeValue nv = NodeValue.makeString("");
NodeValue pat = NodeValue.makeString("");
NodeValue r = NodeFunctions.langMatches(nv, pat);
assertEquals(NodeValue.TRUE, r);
}
use of org.apache.jena.sparql.expr.NodeValue in project jena by apache.
the class TestNodeFunctions method testStr1.
@Test
public void testStr1() {
NodeValue nv = NodeValue.makeNodeInteger(56);
NodeValue s = NodeFunctions.str(nv);
assertEquals("56", s.getString());
}
use of org.apache.jena.sparql.expr.NodeValue in project jena by apache.
the class TestNodeFunctions method testIsBlank1.
@Test
public void testIsBlank1() {
NodeValue nv = NodeValue.makeNode(NodeFactory.createBlankNode());
NodeValue r = NodeFunctions.isBlank(nv);
assertEquals(NodeValue.TRUE, r);
}
Aggregations