Package org.semanticweb.owlapi.reasoner
Interface Node<E extends OWLObject>
- Type Parameters:
E
- the type of elements represented in the Node
- All Superinterfaces:
Iterable<E>
- All Known Implementing Classes:
DefaultNode
,OWLClassNode
,OWLDataPropertyNode
,OWLDatatypeNode
,OWLNamedIndividualNode
,OWLObjectPropertyNode
Represents a node (set) of entities. The entities in a node are equivalent to each other.
In a data property hierarchy, the nodes contain

Nodes in hierarchies
In the OWL API, a reasoner treats a class hierarchy, an object property hierarchy or a data property hierarchy as a hierarchy (directed acyclic graph - DAG) ofNodes
. Each node contains entities that are equivalent to each other. A hierarchy
contains a top node, which is the ancestor of all nodes in the hierarchy, and a bottom
node In a class hierarchy, the nodes contain OWLClass
objects. The top node contains
owl:Thing
(and any other named classes that are equivalent to owl:Thing
). The
bottom node contains owl:Nothing
(and any other named classes that are equivalent to
owl:Nothing
- these classes are unsatisfiable In an object property hierarchy, the
nodes contain OWLObjectProperty
objects. The top node contains
owl:topObjectProperty
(and any other named object properties that are equivalent to
owl:topObjectProperty
). The bottom node contains owl:bottomObjectProperty
(and
any other named object properties that are equivalent to owl:bottomObjectProperty
). In a data property hierarchy, the nodes contain
OWLDataProperty
objects. The top node
contains owl:topDataProperty
(and any other data properties that are equivalent to
owl:topDataProperty
). The bottom node contains owl:bottomDataProperty
(and any
other data properties that are equivalent to owl:bottomDataProperty
). Class Hierarchy Example
The figure below shows an example class hierarchy. Each box in the hierarchy represents aNode
. In this case the top node contains owl:Thing
and
the bottom node contains owl:Nothing
because the nodes in the hierarchy are
OWLClass
nodes. In this case, class G
is equivalent to owl:Thing
so it
appears as an entity in the top node. Similarly, class K
is unsatisfiable, so it is
equivalent to owl:Nothing
and therefore appears in the bottom node containing
owl:Nothing
. 
- Since:
- 3.0.0
- Author:
- Matthew Horridge, The University of Manchester, Information Management Group
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Determines if this node contains the specified entity.entities()
Gets the entities contained in this node.Gets the entities contained in this node.Gets the entities contained in this node minus the specified entitye
.Gets the entities contained in this node minus the bottom entity.Gets the entities contained in this node minus the top entity.Gets one of the entities contained in this entity set.int
getSize()
Gets the number of entities contained in thisNode
.boolean
Determines if this node represents the bottom node (in a hierarchy).boolean
Determines if thisNode
contains just one entity.boolean
Determines if this node represents the top node (in a hierarchy).Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
isTopNode
boolean isTopNode()Determines if this node represents the top node (in a hierarchy). For a named class node, the top node is the node that containsowl:Thing
. For an object property node, the top node is the node that containsowl:topObjectProperty
. For a data property node, the top node is the node that containsowl:topDataProperty
- Returns:
true
if this node is anOWLClass
node and it containsowl:Thing
.
true
if this node is anOWLObjectProperty
node and it containsowl:topObjectProperty
.
true
if this node is anOWLDataProperty
node and it containsowl:topDataProperty
.
false
if none of the above.
-
isBottomNode
boolean isBottomNode()Determines if this node represents the bottom node (in a hierarchy). For a named class node, the bottom node is the node that containsowl:Nothing
. For an object property node, the bottom node is the node that containsowl:bottomObjectProperty
. For a data property node, the bottom node is the node that containsowl:bottomDataProperty
- Returns:
true
if this node is anOWLClass
node and it containsowl:Nothing
.
true
if this node is anOWLObjectProperty
node and it containsowl:bottomObjectProperty
.
true
if this node is anOWLDataProperty
node and it containsowl:bottomDataProperty
.
false
if none of the above.
-
getEntities
Gets the entities contained in this node. The entities are equivalent to each other.- Returns:
- The set of entities contained in this
Node
. The set that is returned is a copy; modifications to the returned set will not be reflected in this object.
-
entities
Gets the entities contained in this node. The entities are equivalent to each other.- Returns:
- stream of entities contained in this
Node
.
-
getSize
int getSize()Gets the number of entities contained in thisNode
.- Returns:
- The number of entities contained in this node.
-
contains
Determines if this node contains the specified entity.- Parameters:
entity
- The entity to check for- Returns:
true
if this node containsentity
, orfalse
if this node does not containentity
-
getEntitiesMinus
Gets the entities contained in this node minus the specified entitye
. This essentially returns the entities that are returned bygetEntities()
minus the specified entitye
- Parameters:
e
- The entity that, is contained within this node, but should not be included in the return set.- Returns:
- The set of entities that are contained in this node minus the specified entity,
e
. Ife
is not contained within this node then the full set of entities returned is the same as that returned bygetEntities()
-
getEntitiesMinusTop
Gets the entities contained in this node minus the top entity. For a node of named classes the top entity isowl:Thing
. For a node of object properties the top entity isowl:topObjectProperty
. For a node of data properties the top entity isowl:topDataProperty
- Returns:
- The set of entities contained within this node minus the top entity. If this node
does not contain the top entity then the set of entities returned is the same as that
returned by
getEntities()
.
-
getEntitiesMinusBottom
Gets the entities contained in this node minus the bottom entity. For a node of named classes the bottom entity isowl:Nothing
. For a node of object properties the bottom entity isowl:bottomObjectProperty
. For a node of data properties the bottom entity isowl:bottomDataProperty
- Returns:
- The set of entities contained within this node minus the bottom entity. If this node
does not contain the bottom entity then the set of entities returned is the same as
that returned by
getEntities()
.
-
isSingleton
boolean isSingleton()Determines if thisNode
contains just one entity.- Returns:
true
if thisNode
contains just one entity, otherwisefalse
-
getRepresentativeElement
E getRepresentativeElement()Gets one of the entities contained in this entity set. If this is a singleton set it will be the one and only entity.- Returns:
- An entity from the set of entities contained within this node
- Throws:
RuntimeException
- if this node is empty (it does not contain any entities).
-