public class DAGConceptGraph extends ConceptGraph
ConceptGraph| Red (mankit) |
| Red (mankit) |
CPO.BoundTypeHIGHER, INCOMPARABLE, LOWER, SAME| Constructor and Description |
|---|
DAGConceptGraph()
Create an empty concept graph with no concepts in it.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConcept(FiniteConcept concept)
Add a concept to this concept graph.
|
void |
addRelation(FiniteConcept concept1,
FiniteConcept concept2,
ConceptRelation conceptRelation)
Add a relation between two Concepts as an edge to the graph.
|
Concept |
bottom()
Return the least element of this concept graph.
|
java.util.List<Concept> |
checkUnacceptableConcepts()
Return a list of the concepts which are not acceptable, but are also
not at the top of the lattice, as required for non-acceptable concepts.
|
int |
compare(java.lang.Object e1,
java.lang.Object e2)
Compare two concepts in the ontology.
|
Concept[] |
downSet(java.lang.Object e)
Compute the down-set of an element in this concept graph.
|
Concept |
greatestLowerBound(java.lang.Object e1,
java.lang.Object e2)
Compute the greatest lower bound (GLB) of two elements.
|
Concept |
leastUpperBound(java.lang.Object e1,
java.lang.Object e2)
Compute the least upper bound (LUB) of two elements.
|
NonLatticeCounterExample |
nonLatticeReason()
Return why this concept graph is not a lattice, or null if it is.
|
Concept |
top()
Return the greatest element in this concept graph.
|
Concept[] |
upSet(java.lang.Object e)
Compute the up-set of an element in this concept graph.
|
greatestElement, greatestLowerBound, isLattice, leastElement, leastUpperBoundpublic DAGConceptGraph()
public void addConcept(FiniteConcept concept)
concept - The concept.java.lang.IllegalArgumentException - If the concept we are trying to
add is already contained in this concept graph.public void addRelation(FiniteConcept concept1, FiniteConcept concept2, ConceptRelation conceptRelation)
concept1 - The source conceptconcept2 - The sink conceptconceptRelation - The ConceptRelation between the two concepts
concept1 and concept2.public Concept bottom()
bottom in interface CPO<Concept>bottom in class ConceptGraphpublic java.util.List<Concept> checkUnacceptableConcepts()
public int compare(java.lang.Object e1,
java.lang.Object e2)
Concept, otherwise an exception will be thrown.
This method returns one of ptolemy.graph.CPO.LOWER, ptolemy.graph.CPO.SAME,
ptolemy.graph.CPO.HIGHER, ptolemy.graph.CPO.INCOMPARABLE, indicating the
first argument is lower than, equal to, higher than, or incomparable with
the second argument in the property hierarchy, respectively.compare in interface CPO<Concept>compare in class ConceptGraphe1 - An instance of Concept.e2 - An instance of Concept.java.lang.IllegalArgumentException - If one or both arguments are not
instances of Concept.public Concept[] downSet(java.lang.Object e)
downSet in interface CPO<Concept>downSet in class ConceptGraphe - An Object representing an element in this concept graph.java.lang.IllegalArgumentException - If the specified Object is not
an element in this concept graph, or the resulting set is infinite.public Concept greatestLowerBound(java.lang.Object e1, java.lang.Object e2)
greatestLowerBound in interface CPO<Concept>greatestLowerBound in class ConceptGraphe1 - An Object representing an element in this concept graph.e2 - An Object representing an element in this concept graph.null if the GLB does not exist.java.lang.IllegalArgumentException - If at least one of the
specified Objects is not an element of this concept graph.public NonLatticeCounterExample nonLatticeReason()
nonLatticeReason in class ConceptGraphpublic Concept leastUpperBound(java.lang.Object e1, java.lang.Object e2)
leastUpperBound in interface CPO<Concept>leastUpperBound in class ConceptGraphe1 - An Object representing an element in this concept graph.e2 - An Object representing an element in this concept graph.null if the LUB does not exist.java.lang.IllegalArgumentException - If at least one of the
specified Objects is not an element of this concept graph.public Concept top()
top in interface CPO<Concept>top in class ConceptGraphpublic Concept[] upSet(java.lang.Object e)
upSet in interface CPO<Concept>upSet in class ConceptGraphe - An Object representing an element in this concept graph.java.lang.IllegalArgumentException - Always thrown.