Visualizing the OpenCog Atomspace in a useful way is a complex matter and there seems little doubt that many different approaches may work well for different purposes.
Various methods of visualization exist.
Install this prerequisite:
sudo apt-get install libgtk-3-dev
Compile again. From your OpenCog build directory:
Run the visualizer. From your OpenCog build directory:
cd opencog/visualization/gtk-visualizer/ ./OpenCogAtomSpaceVisualizer
- Copy the latest version of the atom_types.script file to the application directory (or use command line option -p) (XXX There is no single version of this file; every subsystem uses a different one. This is a design flaw. INstead, the oppencog server should be asked about what atom types it knows. In the meanwhile, you may have to hand-create customer atom_types.script files)
- Run a cogserver locally (or use command line option -s) and load an SCM file
- Enter name, type or handle and press search button
- Hover over an atom to see its attributes
- Left click to show or hide connected atoms
- Right click to recenter the graph
- Click and move to drag an atom to a new position
- The node and link filters select which of the connected atoms are shown. New filter settings are applied the next time you click, right click or search.
- Auto expand level determines how many levels of connected atoms are shown. If level > 1 it may take a while.
- Update button doesn't work yet
Command line options:
- -s (server) Name of the CogServer. Default is localhost. e.g. -s MyServer
- -p (path) Path to the atom_types.script file. Default is application directory. e.g. -p/usr/include/atom_types.script
- -q (quiet) Turn off help messages
Visualization using [Gephi] is integrated with the Atomspace using python.
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.
- Start cogserver & telnet to 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.
First start the ubigraph server. Then load the libubigraph.so module in cogserver, and run the "ubigraph" command. You should run the ubigraph command once, and then the display will update when atoms are added or removed.
See README for more info.
AtomSpace visualization is potentially a particular aspect of the OpenCog Workbench, but is initially implemented separately. The Workbench current only visualizes OpenPsi dynamics. There is more detail on the technical aspects of visualization at the OpenCog Workbench page.
Large-scale visualization could be useful for understanding the overall topology of an Atomspace.
On the other hand, small-scale visualization could also be useful for graphically browsing the Atomspace, especially if coupled with an intuitive interface for navigating and filtering the graphs. Some old thoughts on how to make a small-scale Atomspace visualizer are given in the following documents, which were written in the context of the Novamente Cognition Engine AtomTable, which was similar enough to the current OpenCog Atomspace that the visualization ideas are still basically applicable:
Also, one thing needed for mapping Atoms into existing graph visualizers is a mapping from the Atom hyperspace into a conventional graph. Some code doing this was written by Junfei Guo in 2008 and the code and docs are here:
The process of hypergraph to graph transformation is, however, very simple and all three of Tulip exporter, the Dotty module, and Ubigraph module already do this.