Set<OntologyAxiomPair> axioms = new HashSet<OntologyAxiomPair>();
if (!tok.equalsIgnoreCase(DATATYPE)) {
throw createException(DATATYPE);
}
String subj = consumeToken();
OWLDatatype datatype = getOWLDatatype(subj);
if (datatype == null) {
throw createException(false, false, false, false, true, false);
}
axioms.add(new OntologyAxiomPair(defaultOntology, dataFactory.getOWLDeclarationAxiom(datatype)));
while (true) {
String sect = peekToken();
if (sect.equalsIgnoreCase(EQUIVALENT_TO)) {
potentialKeywords.clear();
consumeToken();
Set<OWLOntology> onts = getOntologies();
Set<OWLDataRange> drs = parseDataRangeList();
for (OWLOntology ont : onts) {
for (OWLDataRange dr : drs) {
axioms.add(new OntologyAxiomPair(ont, dataFactory.getOWLDatatypeDefinitionAxiom(datatype, dr)));
}
}
}
else if (sect.equalsIgnoreCase(ANNOTATIONS)) {
potentialKeywords.clear();
axioms.addAll(parseAnnotations(datatype.getIRI()));
}
else {
break;
}
}