private boolean checkEquiv(OWLClassExpression exp) { if (exp instanceof OWLClass) return !exp.isTopEntity(); if (exp instanceof OWLObjectIntersectionOf) return checkEquiv(((OWLObjectIntersectionOf) exp).getOperands()); if (exp instanceof OWLObjectHasValue) return check(((OWLObjectHasValue) exp).getProperty()); if (exp instanceof OWLDataHasValue) return check(((OWLDataHasValue) exp).getProperty()); return false; }
private void tr(OWLDisjointClassesAxiom ax) { // use set, the OWL-API does not provide an order Set<OWLClassExpression> set = ax.getClassExpressions(); if (set.size() != 2) { error("Expected two classes in a disjoin classes axiom.", ax); } Iterator<OWLClassExpression> it = set.iterator(); OWLClassExpression ce1 = it.next(); OWLClassExpression ce2 = it.next(); if (ce1.isBottomEntity() || ce1.isTopEntity() || ce2.isBottomEntity() || ce2.isTopEntity()) { error("Disjoint classes axiom using Top or Bottom entities are not supported.", ax); } String cls2 = this.getIdentifier(ce2); if(cls2 == null){ error(ax); return; } if (ce1.isAnonymous()) { error(ax); return; } OWLClass cls1 = ce1.asOWLClass(); Frame f = getTermFrame(cls1); Clause c = new Clause(); c.setTag(OboFormatTag.TAG_DISJOINT_FROM.getTag()); c.setValue(cls2); f.addClause(c); addQualifiers(c, ax.getAnnotations()); }
OWLClassExpression ce1 = it.next(); OWLClassExpression ce2 = it.next(); if (ce1.isBottomEntity() || ce1.isTopEntity() || ce2.isBottomEntity() || ce2 .isTopEntity()) { error("Disjoint classes axiom using Top or Bottom entities are not supported.", ax, false);
OWLClassExpression ce1 = it.next(); OWLClassExpression ce2 = it.next(); if (ce1.isBottomEntity() || ce1.isTopEntity() || ce2.isBottomEntity() || ce2 .isTopEntity()) { error("Disjoint classes axiom using Top or Bottom entities are not supported.", ax, false);
OWLClassExpression ce1 = it.next(); OWLClassExpression ce2 = it.next(); if (ce1.isBottomEntity() || ce1.isTopEntity() || ce2.isBottomEntity() || ce2 .isTopEntity()) { error("Disjoint classes axiom using Top or Bottom entities are not supported.", ax, false);
OWLClassExpression ce1 = it.next(); OWLClassExpression ce2 = it.next(); if (ce1.isBottomEntity() || ce1.isTopEntity() || ce2.isBottomEntity() || ce2 .isTopEntity()) { error("Disjoint classes axiom using Top or Bottom entities are not supported.", ax, false);
public boolean checkSub(OWLClassExpression exp) { if (exp instanceof OWLClass) return !exp.isTopEntity(); if (exp instanceof OWLObjectIntersectionOf) return checkSub(((OWLObjectIntersectionOf) exp).getOperands()); if (exp instanceof OWLObjectUnionOf) return checkSub(((OWLObjectUnionOf) exp).getOperands()); if (exp instanceof OWLObjectOneOf) return true; if (exp instanceof OWLObjectSomeValuesFrom) { OWLObjectSomeValuesFrom someValueExp = (OWLObjectSomeValuesFrom) exp; return check(someValueExp.getProperty()) && (someValueExp.getFiller().isTopEntity() || checkSub(someValueExp.getFiller())); } if (exp instanceof OWLObjectHasValue) return check(((OWLObjectHasValue) exp).getProperty()); if (exp instanceof OWLDataSomeValuesFrom) { OWLDataSomeValuesFrom someValueExp = (OWLDataSomeValuesFrom) exp; return check(someValueExp.getProperty()) && check(someValueExp.getFiller()); } if (exp instanceof OWLDataHasValue) return check(((OWLDataHasValue) exp).getProperty()); return false; }
OWLClassExpression sup = ax.getSuperClass(); Set<QualifierValue> qvs = new HashSet<>(); if (sub.isOWLNothing() || sub.isTopEntity() || sup.isTopEntity() || sup.isOWLNothing()) { error(TOP_BOTTOM_NONTRANSLATEABLE, ax, false); return; if (filler.isBottomEntity() || filler.isTopEntity()) { error(TOP_BOTTOM_NONTRANSLATEABLE, ax, false); return; if (filler.isBottomEntity() || filler.isTopEntity()) { error(TOP_BOTTOM_NONTRANSLATEABLE, ax, false); return; OWLObjectCardinalityRestriction restriction = (OWLObjectCardinalityRestriction) operand; OWLClassExpression filler = restriction.getFiller(); if (filler.isBottomEntity() || filler.isTopEntity()) { error(TOP_BOTTOM_NONTRANSLATEABLE, ax, false); return; OWLQuantifiedObjectRestriction restriction = (OWLQuantifiedObjectRestriction) operand; OWLClassExpression filler = restriction.getFiller(); if (filler.isBottomEntity() || filler.isTopEntity()) { error(TOP_BOTTOM_NONTRANSLATEABLE, ax, false); return;
OWLClassExpression sup = ax.getSuperClass(); Set<QualifierValue> qvs = new HashSet<>(); if (sub.isOWLNothing() || sub.isTopEntity() || sup.isTopEntity() || sup.isOWLNothing()) { error(TOP_BOTTOM_NONTRANSLATEABLE, ax, false); return; if (filler.isBottomEntity() || filler.isTopEntity()) { error(TOP_BOTTOM_NONTRANSLATEABLE, ax, false); return; if (filler.isBottomEntity() || filler.isTopEntity()) { error(TOP_BOTTOM_NONTRANSLATEABLE, ax, false); return; OWLObjectCardinalityRestriction restriction = (OWLObjectCardinalityRestriction) operand; OWLClassExpression filler = restriction.getFiller(); if (filler.isBottomEntity() || filler.isTopEntity()) { error(TOP_BOTTOM_NONTRANSLATEABLE, ax, false); return; OWLQuantifiedObjectRestriction restriction = (OWLQuantifiedObjectRestriction) operand; OWLClassExpression filler = restriction.getFiller(); if (filler.isBottomEntity() || filler.isTopEntity()) { error(TOP_BOTTOM_NONTRANSLATEABLE, ax, false); return;
public boolean checkSuper(OWLClassExpression exp) { if (exp instanceof OWLClass) return !exp.isTopEntity(); OWLObjectAllValuesFrom allValueExp = (OWLObjectAllValuesFrom) exp; return check(allValueExp.getProperty()) && (allValueExp.getFiller().isTopEntity() || checkSuper(allValueExp.getFiller())); if (maxCardExp.getCardinality() > 1) return false; return check(maxCardExp.getProperty()) && (!maxCardExp.isQualified() || maxCardExp.getFiller().isTopEntity() || checkSub(maxCardExp.getFiller()));
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); }
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); }
/** * Tr. * * @param ax the ax */ protected void tr(OWLObjectPropertyRangeAxiom ax) { OWLClassExpression owlRange = ax.getRange(); OWLObjectPropertyExpression propEx = ax.getProperty(); if (propEx.isAnonymous()) { error(ax, false); } 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, false); return; } String range = getIdentifier(owlRange); if (range != null && trObjectProperty(prop, OboFormatTag.TAG_RANGE.getTag(), range, ax.annotations())) { return; } error(ax, false); }
/** * Tr. * * @param ax the ax */ protected void tr(OWLObjectPropertyRangeAxiom ax) { OWLClassExpression owlRange = ax.getRange(); OWLObjectPropertyExpression propEx = ax.getProperty(); if (propEx.isAnonymous()) { error(ax, false); } 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, false); return; } String range = getIdentifier(owlRange); if (range != null && trObjectProperty(prop, OboFormatTag.TAG_RANGE.getTag(), range, ax.annotations())) { return; } error(ax, false); }
/** * Tr. * * @param ax the ax */ protected void tr(OWLObjectPropertyRangeAxiom ax) { OWLClassExpression owlRange = ax.getRange(); OWLObjectPropertyExpression propEx = ax.getProperty(); if (propEx.isAnonymous()) { error(ax, false); } 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, false); return; } String range = getIdentifier(owlRange); if (range != null && trObjectProperty(prop, OboFormatTag.TAG_RANGE.getTag(), range, ax.annotations())) { return; } error(ax, false); }
/** * Tr. * * @param ax the ax */ protected void tr(OWLObjectPropertyRangeAxiom ax) { OWLClassExpression owlRange = ax.getRange(); OWLObjectPropertyExpression propEx = ax.getProperty(); if (propEx.isAnonymous()) { error(ax, false); } 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, false); return; } String range = getIdentifier(owlRange); if (range != null && trObjectProperty(prop, OboFormatTag.TAG_RANGE.getTag(), range, ax.annotations())) { return; } error(ax, false); }
if (domain.isBottomEntity() || domain.isTopEntity()) {
if (domain.isBottomEntity() || domain.isTopEntity()) {
if (domain.isBottomEntity() || domain.isTopEntity()) {
if (domain.isBottomEntity() || domain.isTopEntity()) {