throw new RDFDataException(
"Cannot convert a language tagged literal to an Integer - it makes no sense");
}
if (node instanceof DatatypeLiteral) {
URI datatype = node.asDatatypeLiteral().getDatatype();
// TODO add handling for XSD._nonPositiveInteger and other weird
// types
// Note: in general, xsd:integer cannot be handled by Java
if (datatype.equals(XSD._int)) {
return toInteger(node.asDatatypeLiteral());
} else {
throw new RDFDataException("Cannot convert from datatype "
+ datatype + " to URI");
}