Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Understanding SPARQL

Create journaling micro-blogs with the semantic Web

Andrew Matthews, Architect and developer, 自由职业者
Andrew Matthews is a British Architect and Developer specializing in .NET technologies based in Melbourne, Australia. He's been in the software development industry since the mid-1990s and initially got into computers as a child because of a magazine article about AI that explained it as a test-bed for philosophical ideas. Hardly surprising that he is so excited by the beauty, power, and promise of the Semantic Web. You can find out more about Andrew and read more about the semantic Web and other topics at his blog The Wandering Glitch.

Summary:  The Semantic Web, a knowledge-centric model for the Web's future, supplements human-readable documents and XML message formats with data that can be understood and processed by machines. SPARQL Protocol and RDF Query Language (SPARQL) is to the semantic Web as SQL is to a relational database. It allows applications to make sophisticated queries against distributed RDF databases, and is widely supported by many competing frameworks. This tutorial demonstrates its use through the example of a team tracking and journaling system for a virtual company.

Date:  15 May 2008 (Published 22 Apr 2008)
Level:  Advanced PDF:  A4 and Letter (182 KB)Get Adobe® Reader®

Activity:  28197 views
Comments:  

Before you start

This tutorial is aimed at developers with little or no experience in producing semantic Web applications. It doesn't require any programming or developer tools, but it does assume some familiarity with Web fundamentals. When you complete this tutorial, you will know how to produce RDF and OWL ontologies in the Turtle language. You will know how to host the ontologies using Jena and Joseki and you will know how to query them using SPARQL.

About this tutorial

Frequently used acronyms

  • API: application programming interface
  • DOM: Document Object Model
  • FTP: File Transfer Protocol
  • HTTP: Hypertext Transfer Protocol
  • HTML: Hypertext Markup Language
  • OWL: Web Ontology Language
  • RDF: Resource Description Framework
  • URI: Uniform Resource Identifier
  • URL: Uniform Resource Locator
  • W3C: World Wide Web Consortium
  • XML: Extensible Markup Language

This tutorial introduces SPARQL and the data formats it is based on. It also covers the RDF, RDF Schema, OWL, and Turtle knowledge representation languages. With these languages, you build ontologies or domain models. For the example used throughout this tutorial, you'll build the ontologies and queries for a journaling and booking system to produce semantically tagged twitter-like micro-blogs. You'll query those blog entries to find those in your company with the skills to make up the team for a project that you are bidding for.

The tutorial follows these steps:

  • An introduction to the semantic Web including RDF, OWL and SPARQL
  • How to set up an RDF Triple Store using Joseki
  • Writing the SPARQL queries for the journal system

Prerequisites

You will need the following tools to follow this tutorial:

  • Java™ environment—The Java runtime environment is needed to allow you to run Joseki, the SPARQL server.
  • Joseki—This is an open source SPARQL server produced by Hewlett-Packard. You can get it from http://www.joseki.org/. Follow the links to the download area at SourceForge. Download the latest version of Joseki to your machine, and choose an area to unzip the file to. Take a note of that location, because you will make use of it to create a simple batch file that will fire up the server.
  • Jena—The Semantic Web framework (provided as part of Joseki).
  • Any text editor.

A team at Hewlett-Packard Labs has been developing Joseki since around 2003. It is a layer providing HTTP support to the Jena semantic Web framework, also produced by Hewlett-Packard. It is probably the most popular platform for semantic Web work, and one of its developers is also an editor for the SPARQL standard, so it seldom lags behind the standard by very much, and in some cases is a test bed for new ideas.

Later on, in Configuring Joseki , you can see detailed instructions on how to configure Joseki with the RDF files that you will create.

1 of 7 | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=XML, Web development
ArticleID=301752
TutorialTitle=Understanding SPARQL
publish-date=05152008
author1-email=matthews.andrew@gmail.com
author1-email-cc=dwxed@us.ibm.com