String id = typedefFrame.getId();
OWLObjectProperty p = trObjectProp(id);
add(fac.getOWLDeclarationAxiom(p));
String xid = translateShorthandIdToExpandedId(id);
if (!xid.equals(id)) {
OWLAxiom ax = fac.getOWLAnnotationAssertionAxiom(
trTagToAnnotationProp("shorthand"), p.getIRI(),
trLiteral(id), new HashSet<OWLAnnotation>());
add(ax);
}
/*
* // See 5.9.3 Special Rules for Relations Collection<Xref> xrefs =
* typedefFrame.getTagValues(OboFormatTag.TAG_XREF, Xref.class);
* String xrefStr = null; for (Xref xref: xrefs) { if (xref != null)
* { String xid = xref.getIdref(); if ((xid.startsWith("RO") ||
* xid.startsWith("BFO")) && !xid.equals(id)) { // RO and BFO have
* special status. // avoid cycles (in case of self-xref) //
* fac.getOWLAnnotationAssertionAxiom(prop, p.getIRI(),
* trLiteral(id), new HashSet<>()); OWLAxiom ax =
* fac.getOWLAnnotationAssertionAxiom(
* trTagToAnnotationProp("shorthand"), p.getIRI(), trLiteral(id),
* new HashSet<>()); add(ax); // return
* oboIdToIRI(xid); } } }
*/
for (String tag : typedefFrame.getTags()) {
Collection<Clause> clauses = typedefFrame.getClauses(tag);
OboFormatTag tagConstant = OBOFormatConstants.getTag(tag);
if (tagConstant == OboFormatTag.TAG_INTERSECTION_OF) {
OWLAxiom axiom = trRelationIntersectionOf(id, p, clauses);
if (axiom != null) {
add(axiom);
}
} else if (tagConstant == OboFormatTag.TAG_UNION_OF) {
OWLAxiom axiom = trRelationUnionOf(id, p, clauses);
if (axiom != null) {
add(axiom);
}
} else {
for (Clause clause : clauses) {