Atomspace Visualization

From OpenCog
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, and there have been several attempts over the years. 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:

AtomSpace Explorer

The latest (as of October, 2017) visualization tool, and the preferred platform going forward, is the AtomSpace Explorer. This was adapted from the Mozi_Visualizer demo, which in turn was based on the former Glimpse visualizer. See the README file for instructions on how to install and use the AtomSpace Explorer.


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.


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


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

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.