Search in sources :

Example 6 with XSDDatatype

use of org.apache.jena.datatypes.xsd.XSDDatatype in project jena by apache.

the class TestFmtUtils method doubleLiteral.

@Test
public void doubleLiteral() throws Exception {
    Node_Literal nl = (Node_Literal) NodeFactory.createLiteral("2.1e2", new XSDDatatype("double"));
    assertEquals("2.1e2", FmtUtils.stringForLiteral(nl, getContext()));
}
Also used : Node_Literal(org.apache.jena.graph.Node_Literal) XSDDatatype(org.apache.jena.datatypes.xsd.XSDDatatype) Test(org.junit.Test)

Example 7 with XSDDatatype

use of org.apache.jena.datatypes.xsd.XSDDatatype in project jena by apache.

the class TestDatatypes method checkRegistration1.

private void checkRegistration1(String localName, Resource r) {
    XSDDatatype _xsd = (XSDDatatype) NodeFactory.getType(XSD.getURI() + localName);
    assertNotNull(_xsd);
    assertEquals(r.getURI(), _xsd.getURI());
}
Also used : XSDDatatype(org.apache.jena.datatypes.xsd.XSDDatatype)

Aggregations

XSDDatatype (org.apache.jena.datatypes.xsd.XSDDatatype)7 Node_Literal (org.apache.jena.graph.Node_Literal)5 Test (org.junit.Test)5 XSDDateTime (org.apache.jena.datatypes.xsd.XSDDateTime)1 InfGraph (org.apache.jena.reasoner.InfGraph)1