Our reasoner relies on LISA (Lisp Intelligent Software Agent), a forward-chaining inference engine to derive facts about our markup. LISA provides a clean API for specifying rules and facts, in a CLIPS-derived format. Its greatest advantage is its ability to reason with arbitrary CLOS (Common Lisp Object System) objects, or in our case, with Wilbur triple objects.
Wilbur's triple objects are standard CLOS objects and hence processing
them in LISA is simple; all we have to do is include them in our
knowledge base as facts. This is done using the assert macro:
Before we can reason with actual RDF and OWL, there are a few bare-bone facts and rules that must be included in our knowledge base, such as: "everything is a resource" or "daml:Datatype is a subclass of daml:Literal". We derived these rules and facts by converting the DAMLJessKB (another CLIPS-derived inference system) to the LISA format. A simple Python script performs this conversion.
To simulate synchronization, three mechanisms are used:
db-add-triple was overloaded:
sync-wilbur-db. Depending on
their contexts, different LISA rules might have to explictly invoke this rule after asserting new facts into the knowledge base.
triple-object function, that can be used
as follows to change a triple's object slot value:
triple-object. A hashtable whose keys are Wilbur
triple objects and values their corresponding LISA facts is used to
explictly signal the changes to LISA.
The figure below illustrates the above process:
We tested the reasoner by having it parse the first positive OWL testcase (from the testcases collection). The test is:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"Note that usage of xml:base was removed due to Wilbur's inability to parse it.
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:first="http://www.w3.org/2002/03owlt/FunctionalProperty/premises001#"
xmlns="http://www.w3.org/2002/03owlt/FunctionalProperty/premises001">
<owl:FunctionalProperty rdf:ID="http://www.w3.org/2002/03owlt/FunctionalProperty/premises001#prop"/>
<rdf:Description rdf:ID="http://www.w3.org/2002/03owlt/FunctionalProperty/premises001#subject">
<first:prop rdf:resource="http://www.w3.org/2002/03owlt/FunctionalProperty/premises001#object1" />
<first:prop rdf:resource="http://www.w3.org/2002/03owlt/FunctionalProperty/premises001#object2" />
</rdf:Description>
</rdf:RDF>
After pointing the parser at the relevant RDF, we can run the inference engine:
<!-- Processed by Id: cwm.py,v 1.97 2002/07/06 12:52:02 timbl Exp -->
<!-- using base file:/home/katz/semweb/lisa/test-611-011.n3 -->
<rdf:RDF
xmlns="http://www.w3.org/2002/03owlt/FunctionalProperty/premises001#"
xmlns:log="http://www.w3.org/2000/10/swap/log#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xmlns="http://www.w3.org/2002/03owlt/FunctionalProperty/premises001#">
<rdf:Description rdf:about="http://www.w3.org/2002/03owlt/FunctionalProperty/premises001#object1">
<owl:sameIndividualAs rdf:resource="http://www.w3.org/2002/03owlt/FunctionalProperty/premises001#object1"/>
<owl:sameIndividualAs rdf:resource="http://www.w3.org/2002/03owlt/FunctionalProperty/premises001#object2"/>
</rdf:Description>
</rdf:RDF>
Our reasoner passed the positive test: the expected triples were inferred.