Documenting a rule base with EulerGUI

© Jean-Marc Vanel - $Date: 2012-10-17$ - under Creative Commons License

There is a rule base that acts as a helper for documenting a rule base. That is, every non declared property generates a skeleton declaration; the same for undeclared classes. Here is a how-to. There is an example project that shows the result of all the steps below: rules-documentor.n3.n3p .

First create an EulerGUI project with all the rules URI's you want to document, plus rules-documentor.n3 rules and as a query rules-documentorQ.n3 . This can be done e.g. by such a command line :

eulergui generic_gui_projection-rules.n3 generic_to_java-rules.n3 rules-documentor.n3 --query rules-documentorQ.n3

A project containing all the rules you want to document can also be imported as a subproject.

Then click on Tools / Add all referred ontologies; this way you retrieve all definitions of properties and classes for the used prefixes.

Then check "activated" on each of the new N3 sources.

Then you run the project with Euler ; this is very quick :

#ENDS 140 [msec] TC=136 TP=544 BC=0 BP=223 PM=0 CM=0 FM=0 AM=0

Look at the output of the inference: every Property that has no documentation, at least with rdfs:comment , will appear. Now click on the second yellow button on the top right; you'll see that every undocumented RDF Property has gotten a skeleton documentation like this :

my:property
      a       rdf:Property ;
      rdfs:comment "???" ;
      rdfs:domain "???" ;
      rdfs:label <xxx> ;
      rdfs:range <xxx> .

The next step is to save this output of the inference in a non temporary file, and add it to the project. Then, of course, you have to complete by hand the "???" and <xxx> strings, and URI's for RDFS label and range. You should also change rdf:Property into owl:DatatypeProperty or owl:DatatypeProperty, as appropriate.

Then, for a check, you can re-run the project with Euler; every Property that has been completed by hand, at least with rdfs:comment , will not appear in the output.

And the cool thing with that is: N3 rules (rules-documentor.n3) process N3 rules to create N3 output !

We may later add a button to facilitate that even more in EulerGUI.

We would like also that the rules documentor guesses domain and ranges.