// Data ranges are used as the types of literals, as the ranges for data
// properties
OWLOntologyManager m = create();
// OWLDatatype represents named datatypes in OWL
// The OWL2Datatype enum defines built in OWL 2 Datatypes
OWLDatatype integer = df.getOWLDatatype(OWL2Datatype.XSD_INTEGER
.getIRI());
// For common data types there are some convenience methods of
// OWLDataFactory
OWLDatatype integerDatatype = df.getIntegerOWLDatatype();
OWLDatatype floatDatatype = df.getFloatOWLDatatype();
OWLDatatype doubleDatatype = df.getDoubleOWLDatatype();
OWLDatatype booleanDatatype = df.getBooleanOWLDatatype();
// The top datatype is rdfs:Literal
OWLDatatype rdfsLiteral = df.getTopDatatype();
// Custom data ranges can be built up from these basic datatypes
// Get hold of a literal that is an integer value 18
OWLLiteral eighteen = df.getOWLLiteral(18);
OWLDatatypeRestriction integerGE18 = df.getOWLDatatypeRestriction(
integer, OWLFacet.MIN_INCLUSIVE, eighteen);