Atomspace Visualization

From OpenCog
(Redirected from Atomspace visualizer)
Jump to: navigation, search

Visualizing the OpenCog AtomSpace in a useful way is a complex matter and many different approaches may work well for different purposes. Building a good visualizer turns out to be an extremely hard task. More than eight different visualizers have been developed for OpenCog since 2008; seven of them are listed below. Each has strengths and weaknesses, mostly weaknesses, though. There are multiple issues that must be solved, before a visualizer is usable in practice:

  • There must be a way of visualizing only the subset of the atomspace that one is interested in.
  • Performance must be acceptable: atomspaces can contain millions of atoms; visualizing all of them is impractical and undesirable.
  • The tool should update dynamically as the AtomSpace contents change: typically, one is interested in seeing how TruthValues or AttentionValues change over time, or in how the nearest neighbors of some atom are changing.
  • A particularly important visualization task is to show what Attention Allocation is doing, at any point in time.
  • Another, related visualization is showing what PLN is deducing, at any given point in time.
  • Because both PLN and Attention Allocation happen quickly, in real time, it would be useful to capture traces, and be able to play them back in slow-motion, with pause and rewind abilities.
  • General browsing is another desirable feature: the ability to explore nearest neighbors of an atom, and then trace these in various directions. Such browsing needs to be filterable by atom type, truth value, attention value: some atoms can have a huge number of nearest neighbors, and one might be interested in only certain kinds of these neighbors.
  • The visualizer should work with the OpenCog Workbench.

Some older specifications and ideas for how visualization could be performed:

Glimpse

The latest and greatest atomspace visualizer can be found in github:opencog/external-tools. Still work-in-progress though.

AtomSpace Viewer

One tool for visualizing the AtomSpace is the Atomspace Viewer.

AtomViewer.jpg

This tool is implemented using HTML5 and JavaScript, and is the preferred platform for creating new visualization functionality in the future. It utilizes the REST interface for interaction with the OpenCog server.

For more details on how to use and develop for the Atomspace Viewer, as well as a current list of TODOs and desired enhancements, see the README file.

Gephi

Visualization using Gephi is integrated with the CogServer using Python.

Steps for use under Ubuntu Linux:

  1. Start the Gephi application, including the Graph Streaming Server available in Gephi via "Tools > Plugins > Available Plugins."
  2. In the "Streaming" tab of the Gephi GUI, right-click the Master Server to start it.
  3. Start cogserver & telnet to it
  4. From the opencog shell, run loadpy adaptors. This should find GephiMindAgent. If not, check PYTHON_EXTENSION_DIRS in your opencog.conf
  5. Load some atoms into the atomspace. For example,
    scm-eval (clear) (load-scm-from-file "SomeAtoms.scm") (count-all)
  6. From the opencog shell, run `agents-step adaptors.GephiMindAgent`
  7. You should now see your atoms in Gephi.

(optional) Tips for new Gephi users for nice presentation:

  1. In the 'Layout' Tab, select the 'Force Atlas 2' layout.
  2. Click the check-boxes in the Layout settings for 'Dissuade Hubs' and 'Prevent Overlap'
  3. Click Run


(optional) Color coding:

  1. Select the 'Partition' tab and the 'Nodes' sub-tab.
  2. Click the green refresh icon below the the tabs. This should populate the parameters drop-down.
  3. Select "Label" in the drop-down.
  4. Click the 'Apply' button.

Dotty

Generates dotty graphs. You probably want to use it with GraphViz. See opencog/visualization/dotty/README for more.

Tulip

Generates data for the Tulip data visualization toolkit. Tulip is actively maintained, and provides many powerful visualization features. See opencog/visualization/tulip for more.

Gtk-Visualizer

This is a stand-alone client, based on the GTK library. Its bit-rotted, probably. See opencog/visualization/gtk-visualizer for more. An old screenshot:

Atomspace visualizer.png

Hypergraph to graph conversion

In order to map Atoms into existing graph visualizers, one must map the OpenCog hypergraph into a conventional graph. Code that does this was written by Junfei Guo in 2008, and is in a rar file here: File:UpdateFinalEvaluation.rar.