private boolean trObjectProperty(OWLObjectProperty prop, String tag, Boolean value, Set<OWLAnnotation> annotations){ if(prop == null || value == null) { return false; } Frame f = getTypedefFrame(prop); Clause clause = new Clause(tag); clause.addValue(value); f.addClause(clause); addQualifiers(clause, annotations); return true; }
f= getTermFrame(entity.asOWLClass()); } else if (entity instanceof OWLObjectProperty) { f = getTypedefFrame(entity.asOWLObjectProperty()); }else if (entity instanceof OWLAnnotationProperty){ String tag = owlObjectToTag(prop); if(OboFormatTag.TAG_IS_METADATA_TAG.getTag().equals(tag)){ f = getTypedefFrame(entity); break;
private boolean trObjectProperty(OWLObjectProperty prop, String tag, String value, Set<OWLAnnotation> annotations){ if(prop == null || value == null) { return false; } Frame f = getTypedefFrame(prop); Clause clause; if (OboFormatTag.TAG_ID.getTag().equals(tag)) { clause = f.getClause(tag); if (tag != null) { clause.setValue(value); } else { clause = new Clause(tag, value); f.addClause(clause); } } else { clause = new Clause(tag, value); f.addClause(clause); } addQualifiers(clause, annotations); return true; }
private void tr(OWLSubObjectPropertyOfAxiom ax){ OWLObjectPropertyExpression sup = ax.getSuperProperty(); OWLObjectPropertyExpression sub = ax.getSubProperty(); if (sub.isBottomEntity() || sub.isTopEntity() || sup.isBottomEntity() || sub.isTopEntity()) { error("SubProperties using Top or Bottom entites are not supported in OBO."); return; } if(sub instanceof OWLObjectProperty && sup instanceof OWLObjectProperty){ String supId = this.getIdentifier(sup); if(supId.startsWith("owl:")){ return; } Frame f = getTypedefFrame((OWLObjectProperty) sub); Clause clause = new Clause(OboFormatTag.TAG_IS_A, supId); f.addClause(clause); addQualifiers(clause, ax.getAnnotations()); }else{ error(ax); } }
private void tr(OWLObjectPropertyDomainAxiom ax){ final OWLClassExpression domain = ax.getDomain(); OWLObjectPropertyExpression propEx = ax.getProperty(); if (propEx.isAnonymous()) { error(ax); return; } OWLObjectProperty prop = propEx.asOWLObjectProperty(); if (domain.isBottomEntity() || domain.isTopEntity()) { // at least get the type def frame getTypedefFrame(prop); // now throw the error error("domains using top or bottom entities are not translatable to OBO.", ax); return; } String range = this.getIdentifier(domain); if(range != null){ if( trObjectProperty(prop, OboFormatTag.TAG_DOMAIN.getTag(), range, ax.getAnnotations()) ){ return; } } error(ax); }
private void tr(OWLObjectPropertyRangeAxiom ax){ final OWLClassExpression owlRange = ax.getRange(); OWLObjectPropertyExpression propEx = ax.getProperty(); if (propEx.isAnonymous()) { error(ax); } OWLObjectProperty prop = propEx.asOWLObjectProperty(); if (owlRange.isBottomEntity() || owlRange.isTopEntity()) { // at least create the property frame getTypedefFrame(prop); // error message error("ranges using top or bottom entities are not translatable to OBO.", ax); return; } String range = this.getIdentifier(owlRange); //getIdentifier(ax.getRange()); if(range != null){ if( trObjectProperty(prop, OboFormatTag.TAG_RANGE.getTag(), range, ax.getAnnotations()) ) { return; } } error(ax); }
Frame f = getTypedefFrame(sub); Clause clause = new Clause(OboFormatTag.TAG_IS_A, supId); f.addClause(clause);