SWAT Lab, Lehigh University
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:
HAWKROOT/lib/hawk.jar
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:
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.
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){
......
}
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.
HAWK is distributed under a GNU General Public License.
It includes software developed by the Apache Software Foundation .
HAWK is built on top of other sub-systems which we gratefully acknowledge: