Bossam 0.9b45 Released

February 7, 2007 1 comment

This release includes several enhancements and new features. (1) The RETE core of Bossam is redesigned and it shows a significant improvement. (2) A more elaborated and advanced OWL reasoner, OwlDlTrMReasoner, is added. This reasoner performs OWL reasoning based on elaborated translation and meta-rules. It covers a lot more of OWL reasoning than OwlDlTrHReasoner. Performance measures against famous ontologies and LUBM will soon be posted. (3) It’s possible to assert a rule at the head of rules. These rules, called rule-generating rules (RGR), enable writing more complex & dynamic knowledge and optimizing knowledge structure and performance.

Binary download is available at: http://projects.semwebcentral.org/projects/bossam/

Advertisements
Categories: bossam, news

A new Bossam on Feb. 5

February 2, 2007 7 comments

A new Bossam release is planned on Feb. 5, 2007.

The new release will include better OWL DL reasoning supports:

  • Enhanced coverage on classification based on boolean compositions of classes
  • Enhanced coverage on classification based on nominals (owl:oneOf)

Also, a new rule construct is introduced: rule-generating rules (RGR). With RGR, it’s possible to assert a rule at the consequent as shown below.


rule r is
if causality(?cause, ?result)
then
assert if ?cause then ?result;

RGR will help representing more complex knowledge and optimizing knowledge structure!

Also on performance-side, the RETE core of Bossam is well optimized and it gives a lot better performance than before!

Categories: bossam, news

[BUG] xsd:boolean value reading error

February 2, 2007 2 comments

A bug in reading xsd:boolean value is reported.

Boolean value literals – "true", "false" – which are of type xsd:boolean are misinterpreted by Bossam.

The bug-fix will be included in the next build which will be released on Feb. 05, 2007. Thanks.

(note) Fixed by 0.9b45 release. (2007/02/08)

Categories: bug

Querying RDF/OWL using Bossam

February 1, 2007 4 comments

(Last Update: 2007-07-04T09:01:58)

Here’s a simple example of loading and querying RDF documents. Currently, Bossam does not support SPARQL. You need to write queries in Buchingae rule language for Bossam, and it’s very easy. 🙂

First, we need to load RDF documents into a Bossam reasoner. For our lesson, let’s load the W3C Wine ontology. Once the ontology is loaded, we should perform a reasoning over the wine ontology. As Bossam is a forward-chaining reasoner, a full forward-chaining derivation should be performed first to get full query results. The following is the code sequence.

1) Create an OWL reasoner instance.
IReasoner r = ReasonerFactory.getInstance().createOwlDlTrMReasoner();

2) Load the W3C Wine ontology from a URL.
r.load(IReasoner.OWL, "http://www.w3.org/TR/2004/REC-owl-guide-20040210/wine.rdf");

3) Perform a silent but full forward-chaining derivation. silentRun() does not return conclusions, which benefits it with a slight better performance than run().
r.silentRun();

4) Set some namespaces to write queries in a more compact form.
r.setNamespacePrefix("w", "http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#");
r.setNamespacePrefix("o", "http://www.w3.org/2002/07/owl#");

Now, we’re ready to query the ontology. Some samples follow:

Query 1) (A Simple Query) Retrieve all the Wine instances.
Answer answer = r.ask1("query q is w:Wine(?x);");

Query 2) (A Conjunctive Query) Retrieve all the wines with White color and Full body.
Answer answer = r.ask1("query q is w:hasColor(?x,w:White) and w:hasBody(?x,w:Full);");

Query 3) (A Disjunctive Query) Retrieve all the wines with White color or Rose color.
Answer answer = r.ask1("query q is w:hasColor(?x,w:White) or w:hasColor(?x,w:Rose);");

Query 4) (A Query with Negation As Failure) Retrieve all the wines that are neither White wine nor Red wine.
Answer answer = r.ask1("query q is w:Wine(?x) and not w:WhiteWine(?x) and not w:RedWine(?x);");

Also, not for the Wine ontology, but it’s possible to use filters in the query, as shown below.

Query 5) Retrieve all the teen agers.
Answer answer = r.ask1("query q is p:hasAge(?x,?age) and [?age >= 10] and [?age < 20];");

Well, that’s it for today. Any questions or suggestions are welcomed!

The following is a full Java code for testing. Be sure to add all the JAR files included in the bossam release to your project’s classpath.

package org.etri.bossam.test;

import bossam.app.Answer;
import bossam.app.IReasoner;
import bossam.app.IReasonerFactory;
import bossam.app.ReasonerFactory;

