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:
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.
Steps for use under Ubuntu Linux:
- Start the Gephi application, including the Graph Streaming Server available in Gephi via "Tools > Plugins > Available Plugins."
- In the "Streaming" tab of the Gephi GUI, right-click the Master Server to start it.
- From the opencog shell, run
loadpy adaptors. This should find GephiMindAgent. If not, check PYTHON_EXTENSION_DIRS in your opencog.conf
- Load some atoms into the atomspace. For example,
scm-eval (clear) (load-scm-from-file "SomeAtoms.scm") (count-all)
- From the opencog shell, run `agents-step adaptors.GephiMindAgent`
- You should now see your atoms in Gephi.
(optional) Tips for new Gephi users for nice presentation:
- In the 'Layout' Tab, select the 'Force Atlas 2' layout.
- Click the check-boxes in the Layout settings for 'Dissuade Hubs' and 'Prevent Overlap'
- Click Run
(optional) Color coding:
- Select the 'Partition' tab and the 'Nodes' sub-tab.
- Click the green refresh icon below the the tabs. This should populate the parameters drop-down.
- Select "Label" in the drop-down.
- Click the 'Apply' button.
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.