public NodeSet<OWLObjectPropertyExpression> getSubObjectProperties(OWLObjectPropertyExpression arg0, boolean arg1) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { return reasoner.getSubObjectProperties(arg0, arg1); }
@Override public NodeSet<OWLObjectPropertyExpression> getSubObjectProperties( OWLObjectPropertyExpression pe, boolean direct) { return delegate_.getSubObjectProperties(pe, direct); }
@Override public NodeSet<OWLObjectPropertyExpression> getSubObjectProperties( OWLObjectPropertyExpression pe, boolean direct) { return delegate_.getSubObjectProperties(pe, direct); }
@Override public NodeSet<OWLObjectPropertyExpression> getSubObjectProperties( OWLObjectPropertyExpression pe, boolean direct) { return delegate_.getSubObjectProperties(pe, direct); }
@Override public synchronized NodeSet<OWLObjectPropertyExpression> getSubObjectProperties(OWLObjectPropertyExpression pe, boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { return r.getSubObjectProperties(pe, direct); }
/** * @param pe The object property expression whose strict (direct) super properties are to be * retrieved. * @return A {@code NodeSet} of <a href="#spe">simplified object property expressions</a>, such * that for each <a href="#spe">simplified object property expression</a>, {@code P}, in * the {@code NodeSet} the set of reasoner axioms entails * {@code StrictSubObjectPropertyOf(P, pe)}. <br> * If {@code pe} is equivalent to {@code owl:bottomObjectProperty} then the empty {@code * NodeSet} will be returned. * @see OWLReasoner#getSubObjectProperties(OWLObjectPropertyExpression, boolean) Gets the set of * all <a href="#spe">simplified object property expressions</a> that are the strict * (potentially direct) subproperties of the specified object property expression with * respect to the imports closure of the root ontology. Note that the properties are * returned as a {@link org.semanticweb.owlapi.reasoner.NodeSet}. */ default NodeSet<OWLObjectPropertyExpression> getSubObjectProperties( OWLObjectPropertyExpression pe) { return getSubObjectProperties(pe, false); }
/** * @param pe The object property expression whose strict (direct) super properties are to be * retrieved. * @return A {@code NodeSet} of <a href="#spe">simplified object property expressions</a>, such * that for each <a href="#spe">simplified object property expression</a>, {@code P}, in * the {@code NodeSet} the set of reasoner axioms entails * {@code StrictSubObjectPropertyOf(P, pe)}. <br> * If {@code pe} is equivalent to {@code owl:bottomObjectProperty} then the empty {@code * NodeSet} will be returned. * @see OWLReasoner#getSubObjectProperties(OWLObjectPropertyExpression, boolean) Gets the set of * all <a href="#spe">simplified object property expressions</a> that are the strict * (potentially direct) subproperties of the specified object property expression with * respect to the imports closure of the root ontology. Note that the properties are * returned as a {@link org.semanticweb.owlapi.reasoner.NodeSet}. */ default NodeSet<OWLObjectPropertyExpression> getSubObjectProperties( OWLObjectPropertyExpression pe) { return getSubObjectProperties(pe, false); }
/** * @param pe The object property expression whose strict (direct) super properties are to be * retrieved. * @return A {@code NodeSet} of <a href="#spe">simplified object property expressions</a>, such * that for each <a href="#spe">simplified object property expression</a>, {@code P}, in * the {@code NodeSet} the set of reasoner axioms entails * {@code StrictSubObjectPropertyOf(P, pe)}. <br> * If {@code pe} is equivalent to {@code owl:bottomObjectProperty} then the empty {@code * NodeSet} will be returned. * @see OWLReasoner#getSubObjectProperties(OWLObjectPropertyExpression, boolean) Gets the set of * all <a href="#spe">simplified object property expressions</a> that are the strict * (potentially direct) subproperties of the specified object property expression with * respect to the imports closure of the root ontology. Note that the properties are * returned as a {@link org.semanticweb.owlapi.reasoner.NodeSet}. */ default NodeSet<OWLObjectPropertyExpression> getSubObjectProperties( OWLObjectPropertyExpression pe) { return getSubObjectProperties(pe, false); }
@Override protected TreeSet<OWLObjectProperty> getSubPropertiesImpl(OWLObjectProperty objectProperty) { NodeSet<OWLObjectPropertyExpression> properties; try { properties = reasoner.getSubObjectProperties(objectProperty, true); } catch (UnsupportedOperationException e) { if (useFallbackReasoner) { properties = fallbackReasoner.getSubObjectProperties( objectProperty, true); } else { throw e; } } return getFirstObjectProperties(properties); }
public Set<OWLObjectProperty> getChildren(OWLObjectProperty objectProperty) { Set<OWLObjectPropertyExpression> subs = getReasoner().getSubObjectProperties(objectProperty, true).getFlattened(); subs.remove(objectProperty); Set<OWLObjectProperty> children = new HashSet<OWLObjectProperty>(); for (OWLObjectPropertyExpression p : subs) { if (p instanceof OWLObjectProperty) { children.add((OWLObjectProperty) p); } } return children; }
/** * @param pe The object property expression whose strict (direct) super properties are to be * retrieved. * @return A {@code NodeSet} of <a href="#spe">simplified object property expressions</a>, such * that for each <a href="#spe">simplified object property expression</a>, {@code P}, in * the {@code NodeSet} the set of reasoner axioms entails * {@code StrictSubObjectPropertyOf(P, pe)}. <br> * If {@code pe} is equivalent to {@code owl:bottomObjectProperty} then the empty {@code * NodeSet} will be returned. * @see OWLReasoner#getSubObjectProperties(OWLObjectPropertyExpression, boolean) Gets the set of * all <a href="#spe">simplified object property expressions</a> that are the strict * (potentially direct) subproperties of the specified object property expression with * respect to the imports closure of the root ontology. Note that the properties are * returned as a {@link org.semanticweb.owlapi.reasoner.NodeSet}. */ default Stream<OWLObjectPropertyExpression> subObjectProperties( OWLObjectPropertyExpression pe) { return getSubObjectProperties(pe, false).entities(); }
public Set<OWLObjectProperty> getChildren(OWLObjectProperty objectProperty) { Set<OWLObjectPropertyExpression> subs = getReasoner().getSubObjectProperties(objectProperty, true).getFlattened(); subs.remove(objectProperty); Set<OWLObjectProperty> children = new HashSet<OWLObjectProperty>(); for (OWLObjectPropertyExpression p : subs) { if (p instanceof OWLObjectProperty) { children.add((OWLObjectProperty) p); } } return children; }
/** * @param pe The object property expression whose strict (direct) super properties are to be * retrieved. * @return A {@code NodeSet} of <a href="#spe">simplified object property expressions</a>, such * that for each <a href="#spe">simplified object property expression</a>, {@code P}, in * the {@code NodeSet} the set of reasoner axioms entails * {@code StrictSubObjectPropertyOf(P, pe)}. <br> * If {@code pe} is equivalent to {@code owl:bottomObjectProperty} then the empty {@code * NodeSet} will be returned. * @see OWLReasoner#getSubObjectProperties(OWLObjectPropertyExpression, boolean) Gets the set of * all <a href="#spe">simplified object property expressions</a> that are the strict * (potentially direct) subproperties of the specified object property expression with * respect to the imports closure of the root ontology. Note that the properties are * returned as a {@link org.semanticweb.owlapi.reasoner.NodeSet}. */ default Stream<OWLObjectPropertyExpression> subObjectProperties( OWLObjectPropertyExpression pe) { return getSubObjectProperties(pe, false).entities(); }
/** * @param pe The object property expression whose strict (direct) super properties are to be * retrieved. * @return A {@code NodeSet} of <a href="#spe">simplified object property expressions</a>, such * that for each <a href="#spe">simplified object property expression</a>, {@code P}, in * the {@code NodeSet} the set of reasoner axioms entails * {@code StrictSubObjectPropertyOf(P, pe)}. <br> * If {@code pe} is equivalent to {@code owl:bottomObjectProperty} then the empty {@code * NodeSet} will be returned. * @see OWLReasoner#getSubObjectProperties(OWLObjectPropertyExpression, boolean) Gets the set of * all <a href="#spe">simplified object property expressions</a> that are the strict * (potentially direct) subproperties of the specified object property expression with * respect to the imports closure of the root ontology. Note that the properties are * returned as a {@link org.semanticweb.owlapi.reasoner.NodeSet}. */ default Stream<OWLObjectPropertyExpression> subObjectProperties( OWLObjectPropertyExpression pe) { return getSubObjectProperties(pe, false).entities(); }
/** * @param pe The object property expression whose strict (direct) super properties are to be * retrieved. * @param depth Specifies if the direct subproperties should be retrived ( {@code DIRECT}) or if * the all subproperties (descendants) should be retrieved ({@code ALL}). * @return If depth is {@code DIRECT}, a {@code NodeSet} of <a href="#spe">simplified object * property expressions</a>, such that for each <a href="#spe">simplified object * property expression</a>, {@code P}, in the {@code NodeSet} the set of reasoner axioms * entails {@code * DirectSubObjectPropertyOf(P, pe)}. <br> * If direct is {@code ALL}, a {@code NodeSet} of <a href="#spe">simplified object * property expressions</a>, such that for each <a href="#spe">simplified object * property expression</a>, {@code P}, in the {@code NodeSet} the set of reasoner axioms * entails {@code StrictSubObjectPropertyOf(P, pe)}. <br> * If {@code pe} is equivalent to {@code owl:bottomObjectProperty} then the empty * {@code NodeSet} will be returned. * @see OWLReasoner#getSubObjectProperties(OWLObjectPropertyExpression, boolean) Gets the set of * <a href="#spe">simplified object property expressions</a> that are the strict * (potentially direct) subproperties of the specified object property expression with * respect to the imports closure of the root ontology. Note that the properties are * returned as a {@link org.semanticweb.owlapi.reasoner.NodeSet}. */ default NodeSet<OWLObjectPropertyExpression> getSubObjectProperties( OWLObjectPropertyExpression pe, InferenceDepth depth) { return getSubObjectProperties(pe, depth.isDirectOnly()); }
@Override protected TreeSet<OWLObjectProperty> getSuperPropertiesImpl(OWLObjectProperty objectProperty) { NodeSet<OWLObjectPropertyExpression> properties; try { properties = reasoner .getSuperObjectProperties(objectProperty, true); } catch (UnsupportedOperationException e) { if (useFallbackReasoner) { properties = fallbackReasoner.getSubObjectProperties( objectProperty, true); } else { throw e; } } return getFirstObjectProperties(properties); }
public Set<OWLObjectProperty> getUnfilteredChildren(OWLObjectProperty objectProperty) { try { if(!getReasoner().isConsistent()) { return Collections.emptySet(); } Set<OWLObjectPropertyExpression> subs = getReasoner().getSubObjectProperties(objectProperty, true).getFlattened(); subs.remove(objectProperty); subs.remove(mngr.getOWLDataFactory().getOWLBottomObjectProperty()); Set<OWLObjectProperty> children = new HashSet<>(); for (OWLObjectPropertyExpression p : subs) { if (p instanceof OWLObjectProperty) { children.add((OWLObjectProperty) p); } } return children; } catch (Exception e) { logger.error("An error occurred whilst asking the reasoner for the sub-properties of an object property: {}", e.getMessage(), e); return Collections.emptySet(); } }
@Override public SortedSet<OWLClassExpression> visit(OWLObjectAllValuesFrom ce) { SortedSet<OWLClassExpression> refinements = new TreeSet<>(); OWLObjectPropertyExpression property = ce.getProperty(); OWLClassExpression filler = ce.getFiller(); // refine property Set<OWLObjectPropertyExpression> subProperties = reasoner.getSubObjectProperties(property, true).getFlattened(); for (OWLObjectPropertyExpression subProperty : subProperties) { refinements.add(dataFactory.getOWLObjectAllValuesFrom(subProperty, filler)); } // refine filler SortedSet<OWLClassExpression> fillerRefinements = refineNode(filler); for (OWLClassExpression fillerRefinement : fillerRefinements) { refinements.add(dataFactory.getOWLObjectAllValuesFrom(property, fillerRefinement)); } return refinements; }
@Override public SortedSet<OWLClassExpression> visit(OWLObjectSomeValuesFrom ce) { SortedSet<OWLClassExpression> refinements = new TreeSet<>(); OWLObjectPropertyExpression property = ce.getProperty(); OWLClassExpression filler = ce.getFiller(); // refine property Set<OWLObjectPropertyExpression> subProperties = reasoner.getSubObjectProperties(property, true).getFlattened(); for (OWLObjectPropertyExpression subProperty : subProperties) { refinements.add(dataFactory.getOWLObjectSomeValuesFrom(subProperty, filler)); } // refine filler SortedSet<OWLClassExpression> fillerRefinements = refineNode(filler); for (OWLClassExpression fillerRefinement : fillerRefinements) { refinements.add(dataFactory.getOWLObjectSomeValuesFrom(property, fillerRefinement)); } return refinements; }
private void populateObjectSubProperties(OWLObjectProperty op, OWLReasoner r, Model m) { for (OWLObjectPropertyExpression subOPE : r.getSubObjectProperties(op, false).getFlattened()) { if (!subOPE.isAnonymous()) { OWLObjectProperty subOP = subOPE.asOWLObjectProperty(); log.debug(subOP + " object sub-property of " + op); m.add(toResource(subOP), OWL_SUBPROPERTY_OF, toResource(op)); } } // getSubObjectProperties is strict, so add the reflexive statement. log.debug(op + " object sub-property of " + op); m.add(toResource(op), OWL_SUBPROPERTY_OF, toResource(op)); }