public class Graph
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.util.TreeMap<java.lang.String,java.lang.String> |
columnList |
java.util.TreeSet<java.lang.String> |
errors |
static java.lang.String |
indent |
Constructor and Description |
---|
Graph() |
Modifier and Type | Method and Description |
---|---|
int |
columnCount() |
java.util.LinkedHashSet<java.lang.String> |
createBoundedSizeGraph(KB kb,
java.lang.String term,
java.lang.String relation,
int size,
boolean instances,
java.lang.String language)
Create a graph of a bounded size by incrementing the number of
levels above and below until the limit is reached or there are
no more levels in the knowledge base from the given term and
relation.
|
boolean |
createDotGraph(KB kb,
java.lang.String term,
java.lang.String relation,
int above,
int below,
java.lang.String fname)
Create a ArrayList with a set of terms comprising a hierarchy
in a format suitable for GraphViz' input format
http://www.graphviz.org/
Generate a GIF from the .dot output with a command like
dot SUMO-graph.dot -Tgif > graph.gif
|
java.util.LinkedHashSet<java.lang.String> |
createGraph(KB kb,
java.lang.String term,
java.lang.String relation,
int above,
int below,
int termLimit,
boolean instances,
java.lang.String language)
Create an ArrayList with a set of terms comprising a hierarchy
Each term String will be prefixed with an appropriate number of
indentChars.
|
static void |
main(java.lang.String[] args)
A test method.
|
public java.util.TreeMap<java.lang.String,java.lang.String> columnList
public static java.lang.String indent
public java.util.TreeSet<java.lang.String> errors
public int columnCount()
public java.util.LinkedHashSet<java.lang.String> createBoundedSizeGraph(KB kb, java.lang.String term, java.lang.String relation, int size, boolean instances, java.lang.String language)
public java.util.LinkedHashSet<java.lang.String> createGraph(KB kb, java.lang.String term, java.lang.String relation, int above, int below, int termLimit, boolean instances, java.lang.String language)
kb
- the knowledge base being graphedterm
- the term in the KB being graphedrelation
- the binary relation that is used to forms the arcs
in the graph.above
- the number of levels above the given term in the graphbelow
- the number of levels below the given term in the graphinstances
- whether to display instances below subclass relationspublic boolean createDotGraph(KB kb, java.lang.String term, java.lang.String relation, int above, int below, java.lang.String fname) throws java.io.IOException
kb
- the knowledge base being graphedterm
- the term in the KB being graphedrelation
- the binary relation that is used to forms the arcs
in the graph.java.io.IOException
public static void main(java.lang.String[] args)