@Override public NodeSet<OWLNamedIndividual> getObjectPropertyValues( OWLNamedIndividual ind, OWLObjectPropertyExpression pe) { return delegate_.getObjectPropertyValues(ind, pe); }
@Override public NodeSet<OWLNamedIndividual> getObjectPropertyValues( OWLNamedIndividual ind, OWLObjectPropertyExpression pe) { return delegate_.getObjectPropertyValues(ind, pe); }
public NodeSet<OWLNamedIndividual> getObjectPropertyValues(OWLNamedIndividual arg0, OWLObjectPropertyExpression arg1) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { return reasoner.getObjectPropertyValues(arg0, arg1); }
@Override public NodeSet<OWLNamedIndividual> getObjectPropertyValues( OWLNamedIndividual ind, OWLObjectPropertyExpression pe) { return delegate_.getObjectPropertyValues(ind, pe); }
@Override public synchronized NodeSet<OWLNamedIndividual> getObjectPropertyValues(OWLNamedIndividual ind, OWLObjectPropertyExpression pe) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { return r.getObjectPropertyValues(ind, pe); }
@Override public Collection<OWLNamedIndividual> getPropertyValues(OWLNamedIndividual i, OWLObjectProperty p) { return reasoner.getObjectPropertyValues(i, p).getFlattened(); }
/** * Gets the object property values for the specified individual and object property expression. * The individuals are returned as a {@link org.semanticweb.owlapi.reasoner.NodeSet}. * * @param ind The individual that is the subject of the object property values * @param pe The object property expression whose values are to be retrieved for the specified * individual * @return A {@code NodeSet} containing named individuals such that for each individual {@code * j} in the node set, the set of reasoner axioms entails * {@code ObjectPropertyAssertion(pe ind * j)} . * @throws InconsistentOntologyException if the imports closure of the root ontology is * inconsistent * @throws FreshEntitiesException if the signature of the individual and property expression is * not contained within the signature of the imports closure of the root ontology and * the undeclared entity policy of this reasoner is set to * {@link FreshEntityPolicy#DISALLOW}. * @throws ReasonerInterruptedException if the reasoning process was interrupted for any * particular reason (for example if reasoning was cancelled by a client process) * @throws TimeOutException if the reasoner timed out during a basic reasoning operation. See * {@link #getTimeOut()}. * @see org.semanticweb.owlapi.reasoner.IndividualNodeSetPolicy */ default Stream<OWLNamedIndividual> objectPropertyValues(OWLNamedIndividual ind, OWLObjectPropertyExpression pe) { return getObjectPropertyValues(ind, pe).entities(); }
/** * Gets the object property values for the specified individual and object property expression. * The individuals are returned as a {@link org.semanticweb.owlapi.reasoner.NodeSet}. * * @param ind The individual that is the subject of the object property values * @param pe The object property expression whose values are to be retrieved for the specified * individual * @return A {@code NodeSet} containing named individuals such that for each individual {@code * j} in the node set, the set of reasoner axioms entails * {@code ObjectPropertyAssertion(pe ind * j)} . * @throws InconsistentOntologyException if the imports closure of the root ontology is * inconsistent * @throws FreshEntitiesException if the signature of the individual and property expression is * not contained within the signature of the imports closure of the root ontology and * the undeclared entity policy of this reasoner is set to * {@link FreshEntityPolicy#DISALLOW}. * @throws ReasonerInterruptedException if the reasoning process was interrupted for any * particular reason (for example if reasoning was cancelled by a client process) * @throws TimeOutException if the reasoner timed out during a basic reasoning operation. See * {@link #getTimeOut()}. * @see org.semanticweb.owlapi.reasoner.IndividualNodeSetPolicy */ default Stream<OWLNamedIndividual> objectPropertyValues(OWLNamedIndividual ind, OWLObjectPropertyExpression pe) { return getObjectPropertyValues(ind, pe).entities(); }
/** * @param subject subject * @param property property * @return all objects * @since 2.5.1 */ default Stream<OWLNamedIndividual> getObjects(final OWLNamedIndividual subject, final OWLObjectPropertyExpression property) { return getReasoner().getObjectPropertyValues(subject, property).entities(); }
/** * @param subject subject * @param property property * @return all objects * @since 2.5.1 */ default Stream<OWLNamedIndividual> getObjects(final OWLNamedIndividual subject, final OWLObjectPropertyExpression property) { return getReasoner().getObjectPropertyValues(subject, property).entities(); }
/** * @param subject subject * @param property property * @return all objects * @since 2.5.1 */ default Stream<OWLNamedIndividual> getObjects(final OWLNamedIndividual subject, final OWLObjectPropertyExpression property) { return getReasoner().getObjectPropertyValues(subject, property).entities(); }
@SuppressWarnings("unchecked") @Override public Set<OWLIndividual> getRelatedIndividualsImpl( OWLIndividual individual, OWLObjectProperty objectProperty) { Set<? extends OWLIndividual> namedIndividuals; try { namedIndividuals = reasoner.getObjectPropertyValues( individual.asOWLNamedIndividual(), objectProperty).getFlattened(); } catch (UnsupportedOperationException e) { if (useFallbackReasoner) { namedIndividuals = fallbackReasoner.getObjectPropertyValues( individual.asOWLNamedIndividual(), objectProperty).getFlattened(); } else { throw e; } } return (Set<OWLIndividual>) namedIndividuals; }
@Override protected void addAxioms(OWLNamedIndividual entity, OWLReasoner reasoner, OWLDataFactory dataFactory, Set<OWLPropertyAssertionAxiom<?, ?>> result) { checkNotNull(dataFactory, "dataFactory cannot be null"); checkNotNull(reasoner, "reasoner cannot be null"); checkNotNull(result, "result cannot be null"); checkNotNull(entity, "entity cannot be null"); reasoner.getRootOntology().objectPropertiesInSignature(INCLUDED) .forEach(p -> reasoner.getObjectPropertyValues(entity, p).entities() .forEach( i -> result.add(dataFactory.getOWLObjectPropertyAssertionAxiom(p, entity, i)))); reasoner.getRootOntology().dataPropertiesInSignature(INCLUDED) .forEach(p -> reasoner.getDataPropertyValues(entity, p) .forEach( v -> result.add(dataFactory.getOWLDataPropertyAssertionAxiom(p, entity, v)))); }
@Override protected void addAxioms(OWLNamedIndividual entity, OWLReasoner reasoner, OWLDataFactory dataFactory, Set<OWLPropertyAssertionAxiom<?, ?>> result) { checkNotNull(dataFactory, "dataFactory cannot be null"); checkNotNull(reasoner, "reasoner cannot be null"); checkNotNull(result, "result cannot be null"); checkNotNull(entity, "entity cannot be null"); reasoner.getRootOntology().objectPropertiesInSignature(INCLUDED) .forEach(p -> reasoner.getObjectPropertyValues(entity, p).entities() .forEach( i -> result.add(dataFactory.getOWLObjectPropertyAssertionAxiom(p, entity, i)))); reasoner.getRootOntology().dataPropertiesInSignature(INCLUDED) .forEach(p -> reasoner.getDataPropertyValues(entity, p) .forEach( v -> result.add(dataFactory.getOWLDataPropertyAssertionAxiom(p, entity, v)))); }
protected void addAxioms(OWLNamedIndividual entity, OWLReasoner reasoner, OWLDataFactory dataFactory, Set<OWLPropertyAssertionAxiom> result) { for (OWLObjectProperty prop : reasoner.getRootOntology().getObjectPropertiesInSignature(true)) { for (OWLNamedIndividual value : reasoner.getObjectPropertyValues(entity, prop).getFlattened()) { result.add(dataFactory.getOWLObjectPropertyAssertionAxiom(prop, entity, value)); } } for (OWLDataProperty prop : reasoner.getRootOntology().getDataPropertiesInSignature(true)) { for (OWLLiteral value : reasoner.getDataPropertyValues(entity, prop)) { result.add(dataFactory.getOWLDataPropertyAssertionAxiom(prop, entity, value)); } } }
@Override protected void addAxioms(OWLNamedIndividual entity, OWLReasoner reasoner, OWLDataFactory dataFactory, Set<OWLPropertyAssertionAxiom<?, ?>> result) { checkNotNull(dataFactory, "dataFactory cannot be null"); checkNotNull(reasoner, "reasoner cannot be null"); checkNotNull(result, "result cannot be null"); checkNotNull(entity, "entity cannot be null"); reasoner.getRootOntology().objectPropertiesInSignature(INCLUDED) .forEach(p -> reasoner.getObjectPropertyValues(entity, p).entities() .forEach( i -> result.add(dataFactory.getOWLObjectPropertyAssertionAxiom(p, entity, i)))); reasoner.getRootOntology().dataPropertiesInSignature(INCLUDED) .forEach(p -> reasoner.getDataPropertyValues(entity, p) .forEach( v -> result.add(dataFactory.getOWLDataPropertyAssertionAxiom(p, entity, v)))); }
public void run() { if (!getOWLModelManager().getReasoner().isConsistent()) { return; } OWLDataFactory factory = getOWLDataFactory(); if (!getRootObject().isAnonymous()){ for (OWLObjectProperty prop : getReasoner().getRootOntology().getObjectPropertiesInSignature(true)) { if (prop.equals(factory.getOWLTopObjectProperty())) { continue; } NodeSet<OWLNamedIndividual> values = getReasoner().getObjectPropertyValues(getRootObject().asOWLNamedIndividual(), prop); for (OWLNamedIndividual ind : values.getFlattened()) { OWLObjectPropertyAssertionAxiom ax = getOWLDataFactory().getOWLObjectPropertyAssertionAxiom(prop, getRootObject(), ind); if (!added.contains(ax)) { addRow(new OWLObjectPropertyAssertionAxiomFrameSectionRow(getOWLEditorKit(), OWLObjectPropertyAssertionAxiomFrameSection.this, null, getRootObject(), ax)); } } } } } });
public void run() { if (!getOWLModelManager().getReasoner().isConsistent()) { return; } OWLDataFactory factory = getOWLDataFactory(); if (!getRootObject().isAnonymous()){ for (OWLObjectProperty prop : getReasoner().getRootOntology().getObjectPropertiesInSignature(true)) { if (prop.equals(factory.getOWLTopObjectProperty())) { continue; } NodeSet<OWLNamedIndividual> values = getReasoner().getObjectPropertyValues(getRootObject().asOWLNamedIndividual(), prop); for (OWLNamedIndividual ind : values.getFlattened()) { OWLObjectPropertyAssertionAxiom ax = getOWLDataFactory().getOWLObjectPropertyAssertionAxiom(prop, getRootObject(), ind); if (!added.contains(ax)) { addRow(new OWLObjectPropertyAssertionAxiomFrameSectionRow(getOWLEditorKit(), OWLObjectPropertyAssertionAxiomFrameSection.this, null, getRootObject(), ax)); } } } } } });
protected void refillInferred() { getOWLModelManager().getReasonerPreferences().executeTask(OptionalInferenceTask.SHOW_INFERRED_OBJECT_PROPERTY_ASSERTIONS, () -> { if (!getOWLModelManager().getReasoner().isConsistent()) { return; } OWLDataFactory factory = getOWLDataFactory(); if (!getRootObject().isAnonymous()){ for (OWLObjectProperty prop : getReasoner().getRootOntology().getObjectPropertiesInSignature(true)) { if (prop.equals(factory.getOWLTopObjectProperty())) { continue; } NodeSet<OWLNamedIndividual> values = getReasoner().getObjectPropertyValues(getRootObject().asOWLNamedIndividual(), prop); for (OWLNamedIndividual ind : values.getFlattened()) { OWLObjectPropertyAssertionAxiom ax = getOWLDataFactory().getOWLObjectPropertyAssertionAxiom(prop, getRootObject(), ind); if (!added.contains(ax)) { addRow(new OWLObjectPropertyAssertionAxiomFrameSectionRow(getOWLEditorKit(), OWLObjectPropertyAssertionAxiomFrameSection.this, null, getRootObject(), ax)); } } } } }); }
Assert.assertTrue(reasoner.getObjectPropertyValues(a, r).containsEntity(b)); Assert.assertTrue(reasoner.getObjectPropertyValues(b, inverseR).containsEntity(a)); Assert.assertFalse(reasoner.getObjectPropertyValues(a, r).containsEntity(b)); Assert.assertFalse(reasoner.getObjectPropertyValues(b, inverseR).containsEntity(a));