@Override public NodeSet<OWLNamedIndividual> getInstances(OWLClassExpression ce, boolean direct) { return delegate_.getInstances(ce, direct); }
@Override public NodeSet<OWLNamedIndividual> getInstances(OWLClassExpression ce, boolean direct) { return delegate_.getInstances(ce, direct); }
@Override public NodeSet<OWLNamedIndividual> getInstances(OWLClassExpression ce, boolean direct) { return delegate_.getInstances(ce, direct); }
public NodeSet<OWLNamedIndividual> getInstances(OWLClassExpression arg0, boolean arg1) throws InconsistentOntologyException, ClassExpressionNotInProfileException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { return reasoner.getInstances(arg0, arg1); }
@Override public synchronized NodeSet<OWLNamedIndividual> getInstances(OWLClassExpression ce, boolean direct) throws InconsistentOntologyException, ClassExpressionNotInProfileException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { return r.getInstances(ce, direct); }
/** * @param ce The class expression whose instances are to be retrieved. * @return a {@code NodeSet} containing named individuals such that for each named individual * {@code j} in the node set, the set of reasoner axioms entails * {@code ClassAssertion(ce, j)}. <br> * If ce is unsatisfiable with respect to the set of reasoner axioms then the empty * {@code * NodeSet} is returned. * @see OWLReasoner#getInstances(OWLClassExpression, boolean) Gets the individuals which are * instances of the specified class expression. The individuals are returned a a * {@link org.semanticweb.owlapi.reasoner.NodeSet}. */ default NodeSet<OWLNamedIndividual> getInstances(OWLClassExpression ce) { return getInstances(ce, false); }
/** * @param ce The class expression whose instances are to be retrieved. * @return a {@code NodeSet} containing named individuals such that for each named individual * {@code j} in the node set, the set of reasoner axioms entails * {@code ClassAssertion(ce, j)}. <br> * If ce is unsatisfiable with respect to the set of reasoner axioms then the empty * {@code * NodeSet} is returned. * @see OWLReasoner#getInstances(OWLClassExpression, boolean) Gets the individuals which are * instances of the specified class expression. The individuals are returned a a * {@link org.semanticweb.owlapi.reasoner.NodeSet}. */ default NodeSet<OWLNamedIndividual> getInstances(OWLClassExpression ce) { return getInstances(ce, false); }
@Override public Collection<OWLNamedIndividual> getIndividuals(OWLClass owlClass) { return reasoner.getInstances(owlClass, false).getFlattened(); }
/** * @param ce The class expression whose instances are to be retrieved. * @return a {@code Stream} containing named individuals such that for each named individual * {@code j} in the node set, the set of reasoner axioms entails * {@code ClassAssertion(ce, j)}. <br> * If ce is unsatisfiable with respect to the set of reasoner axioms then the empty * {@code * NodeSet} is returned. * @see OWLReasoner#getInstances(OWLClassExpression, boolean) Gets the individuals which are * instances of the specified class expression. The individuals are returned a a * {@link org.semanticweb.owlapi.reasoner.NodeSet}. */ default Stream<OWLNamedIndividual> instances(OWLClassExpression ce) { return getInstances(ce, false).entities(); }
/** * @param ce The class expression whose instances are to be retrieved. * @return a {@code Stream} containing named individuals such that for each named individual * {@code j} in the node set, the set of reasoner axioms entails * {@code ClassAssertion(ce, j)}. <br> * If ce is unsatisfiable with respect to the set of reasoner axioms then the empty * {@code * NodeSet} is returned. * @see OWLReasoner#getInstances(OWLClassExpression, boolean) Gets the individuals which are * instances of the specified class expression. The individuals are returned a a * {@link org.semanticweb.owlapi.reasoner.NodeSet}. */ default Stream<OWLNamedIndividual> instances(OWLClassExpression ce) { return getInstances(ce, false).entities(); }
/** * @param ce The class expression whose instances are to be retrieved. * @return a {@code Stream} containing named individuals (if the reasoner uses * {@code IndividualNodeSetPolicy#BY_SAME_AS}, only the representative individuals will * be listed) such that for each named individual {@code j} in the node set, the set of * reasoner axioms entails {@code ClassAssertion(ce, j)}. <br> * If ce is unsatisfiable with respect to the set of reasoner axioms then the empty * {@code * NodeSet} is returned. * @see OWLReasoner#getInstances(OWLClassExpression, boolean) Gets the individuals which are * instances of the specified class expression. The individuals are returned a a * {@link org.semanticweb.owlapi.reasoner.NodeSet}. */ default Stream<OWLNamedIndividual> representativeInstances(OWLClassExpression ce) { return getIndividualNodeSetPolicy().filter(getInstances(ce, false)); }
private void rebuild() { typeNodes.clear(); if (reasoner != null){ Set<OWLOntology> importsClosure = reasoner.getRootOntology().getImportsClosure(); for (OWLOntology ont : importsClosure){ for (OWLClass cls : ont.getClassesInSignature()) { final Set<OWLNamedIndividual> inds = reasoner.getInstances(cls, showDirect).getFlattened(); if (!inds.isEmpty()){ typeNodes.put(cls, new HashSet<>(inds)); } } } } fireHierarchyChanged(); }
private void rebuild() { typeNodes.clear(); if (reasoner != null){ Set<OWLOntology> importsClosure = reasoner.getRootOntology().getImportsClosure(); for (OWLOntology ont : importsClosure){ for (OWLClass cls : ont.getClassesInSignature()) { final Set<OWLNamedIndividual> inds = reasoner.getInstances(cls, showDirect).getFlattened(); if (!inds.isEmpty()){ typeNodes.put(cls, new HashSet<>(inds)); } } } } fireHierarchyChanged(); }
private static void printIndividualsByclass(OWLOntology ontology, String owlClass){ OWLReasonerFactory reasonerFactory = new PelletReasonerFactory(); OWLReasoner reasoner = reasonerFactory.createNonBufferingReasoner(ontology); for (OWLClass c : ontology.getClassesInSignature()) { if (c.getIRI().getShortForm().equals(owlClass)){ NodeSet<OWLNamedIndividual> instances = reasoner.getInstances(c, false); System.out.println("Class : "+ c.getIRI().getShortForm()); for (OWLNamedIndividual i : instances.getFlattened()) { System.out.println(i.getIRI().getShortForm()); } } } }
public static void assertInstancesEquals(final OWLReasoner expected, final OWLReasoner actual, final OWLClass cls) { final Stream<OWLNamedIndividual> expectedIndividuals = expected.getInstances(cls, true).entities(); final Stream<OWLNamedIndividual> actualIndividuals = actual.getInstances(cls, true).entities(); assertStreamEquals("Instances different for Class: " + cls, expectedIndividuals, actualIndividuals); }
public static void assertTypesEquals(final OWLReasoner expected, final OWLReasoner actual) { actual.getInstances(OWL.Thing, false).entities().forEach(ind -> assertTypesEquals(expected, actual, ind)); }
private void recalculateInferredOwlClass(OWLReasoner reasoner) { if (inferredOwlClass == null || !reasoner.getInstances(owlClass, true).containsEntity(individual.asOWLNamedIndividual())) { inferredOwlClass = null; for (OWLClass cls : reasoner.getTypes(individual.asOWLNamedIndividual(), true).getFlattened()) { inferredOwlClass = cls; break; } } }
private void recalculateInferredOwlClass(OWLReasoner reasoner) { if (inferredOwlClass == null || !reasoner.getInstances(owlClass, true).containsEntity(individual.asOWLNamedIndividual())) { inferredOwlClass = null; for (OWLClass cls : reasoner.getTypes(individual.asOWLNamedIndividual(), true).getFlattened()) { inferredOwlClass = cls; break; } } }
private void recalculateInferredOwlClass(OWLReasoner reasoner) { if (inferredOwlClass == null || !reasoner.getInstances(owlClass, true).containsEntity(individual.asOWLNamedIndividual())) { inferredOwlClass = null; for (OWLClass cls : reasoner.getTypes(individual.asOWLNamedIndividual(), true).getFlattened()) { inferredOwlClass = cls; break; } } }
private void recalculateInferredOwlClass(OWLReasoner reasoner) { if (inferredOwlClass == null || !reasoner.getInstances(owlClass, true).containsEntity(individual.asOWLNamedIndividual())) { inferredOwlClass = null; for (OWLClass cls : reasoner.getTypes(individual.asOWLNamedIndividual(), true).getFlattened()) { inferredOwlClass = cls; break; } } }