Csc 8711, Databases and the Web - Project 4

Due: Sunday, April 7th
Individual Assignment.

RDF/Jena API/SPARQL/Web Browser

This project introduces you to Jena API (a Java API for RDF/OWL Ontologies) and SDB, a SPARQL Database Engine.
  1. Visit Jena API and study the Tutorial.
  2. Visit SDB - A SPARQL Database for Jena and study the Tutorial.
  3. Load the Nobel Prize Ontology Data into SDB. nobel.owl.
    Protege IDE (use this to open the OWL files and browse the Ontology).
  4. Build a Java servlets based Web site to browse the Nobel Prize Ontology.

Jena SDB and Servlets - Sample code and instructions

SDB setup and loading KB

Here are the commands to configure and load a SDB triple store with KB:
  • Step 1: Create a configuration file sdb-mysql.ttl with the following contents:
    @prefix sdb:     <http://jena.hpl.hp.com/2007/sdb#> .
    @prefix rdfs:	 <http://www.w3.org/2000/01/rdf-schema#> .
    @prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
    @prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
    
    <store> rdf:type sdb:Store ;
        sdb:layout     "layout2" ;
        sdb:connection <conn> ;
        sdb:engine     "InnoDB" ;      # MySQL specific
    .
    
    <conn> rdf:type sdb:SDBConnection ;
        sdb:sdbType       "MySQL" ;    # Needed for JDBC URL
        sdb:sdbHost       "localhost" ;
        sdb:sdbName       "your-mysql-database-name" ;
        sdb:driver        "com.mysql.jdbc.Driver" ;
        sdb:sdbUser        "your-mysql-id" ;
        sdb:sdbPassword    "your-mysql-password" ;
        .
    
    Please replace sdbName, sdbUser, and sdbPassword values with your mysql account information.
  • Step 2: Then, run the following commands:
    $ sdbconfig --sdb=sdb-mysql.ttl --create
    $ sdbload --sdb=sdb-mysql.ttl nobel.owl
    $ sdbload --sdb=sdb-mysql.ttl nobeldata.owl
    

Java Servlet to Query KB

SDB.java