public class WineQuery01
{
 final static String wineURI = "http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#";

 public static void main(String[] args)
 {
  try
  {
   // Creates a reasoner factory
   IReasonerFactory factory = ReasonerFactory.getInstance();
   // Creates a rule-based OWL DL reasoner
   IReasoner r = factory.createOwlDlTrMReasoner();
   // Loads the wine ontology into Bossam
   r.load(IReasoner.OWL, wineURI);
   // Perform a reasoning session
   String result = r.run();
   // Prints out the conclusions
   System.out.println("Conclusions: n" + result);
   // Sets the namespace prefix for querying the wine ontology
   r.setNamespacePrefix("w", wineURI);
   // Throws a query and gets an answer
   Answer answer = r.ask1("query q is w:WhiteWine(?x);");
   // Prints out the query result
   if (answer == null)
   {
    System.out.println("The query returns false!");
   }
   else
   {
    System.out.println("Answer (" + answer.getBindings().size() + "):n" 
                             + answer);
   }
  } 
  catch (Exception e)
  {
   e.printStackTrace();
  }
 }
}

Categories: bossam, manual

Using OwlDlTrHReasoner

January 24, 2007 Leave a comment

OwlDlTrHReasoner is a new OWL DL reasoning module added to Bossam, which shows much better performance than Bossam’s default OWL DL reasoning module. You can create an instance of OwlDlTrHReasoner by calling bossam.app.IReasoner.createOwlDlTrHReasoner().

In Bossam shell, instead of owl, use owltr as follows:

load owltr from http://www.w3.org/TR/2004/REC-owl-guide-20040210/wine;

Yeap. That’s it. OwlDlTrHReasoner completes a forward-chaining reasoning session over the W3C wine ontology in less than 3 seconds, on my 1.8Ghz Core Duo notebook with 128MB of Java heap memory. Not bad, right?

Doesn’t that reasoner lose too many derivations? Well, actually, I have to see from now on… 🙂 I’d be greatly appreciated for any feedback and problem reports on this new reasoner. 🙂

Categories: bossam, manual, rambling

Bossam 0.9b40 Released!

January 24, 2007 Leave a comment

Now, big improvements in performance. With newly added reasoners for OWL reasoning, OwlDlTrHReasoner, resonable performance measures are obtained. Refer to the preliminary LUBM benchmark results. Also, this release includes a feature to present the derivation tree for conclusions. Please refer to the short explanations on explanation.

Highlights for Bossam 0.9b40 Release

  • New Reasoners: OwlDlTrHReasoner and SwrlRdfTrHReasoner are OWL and SWRL reasoners respectively. These reasoners provide better performance than previous reasoners e.g. OwlDlReasoner.
    • Use load owltr to utilize the new OwlDlTrHReasoner in Bossam shell!
  • Explanation: It’s now possible to print out the derivation tree of a derived facts. Please refer to an explanation on the explanation feature.
  • Derived facts with blank nodes now do not appear in the conclusions! It provides more compact view on the conclusions.
  • Several bug-fixes as always…

Notes for the Bossam users!

Highly regarded Bossam users! Please note the following guides!

  • You should always use bossam.app.ReasonerFactory to create reasoner instances. Creators of reasoner classes are now protected so you cannot directly create instances of reasoner classes.
  • You should create an OWL reasoner to load OWL documents, and a SWRL reasoner to load SWRL documents. You cannot load OWL or SWRL documents with the default reasoner created by IReasoner.createReasoner().
  • Use IReasonerFactory.createOwlDlTrHReasoner() for better OWL reasoning performance!
  • Query performance is better optimized for this release. Try querying.

Thank you so much for using Bossam!

Categories: bossam, news

Bossam’s Performance over LUBM

January 24, 2007 2 comments

Recently, a big performance-wise improvement was injected into Bossam. 😉 I performed a preliminary LUBM benchmark with Bossam and got a promising results. The machine was a notebook with a fast Intel Core Duo 1.8Ghz processor and 2 GB of RAM. I assigned 256MB heap memory for the Java machine (JDK 1.3.1) for the test. The test was done on two data sets: one with about 50,000 triples and another with 100,000 triples. As Bossam is the forward-chaining engine, it took a while to finish the full derivation phase. It took about 100 seconds for 100,000 triples and 22 seconds for 50,000 triples. The following chart shows the elapsed time for 13 LUBM queries. Answers were correct. I think the performance figure shown in the chart is not bad for a rule-based OWL reasoner. 🙂

Bossam’s LUBM Benchmark (as of 2007-01-23)

Categories: bossam, performance