Home > bossam > New API

New API

I am working on a new release of Bossam. The upcoming release features a newly designed API. The new API exposes more interfaces for accessing the knowledge object model. You’ll be able to create and manipulate fact and rule objects, which will open better support for programming in rules.

The new Bossam operates in push model, like SAX. It pushes derivations and inconsistencies to the listeners that listen to the events generated from the reasoner. Creating a reasoner and executing a reasoning session looks as follows.

// Create a reasoner with the OWL reasoning capability
IReasonerFactory f = ReasonerFactory.getInstance();
IReasoner r = f.createReasoner(ModelType.OWL);
// Read an OWL document specified in N3 from a URL
r.read(ModelType.OWL, Syntax.N3,
       "http://someplace.com/sample.n3");
// Set a listener for events from the reasoner
IReasonerListener l = new MyReasonerListener();
r.setReasonerListener(l);
// Execute a reasoning session.
// Derivations are pushed to the listener
r.run();

The reasoner listener interface has three methods:

  • void onDerivation(IFact f): called when a new fact is derived.
  • void onDerivation(IRule r): called when a new rule is derived.
  • void onInconsistency(IExplanation e): called when an inconsistency is encountered.

As seen in the example code, it’s possible to specify the syntax and the content model when reading in knowledge. For example, if an OWL document specified in RDF/XML is given, it’s possible to read in the document in two ways: either as a plain RDF document or as an OWL document, as shown below.

  • Read the document as a plain RDF document:
    reasoner.read(ModelType.RDF, Syntax.RDFXML, "http://.....");
  • Read the document as an OWL document:
    reasoner.read(ModelType.OWL, Syntax.RDFXML, "http://....");

As such, the new Bossam release will come with new API set, which will not be compatible with the previous releases. Any opinions on the new API and the compatibility issue are welcomed.

The new release will also feature user-defined builtin functions and (limited but working) forgetting.

Stay tuned and let me know if you have any idea to be accompanied to the new release. Thanks!

About these ads
Categories: bossam
  1. August 15, 2008 at 11:33 pm

    This is somthing I have been looking for a long time. Thanks!!!

  2. Ralph
    December 22, 2008 at 10:16 pm

    One question… What is approx. the date of next release? I think to use this project and I’m interesting in a non-died project.

    • December 24, 2008 at 12:11 am

      Well, not decided yet… but it’ll be a middle of Jan. 2009 or so, hopefully. Thank you for your interest in Bossam and I’ll be happy to hear any comments or suggestions.

  3. Vanni
    November 11, 2009 at 3:12 am

    Hi,

    Would you be interested in someone working on a full .NET porting of Bossam, with full concurrency support (via .NET 4 or CCR)?

    Please let me know if interested. Thanks, regards,
    Vanni

  4. November 26, 2009 at 3:57 am

    I highly enjoyed reading your post, keep up writing such interesting stuff.

  5. December 2, 2009 at 11:49 am

    you may also want to check out vtd-xml, the latest and most advanced xml processing model

    vtd-xml

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: