Monday, 6 April 2015

Visualization of Ontology Contents - with Ontology Diagram and SWRL Debugger

From the latest release version, Fluent Editor includes a few new features that enhance visualization of ontology, which can help you navigate through the structure of your ontology more intuitively. Possibility of drawing a diagram of ontology is one of such features. Ontology diagrams graphically express relations between concepts and instances - also the materialized ones. 
Another new feature to be introduced is SWRL debugger. SWRL debugger shows binding of rules that took place during the reasoning process over your ontology. It is presented as a list of all the SWRL rules and bound instances. By running SWRL debugger, you can check how SWRL rules work on your ontology.

In this post, we will look through these two features further.

Drawing an Ontology Diagram 

To see how diagram drawing looks, you can open any ontology that includes definition of concepts or instances, or both. For example, we can open 'Simple IT Infrastructure' template as below.

Then if you go to Tools tab, you will see a big button named 'CNL Diagram'. Click it.

Fluent Editor will draw a diagram or the opened ontology and display it on a new inner window 'Document Diagram' as shown below. Also a new green tab named 'Diagram' will appear, which contains all the interfaces for the diagram you can interact with.

As you see the diagram, you will notice a couple of things.
  1. Three different colors for each node type.
    • Concept nodes : white 
    • Instance nodes:  green. 
    • "thing" node : light blue.  
  2. If no materialization was performed previously, the diagram is not expressing the entire reasoned relationships but only the hierarchy of elements in the ontology.  After materialization (you can press Materialize button in ribbon) the implicit relationships will be shown too.
Now let's take a look at what is available on Diagram tab. 

  • Save as image : Saves the diagram in JPG file. You can save the whole diagram by selecting 'Save global view', or only the part you are currently viewing (after zooming in by) selecting 'Save current view'.
  • Save as vector : Saves the diagram in SVG file. You can save the whole diagram by selecting 'Save global view', or only the part you are currently viewing (after zooming in by) selecting 'Save current view'.
  • Zoom in : Zooms in the diagram.
  • Zoom out : Zooms out the diagram.
  • Print : Prints the diagram.
  • Move : After clicking this button, you can hover the diagram.
  • Select : After clicking this button, you can select one or multiple elements on the diagram, as well as drag&drop each of them. (Default behavior over Move.)
  • Do Layout : If you moved some nodes in the graph in Select mode, clicking Do Layout will clean up the layout changes and redraw the diagram again. 
  • Materialize : Performs materialization on the diagram and redraws it according to the data from materialized graph.  It can be done in one of two modes : OWL-RL+ or OWL-DL.

As it is previously mentioned, you can draw the entire reasoned relationships on a diagram by performing materialization on diagram. To do this, simply click 'Materialize' button.

Note that this materialization will be performed according to which mode you selected in Home tab, either OWL-RL+ or OWL-DL.

Running SWRL Debugger

Obviously, in order to run SWRL debugger your ontology should contain some SWRL rules. You can try with 'Simple IT Infrastructure' template as it contains one SWRL rule...

... as below. 

Now let's run SWRL debugger. Go to Tools tab, and click 'Run Debugger' button.

Then you may see this message before the debugging result.

This message will appear because what SWRL debugger actually does it to perform materialization on the ontology in OWL-RL+ mode. SWRL debugger displays only fired SWRL rules and the relavant instances bound by the Reasoner and Rule Engine during Materialization process. Note that materialization in SWRL Debugger is performed only in OWL2-RL+ mode, and OWL-DL mode is not supported now.

After clicking 'OK', a new window 'SWRL Debugger' on the bottom will appear and display the result of SWRL debugging on it as shown below. You can check that the one SWRL rule in the ontology with the relavant elements are all listed.

To open the SWRL Debugger window again after closing it or visiting other window tabs, click 'SWRL Debug' button on Tools tab.  

No comments:

Post a Comment