GeometryDatatype extends BaseDatatype { public static final boolean checkURI(String datatypeURI) throws DatatypeFormatException { registerDatatypes(); RDFDatatype rdfDatatype = TYPE_MAPPER.getTypeByName(datatypeURI); if (rdfDatatype != null) { return rdfDatatype instanceof GeometryDatatype; } else { throw new DatatypeFormatException("Datatype not found: " + datatypeURI + " Ensure that GeoSPARQL is enabled and Datatype has been registered."); } } GeometryDatatype(String uri); abstract GeometryWrapper read(String geometryLiteral); @Override final GeometryWrapper parse(String lexicalForm); final GeometryWrapper parse(String lexicalForm, GeometryIndex targetIndex); static final void registerDatatypes(); static final GeometryDatatype get(RDFDatatype rdfDatatype); static final GeometryDatatype get(String datatypeURI); static final boolean checkURI(String datatypeURI); static final boolean check(RDFDatatype rdfDatatype);  }
@Test public void testCheckGeometryDatatypeURI() { String datatypeURI = WKTDatatype.URI; boolean expResult = true; boolean result = GeometryDatatype.checkURI(datatypeURI); assertEquals(expResult, result); }
@Test public void testCheckGeometryDatatypeURI_Fail() { String datatypeURI = XSDDatatype.XSDdouble.getURI(); GeometryDatatype.checkURI(datatypeURI); boolean expResult = false; boolean result = GeometryDatatype.checkURI(datatypeURI); assertEquals(expResult, result); }