/** * @return all object properties with its range. */ public Map<OWLObjectProperty, OWLClassExpression> getObjectPropertyRanges() { Map<OWLObjectProperty, OWLClassExpression> result = new HashMap<>(); for (OWLObjectProperty op : getObjectProperties()) { OWLClassExpression range = getRange(op); result.put(op, range); } return result; }
types.add(reasoner.getRange(OwlApiJenaUtils.asOWLEntity(edge, EntityType.OBJECT_PROPERTY))); } else { types.add(reasoner.getDomain(OwlApiJenaUtils.asOWLEntity(edge, EntityType.OBJECT_PROPERTY))); types.add(reasoner.getDomain(OwlApiJenaUtils.asOWLEntity(inEdge, EntityType.OBJECT_PROPERTY))); } else { types.add(reasoner.getRange(OwlApiJenaUtils.asOWLEntity(inEdge, EntityType.OBJECT_PROPERTY)));
/** * The goal of this method is to rewrite the class expression CE, to get a more informative one by e.g. * <ul><li>replacing the role fillers in CE with the range of the property, if exists.</li></ul> * @param ce the class expression * @return the modified class expression */ protected OWLClassExpression getNiceDescription(OWLClassExpression ce){ OWLClassExpression rewrittenClassExpression = ce; if(ce instanceof OWLObjectIntersectionOf){ Set<OWLClassExpression> newOperands = new TreeSet<>(((OWLObjectIntersectionOf) ce).getOperands()); for (OWLClassExpression operand : ((OWLObjectIntersectionOf) ce).getOperands()) { newOperands.add(getNiceDescription(operand)); } rewrittenClassExpression = dataFactory.getOWLObjectIntersectionOf(newOperands); } else if(ce instanceof OWLObjectSomeValuesFrom) { // \exists r.\bot \equiv \bot OWLObjectProperty property = ((OWLObjectSomeValuesFrom) ce).getProperty().asOWLObjectProperty(); OWLClassExpression filler = ((OWLObjectSomeValuesFrom) ce).getFiller(); if(filler.isOWLThing()) { OWLClassExpression range = reasoner.getRange(property); filler = range; } else if(filler.isAnonymous()){ filler = getNiceDescription(filler); } rewrittenClassExpression = dataFactory.getOWLObjectSomeValuesFrom(property, filler); } return rewrittenClassExpression; } }
filler = rs.getRange(pe.asOWLObjectProperty()); } else if(filler.isAnonymous()){ filler = replaceRange(filler, rs);