@Override public void addToOntology() { OWLObjectProperty property = featurePool.getExclusiveProperty(":objectAllValuesFromProperty"); OWLClass range = featurePool.getExclusiveClass(":ObjectAllValuesFromRange"); OWLObjectAllValuesFrom restriction = factory.getOWLObjectAllValuesFrom(property, range); OWLClass allValuesFrom = featurePool.getExclusiveClass(":ObjectAllValuesFrom"); addAxiomToOntology(factory.getOWLSubClassOfAxiom(allValuesFrom, restriction)); }
public void visit(OWLObjectAllValuesFrom arg0) { try { OWLObjectProperty op = Utils.ensureObjectProperty(arg0.getProperty()); OWLClass clz = Utils.ensureClass(arg0.getFiller()); integrityConstraints.add(integrityConstraintFactory .ObjectPropertyRangeConstraint(subjClass, op, clz)); } catch (UnsupportedICException e) { notSupported(arg0); } }
public OWLClassExpression visit(OWLObjectAllValuesFrom object) { m_axioms.m_objectPropertiesOccurringInOWLAxioms.add(object.getProperty().getNamedProperty()); OWLClassExpression filler=object.getFiller(); if (isSimple(filler) || isNominal(filler) || isNegatedOneNominal(filler)) // The nominal cases are optimizations. return object; else { OWLClassExpression definition=getDefinitionFor(filler,m_alreadyExists); if (!m_alreadyExists[0]) m_newInclusions.add(new OWLClassExpression[] { negative(definition),filler }); return m_factory.getOWLObjectAllValuesFrom(object.getProperty(),definition); } }
public OWLClassExpression visit(OWLObjectAllValuesFrom d) { OWLClassExpression filler=getSimplified(d.getFiller()); if (filler.isOWLThing()) return m_factory.getOWLThing(); else return m_factory.getOWLObjectAllValuesFrom(d.getProperty().getSimplified(),filler); }
@Override public OWLObjectAllValuesFrom visit(OWLObjectAllValuesFrom ce) { if (LOG.isDebugEnabled()) { LOG.debug("Unfolding all_values_from: "+ce); } OWLClassExpression filler = ce.getFiller(); if (filler != null) { OWLClassExpression unfold = filler.accept(this); if (unfold != null) { return factory.getOWLObjectAllValuesFrom(ce.getProperty(), unfold); } } return null; }
@Override public Void visit(OWLObjectAllValuesFrom desc) { long restriction = getOrCreateNode(getIri(desc), OwlLabels.OWL_ALL_VALUES_FROM, OwlLabels.OWL_ANONYMOUS); if (!desc.getProperty().isAnonymous()) { long property = getOrCreateNode(getIri(desc.getProperty())); getOrCreateRelationship(restriction, property, OwlRelationships.PROPERTY); long cls = getOrCreateNode(getIri(desc.getFiller())); getOrCreateRelationship(restriction, cls, OwlRelationships.FILLER); } return null; }
@Override public OWLClassExpression visit(OWLObjectAllValuesFrom ce) { OWLClassExpression filler = ce.getFiller(); OWLClassExpression shortenedFiller = filler.accept(this); if(shortenedFiller.isOWLThing()){// \forall r.\top \equiv \top return df.getOWLThing(); } else if(beautify && shortenedFiller.isOWLNothing()) {// \forall r.\bot to \neg \exists r.\top return df.getOWLObjectComplementOf(df.getOWLObjectSomeValuesFrom(ce.getProperty(), df.getOWLThing())); } else if(!filler.equals(shortenedFiller)){ return df.getOWLObjectAllValuesFrom(ce.getProperty(), shortenedFiller); } return ce; }
@Override public OWLClassExpression visit(OWLObjectAllValuesFrom ce) { OWLClassExpression filler = ce.getFiller().accept(this); if (negated) { return dataFactory.getOWLObjectSomeValuesFrom(ce.getProperty(), filler); } else { return dataFactory.getOWLObjectAllValuesFrom(ce.getProperty(), filler); } }
@Override public Set<OWLClassExpression> visit(OWLObjectAllValuesFrom ce) { Set<OWLClassExpression> result = new HashSet<>(); result.add(ce); result.addAll(ce.getFiller().accept(this)); return result; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } return obj instanceof OWLObjectAllValuesFrom; }
public void visit(OWLObjectAllValuesFrom object) { visitProperty(object.getProperty()); object.getFiller().accept(this); }
public void visit(OWLObjectPropertyDomainAxiom axiom) { OWLObjectAllValuesFrom allPropertyNohting=m_factory.getOWLObjectAllValuesFrom(axiom.getProperty().getSimplified(),m_factory.getOWLNothing()); m_classExpressionInclusionsAsDisjunctions.add(new OWLClassExpression[] { positive(axiom.getDomain()),allPropertyNohting }); m_axioms.m_objectPropertiesOccurringInOWLAxioms.add(axiom.getProperty().getNamedProperty()); }
public void visit(OWLObjectPropertyRangeAxiom axiom) { OWLObjectAllValuesFrom allPropertyRange=m_factory.getOWLObjectAllValuesFrom(axiom.getProperty().getSimplified(),positive(axiom.getRange())); m_classExpressionInclusionsAsDisjunctions.add(new OWLClassExpression[] { allPropertyRange }); }
public Boolean visit(OWLObjectAllValuesFrom object) { return object.getFiller().accept(this); }
public OWLClassExpression visit(OWLObjectAllValuesFrom d) { OWLClassExpression filler=getNNF(d.getFiller()); return m_factory.getOWLObjectAllValuesFrom(d.getProperty().getSimplified(),filler); }
public OWLClassExpression visit(OWLObjectAllValuesFrom d) { OWLClassExpression filler=getComplementNNF(d.getFiller()); return m_factory.getOWLObjectSomeValuesFrom(d.getProperty().getSimplified(),filler); }
@Override public OWLObjectAllValuesFrom visit(ElkObjectAllValuesFrom expression) { return owlFactory_.getOWLObjectAllValuesFrom( convert(expression.getProperty()), convert(expression.getFiller())); }
@Override public ElkObjectAllValuesFrom visit( OWLObjectAllValuesFrom owlObjectAllValuesFrom) { return CONVERTER.convert(owlObjectAllValuesFrom); }
@SuppressWarnings("static-method") public ElkObjectAllValuesFrom convert( OWLObjectAllValuesFrom owlObjectAllValuesFrom) { return new ElkObjectAllValuesFromWrap<OWLObjectAllValuesFrom>( owlObjectAllValuesFrom); }
/** * makes a reduced union expression. * * Uses the following two reduction rules: * * (r1 some X) U (r2 some Y) ==> lcs(r1,r2) some MakeUnionOf(X,Y) * (r1 some X) U X ==> reflexive-version-of-r1 some X * * TODO: test for (r some r some X) u (r some X) cases. needs to be done over final expression. * * if a reduced form cannot be made, returns null * * @param xa * @param xb * @return class expression */ private OWLClassExpression makeUnionUsingReflexiveProperty(OWLClassExpression xa, OWLClassExpression xb) { LOG.info("testing if there is a more compact union expression for "+xa+" ++ "+xb); OWLDataFactory df = graph.getDataFactory(); if (xa instanceof OWLQuantifiedRestriction) { // TODO - check before casting OWLObjectProperty prop = (OWLObjectProperty) ((OWLQuantifiedRestriction) xa).getProperty(); OWLClassExpression xaRest = (OWLClassExpression) ((OWLQuantifiedRestriction)xa).getFiller(); if (xb instanceof OWLQuantifiedRestriction) { OWLObjectPropertyExpression p2 = propertySubsumer(prop, ((OWLQuantifiedObjectRestriction) xb).getProperty()); if (p2 != null) { OWLClassExpression xbRest = (OWLClassExpression) ((OWLQuantifiedRestriction)xb).getFiller(); OWLClassExpression x = makeUnionWithReduction(xaRest,xbRest); // todo - mixing some and all if (xa instanceof OWLObjectSomeValuesFrom) return df.getOWLObjectSomeValuesFrom(p2,x); else if (xa instanceof OWLObjectAllValuesFrom) return df.getOWLObjectAllValuesFrom(p2, x); } } LOG.info(" test: "+xaRest+" == "+xb); if (xaRest.equals(xb)) { LOG.info(" TRUE: "+xaRest+" == "+xb); OWLObjectProperty rprop = null; if (graph.getIsReflexive(prop)) { rprop = prop; } if (forceReflexivePropertyCreation) { OWLOntologyManager manager = graph.getManager(); OWLOntology ont = graph.getSourceOntology(); rprop = df.getOWLObjectProperty(IRI.create(prop.getIRI().toString()+"_reflexive")); manager.applyChange(new AddAxiom(ont, df.getOWLSubObjectPropertyOfAxiom(prop, rprop))); manager.applyChange(new AddAxiom(ont, df.getOWLTransitiveObjectPropertyAxiom(rprop))); LOG.info(" reflexive prop:"+rprop); } if (rprop != null) { if (xa instanceof OWLObjectSomeValuesFrom) return df.getOWLObjectSomeValuesFrom(rprop,xb); else if (xa instanceof OWLObjectAllValuesFrom) return df.getOWLObjectAllValuesFrom(rprop, xb); } } } return null; }
@Override public HandlerResult visit(OWLObjectAllValuesFrom ce) { return ce.getFiller().accept(this); }
public void visit(OWLObjectAllValuesFrom arg0) { writer.print("ForAll "); writer.print(arg0.getProperty().getNamedProperty().getIRI().getFragment()); writer.print("."); arg0.getFiller().accept(this); }
public ObjectPropertyRestriction(ClassBox source, OWLObjectAllValuesFrom ex, OWLHelper helper) throws RendererException { super(source, helper.getVertex(getTarget(ex))); this.p = ex.getProperty().asOWLObjectProperty(); this.role = helper.shorten(this.p.getIRI()); this.multiplicity = Multiplicity.create(0, (helper.isFunctional(this.p.getIRI()) ? 1 : null)); }
@Override public Boolean visit(OWLObjectAllValuesFrom classExpression) { return false; }