@Override public Set<OWLAxiom> visit(OWLSubClassOfAxiom axiom) { Set<OWLClassExpression> superClses = new HashSet<>(); PositiveClassExpressionWeakener positiveWeakener = new PositiveClassExpressionWeakener(); superClses.addAll(axiom.getSuperClass().accept(positiveWeakener)); Set<OWLClassExpression> subClses = new HashSet<>(); NegativeClassExpressionWeakener negativeWeakener = new NegativeClassExpressionWeakener(); subClses.addAll(axiom.getSubClass().accept(negativeWeakener)); Set<OWLAxiom> result = new HashSet<>(); for(OWLClassExpression superCls : superClses) { for(OWLClassExpression subCls : subClses) { OWLSubClassOfAxiom ax = dataFactory.getOWLSubClassOfAxiom(subCls, superCls, asList(axiom.annotations())); result.add(ax); } } return result; }
/** * Builder initialized from an existing object. * * @param expected the existing object * @param df data factory */ public BuilderSubClass(OWLSubClassOfAxiom expected, OWLDataFactory df) { this(df); withSub(expected.getSubClass()).withSup(expected.getSuperClass()) .withAnnotations(expected.annotations()); }
/** * Builder initialized from an existing object. * * @param expected the existing object * @param df data factory */ public BuilderSubClass(OWLSubClassOfAxiom expected, OWLDataFactory df) { this(df); withSub(expected.getSubClass()).withSup(expected.getSuperClass()) .withAnnotations(expected.annotations()); }
/** * Builder initialized from an existing object. * * @param expected the existing object * @param df data factory */ public BuilderSubClass(OWLSubClassOfAxiom expected, OWLDataFactory df) { this(df); withSub(expected.getSubClass()).withSup(expected.getSuperClass()) .withAnnotations(expected.annotations()); }
/** * Builder initialized from an existing object. * * @param expected * the existing object * @param df * data factory */ public BuilderSubClass(OWLSubClassOfAxiom expected, OWLDataFactory df) { this(df); withSub(expected.getSubClass()).withSup(expected.getSuperClass()).withAnnotations(expected.annotations()); }
@Override public Object visit(OWLSubClassOfAxiom axiom) { return visitAxiom(axiom, () -> df.getOWLSubClassOfAxiom(t(axiom.getSubClass()), t(axiom.getSuperClass()), t( axiom.annotations()))); }
@Override public Object visit(OWLSubClassOfAxiom axiom) { return visitAxiom(axiom, () -> df.getOWLSubClassOfAxiom(t(axiom.getSubClass()), t(axiom.getSuperClass()), t( axiom.annotations()))); }
@Override public Object visit(OWLSubClassOfAxiom axiom) { return visitAxiom(axiom, () -> df.getOWLSubClassOfAxiom(t(axiom.getSubClass()), t(axiom.getSuperClass()), t( axiom.annotations()))); }
/** * 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; }
/** * 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; }
/** * Creates the relationship clause with cardinality. * * @param restriction the restriction * @param fillerId the filler id * @param qvs the qvs * @param ax the ax * @return the clause */ protected Clause createRelationshipClauseWithCardinality( OWLObjectCardinalityRestriction restriction, String fillerId, Set<QualifierValue> qvs, OWLSubClassOfAxiom ax) { Clause c = new Clause(OboFormatTag.TAG_RELATIONSHIP.getTag()); c.addValue(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.annotations()); return c; }
/** * Creates the relationship clause with cardinality. * * @param restriction the restriction * @param fillerId the filler id * @param qvs the qvs * @param ax the ax * @return the clause */ protected Clause createRelationshipClauseWithCardinality( OWLObjectCardinalityRestriction restriction, String fillerId, Set<QualifierValue> qvs, OWLSubClassOfAxiom ax) { Clause c = new Clause(OboFormatTag.TAG_RELATIONSHIP.getTag()); c.addValue(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.annotations()); return c; }
/** * Creates the relationship clause with cardinality. * * @param restriction the restriction * @param fillerId the filler id * @param qvs the qvs * @param ax the ax * @return the clause */ protected Clause createRelationshipClauseWithCardinality( OWLObjectCardinalityRestriction restriction, String fillerId, Set<QualifierValue> qvs, OWLSubClassOfAxiom ax) { Clause c = new Clause(OboFormatTag.TAG_RELATIONSHIP.getTag()); c.addValue(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.annotations()); return c; }
/** * Creates the relationship clause with cardinality. * * @param restriction the restriction * @param fillerId the filler id * @param qvs the qvs * @param ax the ax * @return the clause */ protected Clause createRelationshipClauseWithCardinality( OWLObjectCardinalityRestriction restriction, String fillerId, Set<QualifierValue> qvs, OWLSubClassOfAxiom ax) { Clause c = new Clause(OboFormatTag.TAG_RELATIONSHIP.getTag()); c.addValue(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.annotations()); return c; }
c.setQualifierValues(qvs); f.addClause(c); addQualifiers(c, ax.annotations()); } else if (sup instanceof OWLObjectCardinalityRestriction) {
c.setQualifierValues(qvs); f.addClause(c); addQualifiers(c, ax.annotations()); } else if (sup instanceof OWLObjectCardinalityRestriction) {
c.setQualifierValues(qvs); f.addClause(c); addQualifiers(c, ax.annotations()); } else if (sup instanceof OWLObjectCardinalityRestriction) {
c.setQualifierValues(qvs); f.addClause(c); addQualifiers(c, ax.annotations()); } else if (sup instanceof OWLObjectCardinalityRestriction) {