Creating a graph of the rulebase

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.

Tags: ,

4 Responses to “Creating a graph of the rulebase”

  1. […] -d = dot file (Is used for creating a graph of the rulebase) […]

  2. […] -d = dot file (Is used for creating a graph of the rulebase) […]

  3. Wood says:

    Whoever wrote this, you know how to make a good atrlice.

  4. Aravind says:

    I wanted to convert some of the log files into graphs and found this post very helpful. But I am a facing a problem in displaying the Server IP, client IP , date and the other fields . What I mean is like in the graph in this post where date is written I want to display the date of the query. Also in the part where host is written I want to get the host IP address. Can you help me understanding how to overcome this problem?

Leave a Reply