Model Visualization in the SADL-IDE

Last revised 06/20/2019 by A. W. Crapo

SADL Version 2

The SADL-IDE Version 2.2.0.201411111033 and later includes the ability to visualize "neighborhoods" of a concept (class, property, or individual) as a graph. For classes, two graphs are generated: a class hierarchy graph and a property domains and ranges graph. This visualization capability uses GraphViz and must be configured as described below. When properly configured, the graphs are displayed in a separate window. A corresponding PNG image file is also created in the project's Temp folder.

SADL-IDE versions after April, 2015 include the ability to see the import tree of any file. Right-click on the target SADL file in the Project Explorer and select "Sadl Actions" -> "Graph Imports". The result will be a graph of imports with the selected model as the highlighted node.

GraphViz can be downloaded from http://www.graphviz.org/ and should be placed on a path without spaces or other "difficult" path characters. Once installed, there should be a "bin" folder under the installation directory with "dot" and "dotty" executables.

In SADL Version 2, the SADL-IDE is configured to use GraphViz by opening global preferences (Window -> Preferences) . Click on "Sadl" in the left-side menu. The global preferences will include, at the bottom, "GraphViz bin folder". Fill in the path to the bin folder of your installation, e.g., "C:\win32app\graphviz\release\bin".

A neighborhood can now be graphed by opening a model in the SADL editor and selecting the entire text of a concept name, then right-clicking for a context menu and selecting "Graph Neighborhood".

Note that arbitrary graphs can also be created with the "Ask: construct..." directive in a SADL model. (See http://www.w3.org/TR/sparql11-query/#construct.) If graphing is configured, the result of the SPARQL construct will be displayed as graph using GraphViz as described above.

SADL Version 3

In SADL Version 3, the graphing package is a plug-in accessed as a service implementing the Java Interface class com.ge.research.sadl.model.visualizer.IGraphVisualizer. The SADL-IDE SADL preference "Graph renderer package and class" setting is, by default, the GraphViz implementation in com.ge.research.sadl.model.visualizer.GraphVizVisualizer. Any visualizer implementing the IGraphVisualizer Interface class can be placed on the Java classpath and specified in this preference.

Graphs are created as SVG files in the Graphs project subfolder. With an appropriate file association, they will automatically be opened in an appropriate viewer, e.g., a Web browser.

When the GraphVizVisualizer is used, the location of the GraphViz bin folder (see above) must be specified in the OS environment variable GraphVizPath, e.g,

    GraphVizPath=C:\Apps\graphviz-2.36\release\bin

Also, when the GraphVizVisualizer is used, the dot file can be retained (not automatically deleted after the SVG file is created) by setting the OS environment variable GraphVizKeepDot to true:

    GraphVizKeepDot =true.

Note that Eclipse must be restarted after setting environment variables for them to become visible to Eclipse. (For some reason, a reboot has been found to be necessary to make the environment variable visible in Eclipse.)

Graphs can be generated by selecting either "Show Graph" or "Graph Ontology" from the Dropdown Menu. (In the SADL perspective, "SADL" appears in the top menu bar; the SADL (gear) icon on the tool bar also has this dropdown menu.) Graphing options include:

  1. Select a class in SADL editor window, invoke "Show Graph": two graphs are generated, class hierarchy and domains and ranges
  2. Select a property in SADL editor window, invoke "Show Graph": a domains and ranges graph is generated
  3. Select an instance in SADL editor window, invoke "Show Graph": an instance graph is generated
  4. Select a file in the Project Explorer window, invoke "Show Graph": a graph showing what the selected file imports and what imports it is displayed

Graphs can also be generated from SADL statements:

  1. Ask: "construct ....".    // will generate a graph for a valid SPARQL construct statement (see http://www.w3.org/TR/sparql11-query/#construct )
  2. Graph: "select ?s ?p ?v where {....}".    // will construct a graph; requires a result with 3 columns