/** * Gets the typedef frame. * * @param entity the entity * @return the typedef frame */ protected Frame getTypedefFrame(OWLEntity entity) { String id = getIdentifier(entity); return getTypedefFrame(checkNotNull(id)); }
/** * Gets the typedef frame. * * @param entity the entity * @return the typedef frame */ protected Frame getTypedefFrame(OWLEntity entity) { String id = getIdentifier(entity); return getTypedefFrame(checkNotNull(id)); }
/** * Gets the term frame. * * @param entity the entity * @return the term frame */ protected Frame getTermFrame(OWLClass entity) { String id = getIdentifier(entity.getIRI()); return getTermFrame(id); }
/** * Gets the typedef frame. * * @param entity the entity * @return the typedef frame */ protected Frame getTypedefFrame(OWLEntity entity) { String id = getIdentifier(entity); return getTypedefFrame(checkNotNull(id)); }
/** * Gets the term frame. * * @param entity the entity * @return the term frame */ protected Frame getTermFrame(OWLClass entity) { String id = getIdentifier(entity.getIRI()); return getTermFrame(id); }
@Nullable protected static String handleIAO10001(@Nullable String replacedBy, final Set<OWLAnnotationAssertionAxiom> unrelatedAxioms, OWLAnnotationAssertionAxiom axiom) { OWLAnnotationValue value = axiom.getValue(); Optional<OWLLiteral> asLiteral = value.asLiteral(); if (asLiteral.isPresent()) { return asLiteral.get().getLiteral(); } // fallback: also check for an IRI Optional<IRI> asIRI = value.asIRI(); if (asIRI.isPresent()) { // translate IRI to OBO style ID return getIdentifier(asIRI.get()); } unrelatedAxioms.add(axiom); return replacedBy; }
/** * Gets the term frame. * * @param entity the entity * @return the term frame */ protected Frame getTermFrame(OWLClass entity) { String id = getIdentifier(entity.getIRI()); return getTermFrame(id); }
@Nullable protected static String handleIAO10001(@Nullable String replacedBy, final Set<OWLAnnotationAssertionAxiom> unrelatedAxioms, OWLAnnotationAssertionAxiom axiom) { OWLAnnotationValue value = axiom.getValue(); Optional<OWLLiteral> asLiteral = value.asLiteral(); if (asLiteral.isPresent()) { return asLiteral.get().getLiteral(); } // fallback: also check for an IRI Optional<IRI> asIRI = value.asIRI(); if (asIRI.isPresent()) { // translate IRI to OBO style ID return getIdentifier(asIRI.get()); } unrelatedAxioms.add(axiom); return replacedBy; }
/** * Gets the term frame. * * @param entity the entity * @return the term frame */ protected Frame getTermFrame(OWLClass entity) { String id = getIdentifier(entity.getIRI()); return getTermFrame(id); }
/** * Gets the typedef frame. * * @param entity the entity * @return the typedef frame */ protected Frame getTypedefFrame(OWLEntity entity) { String id = getIdentifier(entity); return getTypedefFrame(checkNotNull(id)); }
@Nullable protected static String handleIAO10001(@Nullable String replacedBy, final Set<OWLAnnotationAssertionAxiom> unrelatedAxioms, OWLAnnotationAssertionAxiom axiom) { OWLAnnotationValue value = axiom.getValue(); Optional<OWLLiteral> asLiteral = value.asLiteral(); if (asLiteral.isPresent()) { return asLiteral.get().getLiteral(); } // fallback: also check for an IRI Optional<IRI> asIRI = value.asIRI(); if (asIRI.isPresent()) { // translate IRI to OBO style ID return getIdentifier(asIRI.get()); } unrelatedAxioms.add(axiom); return replacedBy; }
@Nullable protected static String handleIAO10001(@Nullable String replacedBy, final Set<OWLAnnotationAssertionAxiom> unrelatedAxioms, OWLAnnotationAssertionAxiom axiom) { OWLAnnotationValue value = axiom.getValue(); Optional<OWLLiteral> asLiteral = value.asLiteral(); if (asLiteral.isPresent()) { return asLiteral.get().getLiteral(); } // fallback: also check for an IRI Optional<IRI> asIRI = value.asIRI(); if (asIRI.isPresent()) { // translate IRI to OBO style ID return getIdentifier(asIRI.get()); } unrelatedAxioms.add(axiom); return replacedBy; }
/** * Creates the relationship clause with restrictions. * * @param r the r * @param fillerId the filler id * @param qvs the qvs * @param ax the ax * @return the clause */ protected Clause createRelationshipClauseWithRestrictions(OWLQuantifiedObjectRestriction r, String fillerId, Set<QualifierValue> qvs, OWLSubClassOfAxiom ax) { Clause c = new Clause(OboFormatTag.TAG_RELATIONSHIP.getTag()); c.addValue(getIdentifier(r.getProperty())); c.addValue(fillerId); c.setQualifierValues(qvs); addQualifiers(c, ax.annotations()); return c; }
/** * Tr. * * @param ax the ax */ protected void tr(OWLInverseObjectPropertiesAxiom ax) { OWLObjectPropertyExpression prop1 = ax.getFirstProperty(); OWLObjectPropertyExpression prop2 = ax.getSecondProperty(); if (prop1.isOWLObjectProperty() && prop2.isOWLObjectProperty() && trObjectProperty( prop1.asOWLObjectProperty(), OboFormatTag.TAG_INVERSE_OF.getTag(), getIdentifier(prop2), ax.annotations())) { return; } error(ax, true); }
/** * Creates the relationship clause with restrictions. * * @param r the r * @param fillerId the filler id * @param qvs the qvs * @param ax the ax * @return the clause */ protected Clause createRelationshipClauseWithRestrictions(OWLQuantifiedObjectRestriction r, String fillerId, Set<QualifierValue> qvs, OWLSubClassOfAxiom ax) { Clause c = new Clause(OboFormatTag.TAG_RELATIONSHIP.getTag()); c.addValue(getIdentifier(r.getProperty())); c.addValue(fillerId); c.setQualifierValues(qvs); addQualifiers(c, ax.annotations()); return c; }
/** * Creates the relationship clause with restrictions. * * @param r the r * @param fillerId the filler id * @param qvs the qvs * @param ax the ax * @return the clause */ protected Clause createRelationshipClauseWithRestrictions(OWLQuantifiedObjectRestriction r, String fillerId, Set<QualifierValue> qvs, OWLSubClassOfAxiom ax) { Clause c = new Clause(OboFormatTag.TAG_RELATIONSHIP.getTag()); c.addValue(getIdentifier(r.getProperty())); c.addValue(fillerId); c.setQualifierValues(qvs); addQualifiers(c, ax.annotations()); return c; }
/** * Tr. * * @param ax the ax */ protected void tr(OWLInverseObjectPropertiesAxiom ax) { OWLObjectPropertyExpression prop1 = ax.getFirstProperty(); OWLObjectPropertyExpression prop2 = ax.getSecondProperty(); if (prop1.isOWLObjectProperty() && prop2.isOWLObjectProperty() && trObjectProperty( prop1.asOWLObjectProperty(), OboFormatTag.TAG_INVERSE_OF.getTag(), getIdentifier(prop2), ax.annotations())) { return; } error(ax, true); }
/** * Tr. * * @param ax the ax */ protected void tr(OWLInverseObjectPropertiesAxiom ax) { OWLObjectPropertyExpression prop1 = ax.getFirstProperty(); OWLObjectPropertyExpression prop2 = ax.getSecondProperty(); if (prop1.isOWLObjectProperty() && prop2.isOWLObjectProperty() && trObjectProperty( prop1.asOWLObjectProperty(), OboFormatTag.TAG_INVERSE_OF.getTag(), getIdentifier(prop2), ax.annotations())) { return; } error(ax, true); }
/** * Tr. * * @param ax the ax */ protected void tr(OWLInverseObjectPropertiesAxiom ax) { OWLObjectPropertyExpression prop1 = ax.getFirstProperty(); OWLObjectPropertyExpression prop2 = ax.getSecondProperty(); if (prop1.isOWLObjectProperty() && prop2.isOWLObjectProperty() && trObjectProperty( prop1.asOWLObjectProperty(), OboFormatTag.TAG_INVERSE_OF.getTag(), getIdentifier(prop2), ax.annotations())) { return; } error(ax, true); }
protected void tr(OWLSubObjectPropertyOfAxiom ax) { OWLObjectPropertyExpression sup = ax.getSuperProperty(); OWLObjectPropertyExpression sub = ax.getSubProperty(); if (sub.isBottomEntity() || sub.isTopEntity() || sup.isBottomEntity() || sup .isTopEntity()) { error("SubProperties using Top or Bottom entites are not supported in OBO.", false); return; } if (sub.isOWLObjectProperty() && sup.isOWLObjectProperty()) { String supId = checkNotNull(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.annotations()); } else { error(ax, true); } }