}
}
@SuppressWarnings("null")
protected void tr(@Nonnull OWLSubAnnotationPropertyOfAxiom ax) {
OWLAnnotationProperty sup = ax.getSuperProperty();
OWLAnnotationProperty sub = ax.getSubProperty();
if (sub.isBottomEntity() || sub.isTopEntity() || sup.isBottomEntity()
|| sup.isTopEntity()) {
error("SubAnnotationProperties using Top or Bottom entites are not supported in OBO.",
false);
return;
}
String tagObject = owlObjectToTag(sup);
if (OboFormatTag.TAG_SYNONYMTYPEDEF.getTag().equals(tagObject)) {
String name = "";
String scope = null;
for (OWLAnnotationAssertionAxiom axiom : getOWLOntology()
.getAnnotationAssertionAxioms(sub.getIRI())) {
String tg = owlObjectToTag(axiom.getProperty());
if (OboFormatTag.TAG_NAME.getTag().equals(tg)) {
name = ((OWLLiteral) axiom.getValue()).getLiteral();
} else if (OboFormatTag.TAG_SCOPE.getTag().equals(tg)) {
scope = owlObjectToTag(axiom.getValue());
}
}
Frame hf = getObodoc().getHeaderFrame();
Clause clause = new Clause(OboFormatTag.TAG_SYNONYMTYPEDEF);
clause.addValue(getIdentifier(sub));
clause.addValue(name);
if (scope != null) {
clause.addValue(scope);
}
addQualifiers(clause, ax.getAnnotations());
if (!hf.getClauses().contains(clause)) {
hf.addClause(clause);
} else {
LOG.error("duplicate clause: {} in header", clause);
}
return;
} else if (OboFormatTag.TAG_SUBSETDEF.getTag().equals(tagObject)) {
String comment = "";
for (OWLAnnotationAssertionAxiom axiom : getOWLOntology()
.getAnnotationAssertionAxioms(sub.getIRI())) {
String tg = owlObjectToTag(axiom.getProperty());
if (OboFormatTag.TAG_COMMENT.getTag().equals(tg)) {
comment = ((OWLLiteral) axiom.getValue()).getLiteral();
break;
}