DatatypeFactory { public static Datatype<? extends Object> getDatatype(Literal l) throws DatatypeParseException, ParseException { return getDatatype(l.getLabel(), l.getDatatype()); }  static Datatype<? extends Object> getDatatype(Literal l); static Datatype<? extends Object> getDatatype(String lex, Resource dt);  }
@Test public void test() throws ParseException { String dtstring = "2005-03-04T00:00:00"; XsdDateTime datetime = new XsdDateTime(dtstring); assertEquals(datetime, getDatatype(dtstring, XSD.DATETIME)); assertEquals(datetime, getDatatype(new Literal("\"" + dtstring + "\"^^" + XSD.DATETIME, true))); }