Clause dvclause = hf.getClause(OboFormatTag.TAG_DATA_VERSION);
if (dvclause != null) {
String dv = dvclause.getValue().toString();
IRI vIRI = IRI.create(DEFAULT_IRI_PREFIX + ontOboId + '/' + dv
+ '/' + ontOboId + ".owl");
OWLOntologyID oid = new OWLOntologyID(Optional.of(ontIRI),
Optional.of(vIRI));
// if the ontology being read has a differet id from the one
// that was passed in, update it
// when parsing, the original ontology is likely an anonymous,
// empty one
if (!oid.equals(in.getOntologyID())) {
manager.applyChange(new SetOntologyID(in, oid));
}
} else {
// if the ontology being read has a differet id from the one
// that was passed in, update it
// when parsing, the original ontology is likely an anonymous,
// empty one
if (!ontIRI
.equals(in.getOntologyID().getOntologyIRI().orNull())) {
manager.applyChange(new SetOntologyID(in,
new OWLOntologyID(Optional.of(ontIRI), Optional
.<IRI> absent())));
}
}
} else {
defaultIDSpace = "TEMP";
manager.applyChange(new SetOntologyID(in,
new OWLOntologyID(Optional.of(IRI.create(DEFAULT_IRI_PREFIX
+ defaultIDSpace)), Optional.<IRI> absent())));
// TODO - warn
}
trHeaderFrame(hf);
for (Frame f : obodoc.getTypedefFrames()) {