Package com.articulate.sigma
Class Graph
java.lang.Object
com.articulate.sigma.Graph
Handle operations for creating a graphical representation of partial
ordering relations. Supports Graph.jsp.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcreateBoundedSizeGraph(KB kb, String term, String relation, int size, boolean instances, 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.booleancreateDotGraph(KB kb, String term, String relation, int above, int below, int limitInt, String fname, String fileRestrict) Create a ArrayList with a set of terms comprising a hierarchy in a format suitable for GraphViz' input format http://www.graphviz.org.createGraph(KB kb, String term, String relation, int above, int below, int termLimit, boolean instances, 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 voidA test method.static voidshowHelp()
-
Field Details
-
columnList
-
indent
-
errors
-
debug
public static boolean debug
-
-
Constructor Details
-
Graph
public Graph()
-
-
Method Details
-
columnCount
public int columnCount()- Returns:
- a count of the number of elements in columnList with the value "yes".
-
createBoundedSizeGraph
public Set<String> createBoundedSizeGraph(KB kb, String term, String relation, int size, boolean instances, 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. creatGraphBody() does most of the work. -
createGraph
public Set<String> createGraph(KB kb, String term, String relation, int above, int below, int termLimit, boolean instances, 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. @see creatGraphBody() does most of the work.- Parameters:
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 relations
-
createDotGraph
public boolean createDotGraph(KB kb, String term, String relation, int above, int below, int limitInt, String fname, String fileRestrict) throws IOException 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 proof image from the .dot output with a command like dot SUMO-graph.dot -Tgif > graph.gif- Parameters:
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.- Throws:
IOException
-
showHelp
public static void showHelp() -
main
A test method.
-