RubyForge Project Starteda new project at RubyForge. The project is called Protege+OWL+Ruby. It’s a slightly lofty name, I’m sure, maybe even a little pretentious. But after working with my new system (see previous post), I could see where it would be quite easy to create a full JRuby IDE using Protege as the user interface.
The code I have creates a nice set of classes that wrap around OWL individuals defined in protege. There is a general routine called
create_ind(ind)that returns an object representing an individual with properties that reflect the OWL class of the individual. For instance in my example ontology:
load 'project' maj2nd = create_ind("Interval_Maj2nd") p maj2nd.hasNotation #-> images/intmaj2nd.png p maj2nd.class #-> Interval p maj2nd.methods(nil)
The result of the last statement from above is a listing of the methods available to the OWL individual:
["isAlsoDiminished", "rdfs_label", "is_it_safe", "hasInversion", "hasResolve", "looksLike", "hasNotationDim", "rdfs_comment", "isAlsoAugmented", "hasNotationAug", "hasNotation", "hasWidth"]
See the method
is_it_safein the method list above? This method was implemented with code entered into the OWL ontology (using the imported POR ontology) as an individual of
por:InstanceMethodwhich is basically just a wrapper around an
xsd:Stringproperty. I created an individual of
Intervaland hooked that to the OWL class
rdfs:isDefinedByby adding an existing resource as an annotation in the Protege OWLClasses tab. The annotation property is a . I’m pretty sure I’m in the ball park as far as the recommendation goes from the W3C. Using this annotation property this way is still OWL-DL as far as I can tell and does not cause Protege to declare the ontology OWL-FULL.
Annotating the OWL ontology with Ruby code this way starts making Protege feel exactly like a really sophisticated IDE. I can change the body of the method using the Protege user interface. To test my changes I simply issue a command or two in the Protege Script Tab. It’s the most natural way to develop I’ve encountered. A nice little map of all the Ruby classes and properties and data wrapped up with a great little IRB.
All that’s needed is a juicy little debugger, some syntax coloring and (maybe one day) autocomplete.