Thursday, January 24, 2008

jOWL, a javascript library for traversing OWL-RDFS documents

I have started working on jOWL, a jQuery plugin for traversing OWL-RDFS documents. The ambitious intention is to deliver a script that smoothes out cross-browser issues between Firefox and Internet explorer when dealing with OWL syntax and at the same time greatly simplifies traversing OWL-RDFS documents. I'm using a mix of Xpath expressions and jQuery functionality to do so.


My main motivitation for writing this library is to see if I would be able to replicate the behaviour of the freebase-dependent wine widget in a manner that doesn't require database or complex server interactions (Imagine!). Just plain old HTML, some javascript and an OWL ontology file.



While it isn't release ready, the results look very promising and there is already quite some functionality to look at. Have a look at the simple Demo.



All it currently takes to deliver similar functionality is the following lines, it should bear no secrets if you are a little familiar with jQuery:



//load the owl file
jOWL.load('wine.xml', startDemo);

function startDemo(owl){
//Creates a panel to display individuals
var individuals = $('#individuals').owl_individuals(owl);

//Creates a panel to display class, child and parent relations
var navbar = $('#navbar').owl_navbar(owl);

//lets this component talk to the individuals panel
navbar.addListener(individuals);

//Creates an autocomplete field, options to refine are possible
var autocomplete = $('#owlauto').owl_autocomplete(owl);

//lets the autocomplete field talk (provide input) to
the other components.
autocomplete.addListener(navbar).addListener(individuals);
}

The plan is to extend this functionality further, while keeping syntax required to interact with the OWL-RDFS document as simple as possible. I intend to update this demo page with more examples and documentation as I progress further with this library. I'm currently testing it with the prototypical wine ontology, but plan to expand the test to other ontologies when the time is ripe.