Class Graph

java.lang.Object
com.articulate.sigma.Graph

public class Graph extends Object
Handle operations for creating a graphical representation of partial ordering relations. Supports Graph.jsp.
  • Field Details

    • columnList

      public Map<String,String> columnList
    • indent

      public static String indent
    • errors

      public Set<String> 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 graphed
      term - the term in the KB being graphed
      relation - the binary relation that is used to forms the arcs in the graph.
      above - the number of levels above the given term in the graph
      below - the number of levels below the given term in the graph
      instances - 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 graphed
      term - the term in the KB being graphed
      relation - the binary relation that is used to forms the arcs in the graph.
      Throws:
      IOException
    • showHelp

      public static void showHelp()
    • main

      public static void main(String[] args)
      A test method.