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; }
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 Clause createRelationshipClauseWithRestrictions( OWLQuantifiedObjectRestriction r, String fillerId, Set<QualifierValue> qvs, OWLSubClassOfAxiom ax) { Clause c = new Clause(); c.setTag(OboFormatTag.TAG_RELATIONSHIP.getTag()); c.addValue(this.getIdentifier(r.getProperty())); c.addValue(fillerId); c.setQualifierValues(qvs); addQualifiers(c, ax.getAnnotations()); return c; }
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()); }
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 Clause createRelationshipClauseWithCardinality( OWLObjectCardinalityRestriction restriction, String fillerId, Set<QualifierValue> qvs, OWLSubClassOfAxiom ax) { Clause c = new Clause(); c.setTag(OboFormatTag.TAG_RELATIONSHIP.getTag()); c.addValue(this.getIdentifier(restriction.getProperty())); c.addValue(fillerId); c.setQualifierValues(qvs); String q = "cardinality"; if (restriction instanceof OWLObjectMinCardinality) { q = "minCardinality"; } else if (restriction instanceof OWLObjectMaxCardinality) { q = "maxCardinality"; } c.addQualifierValue(new QualifierValue(q, Integer.toString(restriction.getCardinality()))); addQualifiers(c, ax.getAnnotations()); return c; }
Clause clause = new Clause(OboFormatTag.TAG_PROPERTY_VALUE); String propId = this.getIdentifier(prop); addQualifiers(clause, qualifiers); if (propId.equals("shorthand") == false) { clause.addValue(propId); handleSynonym(qualifiers, synonymType, clause, unprocessedQualifiers); addQualifiers(clause, unprocessedQualifiers);
addQualifiers(clause, unprocessedAnnotations);
clause.addValue(scope); addQualifiers(clause, ax.getAnnotations()); LOG.log(Level.WARNING, "duplicate clause: " + clause + " in header"); addQualifiers(clause, ax.getAnnotations()); f.addClause(clause); addQualifiers(clause, ax.getAnnotations());
addQualifiers(clause, qualifiers); if (propId.equals("shorthand") == false) { clause.addValue(propId);
c.setValue(cls2); f.addClause(c); addQualifiers(c, ax.getAnnotations()); } else if (ce2 instanceof OWLObjectUnionOf) { List<OWLClassExpression> list2 = ((OWLObjectUnionOf) ce2) addQualifiers(c, ax.getAnnotations()); c.addQualifierValue(new QualifierValue("all_only", allOnly.toString())); addQualifiers(c, ax.getAnnotations());
c.setQualifierValues(qvs); f.addClause(c); addQualifiers(c, ax.getAnnotations()); } else if (sup instanceof OWLQuantifiedObjectRestriction) {