Dwelling in the Dream

May 5, 2008

SWRL+Jess in Protege

Filed under: Semantic Web — Tags: , — wrjih @ 1:42 am

Protege-OWL 3.3.1 provides SWRLJessTab plug-in that supports the execution of SWRL rules using the Jess rule engine. When the SWRLTab is activated, the SWRL Editor will display a list of icons on the top right of the SWRL rules table. The Jess tab is activated by pressing the “J” icon.

The Jess rule engine is not open source, we have to download jess.jar from Jess website separately. This JAR must be copied to the Protege-OWL plugins subdirectory in the Protege installation directory (i.e., the ./plugins/edu.stanford.smi.protegex.owl/ subdirectory of the Protege installation directory). Protege-OWL will automatically load this JAR file on startup if it is present in its plugins directory. Please note that the SWRLJessTab should run under Jess 7.0 release version or later.

September 27, 2007

Launch Pellet server and communicate with Protégé-OWL

Filed under: Semantic Web — wrjih @ 3:26 pm

Pellet is an open source, OWL DL reasoner in Java, originally developed at the University of Maryland’s Mindswap Lab. Pellet is now commercially supported by Clark & Parsia LLC. The installation instruction shows as follows:

  • Go to the Download section on the Pellet Web site.
  • Download and unzip the Pellet ZIP file to a location of your choice. To follow is a screenshot of what the Pellet installation should look like on a Windows system after unzipping the file:
  • Pellet File Folder
  • Copy the folder Pellet-1.x (e.g. Pellet-1.5.0) to the working directory (e.g. /MyApp/)
  • Create a desktop shortcut icon for pellet-dig.bat.
  • Pellet desktop icon
  • click the Pellet-DIG.bat Desktop icon, to launch Pellet’s DIG server. (Run the pellet-dig.bat batch file on Windows systems or the pellet-dig.sh file on Unix-like systems). To follow is a screenshot of the DIG server running on a Windows system:.
  • pellet-dig-sever.jpg
  • Launch Protégé and open the “pizza.owl.pprj” file located in /examples/pizza/.

  • Open the OWL Preferences dialog by choosing OWL -> Preferences… from the menu bar.
  • In the Reasoning section of the General tab, enter http://localhost:8081 as the Reasoner URL. To follow is a screenshot of the OWL Preferences dialog with the proper value entered into the Reasoner URL text area:
  • protegepreference.jpg
  • Click Close to dismiss the OWL Preferences dialog.
  • Choose OWL -> Check consistency… from the menu bar.
  • If Pellet has been properly installed and the Protégé-OWL editor properly configured, you will see a dialog with a title that includes the text “Connected to Pellet…”, and Protégé-OWL will have performed a consistency check of the pizza ontology:
  • connected-to-pellet.jpg

January 22, 2007

How to write Protege-OWL API?

Filed under: Semantic Web — wrjih @ 2:38 am

Protégé Plug-in API is a huge program, consists of well-known packages, such as Jena, Xerces, log4j, Junit, etc. If you have no intention of updating the source code, you can pack the sources into jar files for the convenience in the future.

Installation & Getting Started

  1. Download the sources of Protégé-OWL 3.2.1 and Core Protégé and Protégé-Frames 3.2.1
  2. Unzip the files
  3. Copy the sources of Protégé-OWL and Core Protégé to a directory <Protege_Full_dir>/src.
    • Protégé-OWL will create directories and files under edu/stanford/smi/protegex
    • Core Protégé will create directories and files under edu/stanford/smi/protege
  4. Copy the JAR files to <Protege_Full_dir>/lib. I suggest that copy the Protégé-OWL library first, it includes lots of JAR files. While copy the Core Protégé to /lib will contain a duplicate JAR (junit.jar), ignore it, and copy the other two JAR files (looks.jar and unicode_panel.jar) to the library.
  5. Using Java IDE to create a new project in <Protege_Full_dir>, add all JAR in the /lib to java classpath, and then compile all .java files, where the .class files will be created in /class.
  6. Make jar files. Change directory to /class and type the following commands:
    • jar cvf protegex.jar edu/stanford/smi/protegex/*
    • jar cvf protege.jar edu/stanford/smi/protege/*
  7. Copy the /lib/*.jar, protegex.jar and protege.jar to your working directory <Working_dir>.

A Sample Test Program

In your <Working_dir> you can write a small test program, such as the following:

package test;
import edu.stanford.smi.protegex.owl.model.OWLModel;
import edu.stanford.smi.protegex.owl.model.OWLNamedClass;
import edu.stanford.smi.protegex.owl.ProtegeOWL;
public class OWLAPIDemoApplication {
public static void
main(String[] args) {
    OWLModel owlModel = ProtegeOWL.createJenaOWLModel();
    owlModel.getNamespaceManager().setDefaultNamespace("http://hello.com#");
    OWLNamedClass worldClass = owlModel.createOWLNamedClass("World");
    System.out.println("Class URI: " + worldClass.getURI());
  }
}

Execute this program stand-alone. The output should be Class URI: http://hello.com#World.

April 22, 2006

Semantic Web Services

Filed under: Research, Semantic Web, Web Service — wrjih @ 9:49 pm

Semantic Web Services Framework

Theme: Silver is the New Black. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.