Creating a graph of the rulebase

Thursday, December 2nd, 2010

To get a better overview of a rulebase you can create a graph that shows you the chain of normalization.

At first you have to install an additional package called graphviz. Graphviz is a tool that creates such a graph with the help of a control file (created with the rulebase). Here you will find more informaton about graphviz.

To install it you can use the package manager or the yum command.

$ sudo yum install graphviz

The next step would be creating the control file for graphviz. Therefor we use the normalizer command with the optionsĀ -d “prefered filename for the control file” and -r “folder of sampledb”

$ ./normalize -d control.dot -r /home/Test/messages.rb

Please note that there is no need for an input or output file.
If you have a look at the control file now you will see that the content is a little bit confusing, but it includes all information, like the nodes, fields and parser, that graphviz needs to create the graph. Of course you can edit that file, but please note that it is a lot of work.

Now we can create the graph by typing

$ dot control.dot -Tpng >graph.png

dot + name of control file + option -T -> file format + output file

That is just one example for using graphviz, of course you can do many other great things with it. But I think this “simple” graph could be very helpful for the normalizer.

Please find below a sample for such a graph, but please note that this is not such a pretty one. We will update that graph as soon as we have a adequate one. Such a graph can grow very fast by editing your rulebase.

graph sample
Click to enlarge.