public class Graph
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.util.TreeMap<java.lang.String,java.lang.String> |
columnList |
Constructor and Description |
---|
Graph() |
Modifier and Type | Method and Description |
---|---|
int |
columnCount() |
java.util.ArrayList<java.lang.String> |
createBoundedSizeGraph(KB kb,
java.lang.String term,
java.lang.String relation,
int size,
java.lang.String indentChars,
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.ArrayList<java.lang.String> |
createGraph(KB kb,
java.lang.String term,
java.lang.String relation,
int above,
int below,
java.lang.String indentChars,
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 int columnCount()
public java.util.ArrayList<java.lang.String> createBoundedSizeGraph(KB kb, java.lang.String term, java.lang.String relation, int size, java.lang.String indentChars, java.lang.String language)
public java.util.ArrayList<java.lang.String> createGraph(KB kb, java.lang.String term, java.lang.String relation, int above, int below, java.lang.String indentChars, 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 graphindentChars
- a String of characters to be used for indenting the termspublic 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)