public void removeNode(T containing) { Node<T> node = map.remove(containing); if (node != null) { node.entities().forEach(map::remove); } } }
public void removeNode(T containing) { Node<T> node = map.remove(containing); if (node != null) { node.entities().forEach(map::remove); } } }
public void removeNode(T containing) { Node<T> node = map.remove(containing); if (node != null) { node.entities().forEach(map::remove); } } }
/** * Gets the entities contained in this node. The entities are equivalent to * each other. * * @return The set of entities contained in this {@code Node}. * @deprecated use {@link #entities()} */ @Deprecated default Set<E> getEntities() { return asSet(entities()); }
/** * Gets the entities contained in this node. The entities are equivalent to * each other. * * @return The set of entities contained in this {@code Node}. * @deprecated use {@link #entities()} */ @Deprecated default Set<E> getEntities() { return asSet(entities()); }
/** * Gets the {@code Node} corresponding to the bottom node (containing {@code owl:Nothing}) in * the class hierarchy. * * @return A {@code Node} containing {@code owl:Nothing} that is the bottom node in the class * hierarchy. This {@code Node} is essentially equal to the {@code Node} that will be * returned by calling * {@link #getEquivalentClasses(org.semanticweb.owlapi.model.OWLClassExpression)} with a * parameter of {@code owl:Nothing}. */ default Stream<OWLClass> bottomClassNode() { return getBottomClassNode().entities(); }
/** * Gets the {@code Node} corresponding to the bottom node (containing * {@code owl:bottomObjectProperty}) in the object property hierarchy. * * @return A {@code Node}, containing {@code owl:bottomObjectProperty}, that is the bottom node * in the object property hierarchy. This {@code Node} is essentially equal to the * {@code Node} that will be returned by calling * {@link #getEquivalentObjectProperties(org.semanticweb.owlapi.model.OWLObjectPropertyExpression)} * with a parameter of {@code owl:bottomObjectProperty}. */ default Stream<OWLObjectPropertyExpression> bottomObjectPropertyNode() { return getBottomObjectPropertyNode().entities(); }
/** * Gets the {@code Node} corresponding to the top node (containing {@code owl:topDataProperty}) * in the data property hierarchy. * * @return A {@code Node}, containing {@code owl:topDataProperty}, that is the top node in the * data property hierarchy. This {@code Node} is essentially equal to the {@code Node} * returned by calling * {@link #getEquivalentDataProperties(org.semanticweb.owlapi.model.OWLDataProperty)} * with a parameter of {@code owl:topDataProperty}. */ default Stream<OWLDataProperty> topDataPropertyNode() { return getTopDataPropertyNode().entities(); }
/** * @param node node */ public IndividualSynsetImpl(Node<OWLNamedIndividual> node) { this(asList(node.entities(), OWLIndividual.class)); }
public void addNode(Node<T> node) { node.entities().forEach(e -> { map.put(e, node); if (e.isTopEntity()) { topNode = node; } else if (e.isBottomEntity()) { bottomNode = node; } }); }
public void addNode(Node<T> node) { node.entities().forEach(e -> { map.put(e, node); if (e.isTopEntity()) { topNode = node; } else if (e.isBottomEntity()) { bottomNode = node; } }); }
public void addNode(Node<T> node) { node.entities().forEach(e -> { map.put(e, node); if (e.isTopEntity()) { topNode = node; } else if (e.isBottomEntity()) { bottomNode = node; } }); }
@Override protected void addAxioms(OWLClass entity, OWLReasoner reasoner, OWLDataFactory dataFactory, Set<OWLEquivalentClassesAxiom> result) { Set<OWLClassExpression> equivalentClasses = asUnorderedSet( reasoner.getEquivalentClasses(entity).entities(), OWLClassExpression.class); equivalentClasses.add(entity); if (equivalentClasses.size() > 1) { result.add(dataFactory.getOWLEquivalentClassesAxiom(equivalentClasses)); } }
@Override protected void addAxioms(OWLDataProperty entity, OWLReasoner reasoner, OWLDataFactory dataFactory, Set<OWLEquivalentDataPropertiesAxiom> result) { Set<OWLDataProperty> props = asUnorderedSet( reasoner.getEquivalentDataProperties(entity).entities()); props.add(entity); if (props.size() > 1) { result.add(dataFactory.getOWLEquivalentDataPropertiesAxiom(props)); } }
@Override protected void addAxioms(OWLDataProperty entity, OWLReasoner reasoner, OWLDataFactory dataFactory, Set<OWLEquivalentDataPropertiesAxiom> result) { Set<OWLDataProperty> props = asUnorderedSet( reasoner.getEquivalentDataProperties(entity).entities()); props.add(entity); if (props.size() > 1) { result.add(dataFactory.getOWLEquivalentDataPropertiesAxiom(props)); } }
@Override protected void addAxioms(OWLClass entity, OWLReasoner reasoner, OWLDataFactory dataFactory, Set<OWLEquivalentClassesAxiom> result) { Set<OWLClassExpression> equivalentClasses = asUnorderedSet( reasoner.getEquivalentClasses(entity).entities(), OWLClassExpression.class); equivalentClasses.add(entity); if (equivalentClasses.size() > 1) { result.add(dataFactory.getOWLEquivalentClassesAxiom(equivalentClasses)); } }
@Override protected void addAxioms(OWLClass entity, OWLReasoner reasoner, OWLDataFactory dataFactory, Set<OWLDisjointClassesAxiom> result) { reasoner.precomputeInferences(InferenceType.DISJOINT_CLASSES); reasoner.getDisjointClasses(entity).forEach(cls -> cls.entities() .forEach(c -> result.add(dataFactory.getOWLDisjointClassesAxiom(entity, c)))); }
@Override protected void addAxioms(OWLClass entity, OWLReasoner reasoner, OWLDataFactory dataFactory, Set<OWLDisjointClassesAxiom> result) { reasoner.precomputeInferences(InferenceType.DISJOINT_CLASSES); reasoner.getDisjointClasses(entity).forEach(cls -> cls.entities() .forEach(c -> result.add(dataFactory.getOWLDisjointClassesAxiom(entity, c)))); }
/** * Test for #447 */ @Test public void testGetUnsatClasses() { createReasoner(OWL.disjointClasses(_A, _B), OWL.equivalentClasses(_C, OWL.and(_A, _B))); assertStreamAsSetEquals(Stream.of(_C, OWL.Nothing), _reasoner.getUnsatisfiableClasses().entities()); assertStreamAsSetEquals(Stream.of(_C, OWL.Nothing), _reasoner.getEquivalentClasses(_C).entities()); }
@Test public void testObjectRangeWithEquivalents() { createReasoner(OWL.equivalentClasses(_C, some(inverse(_p), OWL.Thing)), OWL.range(_p, _D), OWL.subClassOf(_C, _E)); _reasoner.getKB().printClassTree(); assertTrue(_reasoner.isEntailed(OWL.range(_p, _C))); assertStreamAsSetEquals(Stream.of(_C), _reasoner.getEquivalentClasses(some(inverse(_p), OWL.Thing)).entities()); assertStreamAsSetEquals(Stream.of(_C), _reasoner.getObjectPropertyRanges(_p, true).entities()); assertStreamAsSetEquals(Stream.of(_C, _D, _E, OWL.Thing), _reasoner.getObjectPropertyRanges(_p, false).entities()); }