Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Laying the Foundation of a Semantic Web Application

Learn how to select the components that form the core of your semantic web framework.


advertisement
The article Why Migrate to the Semantic Web described the benefits of the semantic web for applications that deal with real world objects. It outlined how an existing web application (CDMS) that stored its data in a relational database now has added benefits as a semantic web application.

As part of the process of migrating to the semantic web, you need to select components that form the core of the semantic web framework. This article outlines the foundations of the application and defines its overall structure.

Requirements of a Semantic Web Framework
For the CDMS application, the main requirements of a semantic web framework include:

  • Core support for RDF, the RDF Schema language (RDFS), and the Web Ontology Language (OWL).
  • Support for the current SPARQL specification, including the ability to easily query external datasets for related items.
  • Support for SPARQL Extensions such as count, insert, update, and delete.
  • Support for transactions because RDF data will be inserted, updated and deleted; possibly in conjunction with updating relational data.
  • Ability to scale efficiently to large datasets.
  • Ability to deploy Linked Data using the methods outlined in the tutorial How to Publish Linked Data on the Web, e.g., appropriately handling content negotiation.
  • Select apply-role based security to publish Linked Data, e.g., for project collaboration scenarios when sharing data externally with project partners.
  • Provide inference capabilities for OWL ontologies.
Selecting a Java Semantic Web Framework
A number of good semantic web development tools are available, in several different programming languages, but for this application the selection is limited to Java based tools. This is because the existing application is written in Java and it is intended to continue using parts of its persistence layer (Hibernate and MySQL) in areas not suited to the semantic web.



Based on their known scalability features (as per the Berlin SPARQL Benchmark), the prime candidates were :

Jena was selected as the main component for this semantic web framework for the following reasons.
  • Jena SDB uses MySQL for the storage of RDF datasets, simplifying integration with the existing MySQL relational database.
  • Jena ARQ provides a leading implementation of SPARQL, including SPARQL Extensions such as count, insert, update, and delete.
  • Jena includes Joseki as an HTTP engine that supports the SPARQL Protocol and the SPARQL RDF Query language. The query engine is based on ARQ. Joseki can also be deployed to Tomcat.
  • Pellet can be added as an external OWL-DL reasoner.
A number of other open source projects provide additional useful functionality for Jena, such as Jenabean and Jfresnel. Additional framework components:
  • Jersey (which is the reference implementation of JAX-RS) was selected to implement RESTful web services, as part of providing Linked Data.
  • The Spring framework and Spring Security were chosen to apply role-based security to the RESTful web services.
Laying the Foundations of the Application
The main steps in laying the foundations of the application are:
  • Installing Jena SDB to store RDF data. This includes populating the SDB with some initial data to confirm the install.
  • Creating a Maven-based web application project that integrates Jena SDB with Joseki, providing a SPARQL end point for querying the RDF data held within Jena SDB.
Installing Jena SDB
Follow these steps to install the Jena SDB:
  1. Download and install MySQL if it is not already installed.
  2. Download Jena SDB 1.1 then use the following steps to install it within MySQL as per the instructions on the wiki.
  3. In MySQL create a database named "sdb", specifying utf8,
    mysql> create database sdb character set utf8 ;
  4. Set up a store description sdb.ttl similar to the SDB example, but with MySQL specifics based on the file SDB-1.1/Stores/sdb-mysql-innodb.ttl found in the SDB distribution, and a database name of "sdb". The other change is to set the sdb:layout to "layout2/index". The index layout ("layout2/index") usually loads faster than the hash form. (sdb.ttl is provided in the attached source code in the src/main/resources directory)
  5. Set up the environment variables listed in the SDB Commands script setup section.
  6. Run the create command to create the tables within the sdb database SDBROOT > bin/sdbconfig -sdb=sdb.ttl -create
  7. Run the test suite: SDBROOT > bin/sdbtest --sdb=sdb.ttl testing/manifest-sdb.ttl
If any tests fail, check the Mysql Notes. Some additional steps to set up utf-8 may be required.


Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap