HAWK 1.5 Release

Readme file for version 1.5

SWAT Lab, Lehigh University

Overview

HAWK is a repository framework and toolkit that supports OWL. It provides APIs as well as implementations for parsing, editing, manipulating and preservation of OWL ontologies. The design philosophy of HAWK is to separate the generic interfaces and various underlying implementations. Thus, different applications can reuse HAWK and tailor it into the specific domain. For example, an ontology editor may use the in-memory storage model to create an ontology model and serialize it into a physical document, while a knowledge base system may use the database based model to preserve and query the ontologies and instance data. The architecture of HAWK consists of three packages: core, owl and storage. The core package defines the generic interfaces of the data structures of ontology and ontology objects, e.g. class and property. The core package, that is independent of underlying model the application will use, provides an API for constructing and manipulating ontology models. The owl package provides the utilities for parsing and serializing ontologies in OWL language. Again, no assumptions are made as to which storage model will be used. The storage package then supplies the actual data structures in different types, but they all share the same interfaces defined in core package. Moreover, the simpleMeomory package within the storage provides an in-memory implementation of the data model for ontologies.

This HAWK toolkit includes a number of components:

Contacts

Zhengxiang Pan

Installation

Getting started with HAWK

Read HAWK's javadoc.

For the core java OWL API, the key package to look at is edu.lehigh.swat.hawk.core. This package defines all of the key interfaces which the different implementations conform to.

In this version, HAWK provides the following storage models:

  • edu.lehigh.swat.hawk.storage.simplememory - simple memory based model
  • edu.lehigh.swat.hawk.storage.dlmemory - memory based model with inference capability (need a DIG-interfaced reasoner, such as RACER)
  • edu.lehigh.swat.hawk.storage.simpledb - simple database based model (currently works on Microsoft Access and PostgreSQL, but can work on any RDBMS that support standard SQL with minor changes)
  • edu.lehigh.swat.hawk.storage.dldb - database based model with inference capability
  • Note: When you use dlmemory or dldb storage model, the reasoner should be started before the running of HAWK. You may want to download RACER.

    Sample code: read in an ontology to a simple memory storage model.

    import edu.lehigh.swat.hawk.core.*;
    import edu.lehigh.swat.hawk.owl.OwlRdfReader;
    import edu.lehigh.swat.hawk.storage.simplememory.SimpleMemoryStorage;
    ...
    ...
        String url = args[0]; 
    SimpleMemoryStorage storage = new SimpleMemoryStorage();
    OwlRdfReader reader = new OwlRdfReader(storage);
    Document doc = reader.read(url);
    if(doc instanceof Ontology){
    ......
    }

    Sample code: read in an ontology to a simple database storage model.

    import edu.lehigh.swat.hawk.core.*;
    import edu.lehigh.swat.hawk.owl.OwlRdfReader;
    import edu.lehigh.swat.hawk.storage.simpledb.DatabaseStorage;
    ...
    ...
        String url = args[0]; 
    String dbName = args[1];
    SimpleMemoryStorage storage = new DatabaseStorage(dbName);
    storage.open(); OwlRdfReader reader = new OwlRdfReader(storage);
    Document doc = reader.read(url);
    if(doc instanceof Ontology){
    ......
    }

    Instructions on database names:
    The constructor of the DatabaseStorage takes a string describing database location as the parameter.
    For Access databases, this is like "testdb.mdb" or "c:/test/testdb.mdb".
    For PostgreSQL databases, this is in the following format
    user_name:password@jdbc:postgresql:database_name
    The jdbc driver for PostgreSQL is required, it can be downloaded at here.
    For MySQL databases, this is in the following format
    user_name:password@jdbc:mysql://server_address/database_name
    The jdbc driver for MySQL is required, it can be downloaded at here.
    Please make sure that the referring database does exist when you supply a database name.



    License

    HAWK is distributed under a GNU General Public License.

    It includes software developed by the Apache Software Foundation .

    Acknowledgements

    HAWK is built on top of other sub-systems which we gratefully acknowledge: