13. Tools_Frameworks.ppt

Tools & Frameworks
for the Semantic Web
Semantic Web - Fall 2005
Computer Engineering Department
Sharif University of Technology
Outline

Jena


Sesame


A Semantic Web framework
An architecture for storing and querying RDF
data.
Protégé

An environment for creating and editing
ontologies and knowledge bases.
Jena
Introduction
Jena is a Java framework for building
Semantic Web applications.
 Jena is open source software developed in
HP Labs.
 The Jena framework includes:


A RDF API




Reading and writing RDF in RDF/XML, N3 and NTriples
An OWL API
In-memory and persistent storage
RDQL support
Jena Versions

Two versions:

Jena 1



Expressive support for RDF
Limited reasoning facilities (RDQL)
Jena 2


Ontology API included
Support for OWL included
RDF Model

Resource:


Property:


Simple data type (String, Integer, etc).
Statement:


Trait, attribute or relation used to describe a
resource.
Literal:


Anything that can be described with an RDF
expression.
Resource, united with the property and its associated
value.
An RDF Model is a set of statements.
RDF API of Jena
Allows creating and manipulating RDF
Models from Java applications.
 Provides Java classes to represent:






Models.
Resources.
Properties.
Literals.
Statements.
Example: vcards
Create an RDF Model
String
String
String
String
personURI
givenName
familyName
fullName
=
=
=
=
"http://somewhere/JohnSmith";
"John";
"Smith";
givenName + " " + familyName;
// create an empty model
Model model = ModelFactory.createDefaultModel();
Resource johnSmith = model.createResource(personURI);
johnSmith.addProperty(VCARD.FN, fullName);
johnSmith.addProperty(VCARD.N, model.createResource()
.addProperty(VCARD.Given, givenName)
.addProperty(VCARD.Family, familyName));
Writing and Reading the Model

To serialize the model in XML:
model.write(System.out);

To load a model in the memory:
Model model = ModelFactory.createDefaultModel();
model.read(“file:c:/example.owl”);
Navigating the Model

Getting information via the URI of the
resource:
// retrieve the resource John Smith
String johnSmithURI = "http://somewhere/JohnSmith";
Resource jSmith = model.getResource(johnSmithURI);
// retrieve the value of the property N
Resource name = (Resource) jSmith.getProperty(VCARD.N)
.getObject();
// retrieve the value of the property FN
String fullName = (String) jSmith.getProperty(VCARD.FN)
.getObject();
Referring to a Model

Searching information in a model:
// retrieve all the resources of the type vcard
// (assuming that all such resources have a property FN)
ResIterator it = model.listSubjectsWithProperty(VCARD.FN);
while (it.hasNext()) {
Resource r = it.nextResource();
System.out.println(r);
}

More advanced querying:


Use of construction listStatements(Selector s).
Use of RDQL.
Operations on Models
A
model is a set of statements.
 Support of the following operations:
Union.
 Intersection.
 Difference.

// reading the RDF models
model1.read(new InputStreamReader(in1), "");
model2.read(new InputStreamReader(in2), "");
// unifying RDF models
Model model = model1.union(model2);
Ontology API of Jena
Supports RDF Schema, DAML, DAML+OIL
and OWL.
 Language independent.

Example: Camera Ontology
Creation of an Ontology Model
Use of method createOntologyModel().
 Possible to specify:



Used language.
Associated reasoning.
String fileName = "c:/ejemplo.owl";
String baseURI = "file:///" + fileName;
OntModel model =
ModelFactory.createOntologyModel(ProfileRegistry.OWL_DL_LANG);
model.read(new FileReader(schemaFileName), baseURI);
Classes
Classes are basic construction blocks.
 Represented as OntClass.


Example: Obtain subclasses of class Camera.
OntClass camera = model.getOntClass(camNS +
"Camera");
for (Iterator i = camera.listSubClasses();
i.hasNext();) {
OntClass c = (OntClass) i.next();
System.out.println(c.getLocalName());
}
Properties

Represented via
OntProperty.
OntModel m = ModelFactory.createOntologyModel();
OntClass Camera = m.createClass(camNS + "Camera");
OntClass Body = m.createClass(camNS + "Body");
ObjectProperty part = m.createObjectProperty(camNS + "part");
ObjectProperty body = m.createObjectProperty(camNS + "body");
body.addSuperProperty(part);
body.addDomain(Camera);
body.addRange(Body);
Complex Classes
It is possible to define classes by means of
operations for union, intersection,
difference.
 Example:

<owl:Class rdf:ID="SLR">
<owl:intersectionOf rdf:parseType="Collection">
<owl:Class rdf:about="#Camera"/>
<owl:Restriction>
<owl:onProperty rdf:resource="#viewFinder"/>
<owl:hasValue rdf:resource="#ThroughTheLens"/>
</owl:Restriction>
</owl:intersectionOf>
</owl:Class>
// create instance throughTheLens
OntClass Window = m.createClass(camNS + "Window");
Individual throughTheLens =
m.createIndividual(camNS + "ThroughTheLens", Window);
// create property viewfinder
ObjectProperty viewfinder =
m.createObjectProperty(camNS + "viewfinder");
// create restriction hasValue
HasValueRestriction viewThroughLens =
m.createHasValueRestriction(null, viewfinder, throughTheLens);
// create class Camera
OntClass Camera = m.createClass(camNS + "Camera");
// create intersection for defining class SLR
IntersectionClass SLR = m.createIntersectionClass(camNS + "SLR",
m.createList(new RDFNode[] {viewThroughLens, Camera}));
Schema vs Instance Data

Schema

Possible to define:



Classes
Properties (DataTypeProperty, ObjectProperty)
Restrictions
 Types of Data
 Cardinality

Instance Data

Defining instances (individuals) of the Schema
elements.
<owl:Class rdf:ID="Camera">
<rdfs:subClassOf rdf:resource="#Item"/>
</owl:Class>
<owl:DatatypeProperty rdf:ID="name">
<rdfs:domain rdf:resource="#Camera"/>
<rdfs:range rdf:resource=“xsd:string"/>
</owl:DatatypeProperty>
<camera:Camera rdf:ID="camera1">
<camera:name>Kodak</camera:name>
</camera:Camera>
Managing Instance Data
URI = http://test/camera/#Camera
OntClass c = model.getOntClass(URI +#Camera")
OntProperty p = model.getOntProperty(URI +#name")
Individual ind = model.getIndividual(URI +#camera1")
if (ind.hasProperty(p))
Statement st = ind.getProperty(p);
Object l = (Object)st.getObject();
Managing Instance Data

Other operations:

model.listIndividuals()


individual.hasProperty(Property p,Object o)


Returns all instances of the model
Returns True if there is an individual having property p
with value o
ontClass.listInstances();

Returns all instances of the class
Jena Inference Support

Inference  Deduce additional information


The task of inferencing is carried out by
reasoners
Jena comprises a set of basic reasoners






OWL Reasoner
DAML Reasoner
RDF Rule Reasoner
Generic Rule Reasoner
There is a way to include new reasoners
For example:
(?A rdfs:subClassOf ?B)
(?B rdfs:subClassOf ?C)
 (?A rdfs:subClassOf
?C)
Jena Inference Support

To reason, an Inference Model should be
created

Example:
Reasoner reasoner = ReasonerRegistry.getOWLReasoner();
reasoner = reasoner.bindSchema(schema);
InfModel modelInf =
ModelFactory.createInfModel(reasoner,data);
Ontology Validation in Jena
Model schema = ModelLoader.loadModel("file:c:/Schema.owl");
Model data = ModelLoader.loadModel("file:c:/example.owl");
Reasoner reasoner = ReasonerRegistry.getOWLReasoner();
reasoner = reasoner.bindSchema(schema);
InfModel modelInf = ModelFactory.createInfModel(reasoner, data);
ValidityReport vrp1 = modelInf.validate();
if (vrp1.isValid()){
System.out.println(“Valid OWL");
}else {
System.out.println(“Not valid OWL");
for (Iterator i = vrp1.getReports(); i.hasNext();){
System.out.println(" - " + i.next());
}
<camera:Camera rdf:ID="camera1">
<camera:name>KODAK</camera:name>
</camera:Camera>
<owl:DatatypeProperty rdf:ID="name">
<rdfs:domain rdf:resource="#Camera"/>
<rdfs:range rdf:resource=“xsd:integer"/>
</owl:DatatypeProperty>
Error (range check): Incorrectly typed literal due to range (prop,
value)
Culprit =
http://www.xfront.com/owl/ontologies/camera/#camera1
Implicated node:
http://www.xfront.com/owl/ontologies/camera/#name
Implicated node: 'KODAK‘
<owl:Class rdf:ID="Camera">
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="#name" />
<owl:maxCardinality
rdf:datatype=“xsd:nonNegativeInteger">1</owl:maxCardinality>
</owl:Restriction>
</rdfs:subClassOf>
</owl:Class>
<camera:Camera rdf:ID="camera1">
<camera:name>KODAK</camera:name>
<camera:name>OLIMPUS</camera:name>
</camera:Camera>
Error (too many values): Too many values on max-N property (prop,
class)
Culprit = http://www.xfront.com/owl/ontologies/camera/#camera1
Implicated node: http://www.xfront.com/owl/ontologies/camera/#name
Implicated node: http://www.xfront.com/owl/ontologies/camera/#Camera
RDQL

q1 contains a query:
SELECT ?x
WHERE (?x <http://www.w3.org/2001/vcard-rdf/3.0#FN> "John Smith")

For executing q1 with a model m1.rdf:
java jena.rdfquery --data m1.rdf --query q1

The outcome is:
x
=============================
<http://somewhere/JohnSmith/>
Using RDQL from Java Code
It is possible to run RDQL queries from the
Java application.
 The following classes are to be used for
this:






Query
QueryExecution
QueryEngine
QueryResults
ResultBinding
RDQL Example
SELECT ?x, ?fname
WHERE (?x <http://www.w3.org/2001/vcard-rdf/3.0#FN> ?fname)
Query query = new Query("SELECT...") ;
query.setSource(model);
QueryExecution qe = new QueryEngine(query) ;
QueryResults results = qe.exec();
for (Iterator iter = results; iter.hasNext();)
{
ResultBinding res = (ResultBinding) iter.next();
Resource x = (Resource) res.get("x");
Literal fname = (Literal) res.get("fname");
System.out.println("x: " + x + " fname: " + fname);
}
Persistent Models

Jena permits to create persistent models:

such as with relational databases.

Jena 2 supports:

MySQL
 Oracle
 PostgreSQL
To create a persistent model:


ModelFactory.createModelRDBMaker(conn).createModel()
Example
// Create a connection to DB
DBConnection c = new DBConnection(DB_URL, DB_USER, DB_PASS, DB_TYPE);
// Create a ModelMaker for persistent models
ModelMaker maker = ModelFactory.createModelRDBMaker(c);
// Create a new model
Model model = maker.createModel("modelo_1");
// Start transaction
model.begin();
// Read a model from an XML archive
model.read(in, null);
// Commit a transaction
model.commit();
Sesame
When they were out of sight Ali Baba came
down, and, going up to the rock, said, "Open,
Sesame.“
--Tales of 1001 Nights
Querying Levels

RDF documents can be considered at three
different levels of abstraction:
1.
2.
3.

At the syntactic level they are XML documents.
At the structure level they consist of a set of triples.
At the semantic level they constitute one or more
graphs with partially predefined semantics.
Querying at what level is the best?
Querying at the Syntactic Level



In this level we just have an XML document.
So we can Query RDF using an XML query
language. (e.g. XQuery)
But RDF is not just an XML dialect.

XML:



RDF:



Has a tree structure data model.
Only nodes are labeled.
Has a graph structure data model.
Both edges (properties) and nodes (subjects/objects) are
labeled.
Different ways of encoding the same information
in XML are possible.
Querying at the Structure Level

In this level RDF document represents a
set of triples:






Advantage: Independent of the specific XML syntax.
A successful query:


(type, Book, Class)
(subClassOf, FamousWriter, Writer)
(hasWritten, twain/mark, ISBN00023423442)
(type, twain/mark, FamousWriter)
SELECT ?x FROM … WHERE (type ?x FamousWriter)
An unsuccessful query:

SELECT ?x FROM … WHERE (type ?x Writer)
Querying at the Semantic Level

We need a query language that is sensitive to the
RDF Schema primitives:


e.g. Class, subClassOf, Property, …
RQL




RDF Query Language
The first proposal for a declarative query language for
RDF and RDF Schema.
Output of queries is again legal RDF schema code, which
can be used as input of another query.
A sample query:

SELECT Y FROM FamousWriter {X}. hasWritten {Y}
Sesame – Introduction & History


Sesame: An Architecture for Storing and
Querying RDF Data and Schema Information.
The European On-To-Knowledge project kicked
off in Feb. 2000:


This project aims at developing ontology-driven
knowledge management tools.
In this project Sesame fulfills the role of storage and
retrieval middleware for ontologies and metadata
expressed in RDF and RDF Schema.
On-To-Knowledge Project


Sesame is positioned as a central tool in this project.
OntoExtract: extracts ontological conceptual structures
from natural-language documents.


OntoEdit: An ontology editor.
RDF Ferret: A user front-end, that provides search and
query.
RDF Ferret
Sesame
OntoExtract
OntoEdit
What is Sesame?


Sesame is an open source Java framework for
storing, querying and reasoning with RDF and
RDF Schema.
It can be used as:


Standalone Server: A database for RDF and RDF
Schema.
Java Library: For applications that need to work with
RDF internally.
SOAP
HTTP
Sesame’s Architecture
Sesame
HTTP Protocol Handler
Admin Module
SOAP Protocol Handler
Query Module
Export Module
Repository Abstraction Layer (RAL)
Repository
The Repository

DBMSs

Currently, Sesame is able to use







PostgreSQL
MySQL
Oracle (9i or newer)
SQL Server
Existing RDF stores
RDF flat files
RDF network services


Using multiple sesame server to retrieve results for
queries.
This opens up the possibility of a highly distributed
architecture for RDF(S) storing and querying.
Repository Abstraction Layer (RAL)


RAL offers stable, high-level interface for talking
to repositories.
It is defined by an API that offers these
functionalities:




Data is returned in streams. (Scalability)



Add data
Retrieve data
Delete data
Only small amount of data is kept in memory.
Suitable for use in highly constrained environments such
as portable devices.
Caching data (Performance)

E.g. caching RDF schema data which is needed very
frequently.
Stacking Abstraction Layers
Admin Module




Allows incrementally inserting or deleting RDF data in/from
repository.
Retrieves its information form an RDF(S) source
Parses it using an RDF parser
Checks each (S, P, O) statement it gets from the parser for
consistency with the information already present in the
repository and infers implied information if necessary for
instance:




If P equals type, it infers that O must be a class.
If P equals subClassOf, it infers that S and O must be classes.
If P equals subPropertyOf, then it infers that both S and O
must be properties.
If P equals domain or range, then it infers that S must be a
property and O must be a class.
Query Module



Evaluates RQL queries posed by the user
It is independent of the underlying repository. So
it can not use optimizations and query
evaluations offered by specific DBMSs.
RQL queries are translated into a set of calls to
the RAL.

e.g. when a query contains a join operation over two
subqueries, each of the subqueries is evaluated, and the
join operation is then executed by the query engine on
the results.
RDF Export Module


This module allows for the extraction of the
complete schema and/or data from a model in
RDF format.
It supplies the basis for using Sesame with other
RDF tools.
Important Features of Sesame


Powerful query language
Portability



Repository independence
Extensibility


It is written completely in Java.
Other functional modules can be created and be plugged
in it.
Flexible communication by using protocol
handlers

The architecture separates the communication details
from the actual functionality through the use of protocol
handlers.
SeRQL (Sesame RDF Query Language)
It combined the best features of other
query languages: RQL, RDQL, N-Triples,
N3
 Some of the built-in predicates:




{X} serql:directSubClassOf {Y}
{X} serql:directSubPropertyOf {Y}
{X} serql:directType {Y}
Using PostgreSQL as Repository




PostgreSQL is an open-source object-relational
DBMS.
It supports subtable relations between its
tables.
Subtable relations are also transitive.
These relations can be used to model the
subsumption reasoning of RDF schema.
Example RDF Schema & Data
Writer
domain
hasWritten
range
Book
subClassOf
FamousWriter
Schema
Data
type
…/twain/mark
type
hasWritten
…/ISBN00023423442
Storing Schema (in an RDBMS)
Class
SubClassOf
uri
Resource
Writer
FamousWriter
Book
Property
uri
hasWritten
SubPropertyOf
source
Writer
FamousWriter
Book
target
hasWritten
target
Resource
Writer
Resource
Domain
source
source
Range
target
Writer
source
hasWritten
target
Book
Storing Data (PostgreSQL)
Resource
uri
Book
Writer
uri
uri
…/ISBN00023423442
FamousWriter
uri
…/twain/mark
hasWritten
source
target
…/twain/mark
…/ISBN00023423442
In order to decrease the database size another table, called resources, is
added to database which maps resource descriptions to unique IDs.
RDF Schema Ambiguities

There are many ambiguities in RDFS:




RDF Schema is self-describing:



RDF Schema is defined in natural language.
No formal description of its semantic is given.
E.g. about subClassOf it only says that it is a property
with class as its domain and range.
The definition of its terms is itself done in RDF schema.
As a result it consists some inconsistencies.
Circular dependencies in terms definitions:


Class is both a subclass of and an instance of Resource.
Resource is an instance of Class.
Scalability Issues

An experiment using Sesame:

Uploading and querying a collection of nouns
from Wordnet (http://www.semanticweb.org/library)




Consisting of about 400,000 RDF statements.
Using a desktop computer (Sun UltraSPARC 5
workstation, 256MB RAM)
Uploading the Wordnet nouns took 94 minutes.
Querying was quite slow.

Because data is distributed over multiple tables, and
retrieving data needs doing many joins on tables.
Protégé
Protégé - Introduction

Protégé is an extensible, platformindependent environment for creating and
editing ontologies and knowledge bases.

Current version is 3.1.1 but the tutorial in
the next slides is based on version 2.1.1
Tutorial Scenario
Semantic Web for Tourism/Traveling
 Goal: Find matching holiday destinations
for a customer

I am looking for a
comfortable destination
with beach access
Tourism Web
Tourism Semantic Web
OWL
Metadata
(Individuals)
Tourism Ontology
OWL
Metadata
(Individuals)
Destination
Activity
Accomodation
OWL
Metadata
(Individuals)
OWL
Metadata
(Individuals)
Web Services
OWL (in Protégé)
Individuals (e.g., “FourSeasons”)
 Properties




ObjectProperties (references)
DatatypeProperties (simple values)
Classes (e.g., “Hotel”)
Individuals
Represent objects in the domain
 Specific things
 Two names could represent the same
“real-world” individual

Sydney
SydneysOlympicBeach
BondiBeach
ObjectProperties
Link two individuals together
 Relationships (0..n, n..m)

BondiBeach
Sydney
FourSeasons
Inverse Properties
Represent bidirectional relationships
 Adding a value to one property also adds
a value to the inverse property

BondiBeach
Sydney
Transitive Properties
If A is related to B and B is related to C
then A is also related to C
 Often used for part-of relationships

NewSouthWales
Sydney
BondiBeach
hasPart (derived)
DatatypeProperties
Link individuals to primitive values
(integers, floats, strings, booleans etc)
 Often: AnnotationProperties without
formal “meaning”

Sydney
hasSize = 4,500,000
isCapital = true
rdfs:comment = “Don’t miss the opera house”
Classes
Sets of individuals with common
characteristics
 Individuals are instances of at least one
class

Beach
City
Sydney
Cairns
BondiBeach
CurrawongBeach
Range and Domain

Property characteristics


Domain: “left side of relation” (Destination)
Range: “right side” (Accomodation)
Accomodation
Destination
BestWestern
Sydney
FourSeasons
Domains

Individuals can only take values of
properties that have matching domain

“Only Destinations can have Accomodations”
Domain can contain multiple classes
 Domain can be undefined:
Property can be used everywhere

Superclass Relationships
Classes can be organized in a hierarchy
 Direct instances of subclass are also
(indirect) instances of superclasses

Cairns
Sydney
Canberra
Coonabarabran
Class Relationships

Classes can overlap arbitrarily
RetireeDestination
City
Cairns
BondiBeach
Sydney
Class Disjointness


All classes could potentially overlap
In many cases we want to make sure they
don’t share instances
disjointWith
UrbanArea
Sydney
Sydney
City
RuralArea
Woomera
CapeYork
Destination
Creating a new OWL project
Creating simple classes
Creating class hierarchy and set disjoints
Creating Contact class with datatype properties
Editing details of datatype properties
Createing an object property hasContact
Creating an object property with inverse
Creating the remaining classes and properties
Class Descriptions


Classes can be described by their logical
characteristics
Descriptions are “anonymous classes”
Things with three star accomodation
RetireeDestination
SanJose
Sydney
BlueMountains
Things with sightseeing opportunities
Class Descriptions
Define the “meaning” of classes
 Anonymous class expressions are used




“All national parks have campgrounds.”
“A backpackers destination is a destination
that has budget accomodation and offers
sports or adventure activities.”
Expressions mostly restrict property
values (OWL Restrictions)
Class Descriptions: Why?
Based on OWL’s Description Logic support
 Formalize intentions and modeling
decisions (comparable to test cases)
 Make sure that individuals fulfill conditions
 Tool-supported reasoning

Reasoning with Classes

Tool support for three types of reasoning
exists:

Consistency checking:
Can a class have any instances?

Classification:
Is A a subclass of B?

Instance classification:
Which classes does an individual belong to?

For Protégé we recommend RACER.
Restrictions (Overview)

Define a condition for property values







allValuesFrom
someValuesFrom
hasValue
minCardinality
maxCardinality
cardinality
An anonymous class consisting of all
individuals that fulfill the condition
Cardinality Restrictions



Meaning: The property must have at least/at
most/exactly x values
is the shortcut for
and
Example: A FamilyDestination is a Destination that
has at least one Accomodation and at least 2
Activities
allValuesFrom Restrictions
Meaning: All values of the property must
be of a certain type
 Warning: Also individuals with no values
fulfill this condition (trivial satisfaction)
 Example: Hiking is a Sport that is only
possible in NationalParks

someValuesFrom Restrictions



Meaning: At least one value of the property must
be of a certain type
Others may exist as well
Example: A NationalPark is a RuralArea that has at
least one Campground and offers at least one
Hiking opportunity
hasValue Restrictions



Meaning: At least one of the values of the property
is a certain value
Similar to someValuesFrom but with Individuals
and primitive values.
Example: A PartOfSydney is a Destination where
one of the values of the isPartOf property is
Sydney
Enumerated Classes

Consist of exactly the listed individuals
OneStarRating
ThreeStarRating
TwoStarRating
BudgetAccomodation
Logical Class Definitions


Define classes out of other classes

unionOf (or)

intersectionOf (and)

complementOf (not)
Allow arbitrary nesting of class
descriptions (A and (B or C) and not D)
unionOf


The class of individuals that belong to class A
or class B (or both)
Example: Adventure or Sports activities
Adventure
Sports
intersectionOf


The class of individuals that belong to both
class A and class B
Example: A BudgetHotelDestination is a
destination with accomodation that is a budget
accomodation and a hotel
BudgetAccomodation
Hotel
Implicit intersectionOf


When a class is defined by more than one class
description, then it consists of the intersection of
the descriptions
Example: A luxury hotel is a hotel that is also an
accomodation with 3 stars
Hotel
LuxuryHotel
AccomodationWith3Stars
complementOf


The class of all individuals that do not belong to a
certain class
Example: A quiet destination is a destination that
is not a family destination
Destination
QuietDestination (grayed)
FamilyDestination
Class Conditions

Necessary Conditions:
(Primitive / partial classes)
“If we know that something is a X,
then it must fulfill the conditions...”

Necessary & Sufficient Conditions:
(Defined / complete classes)
“If something fulfills the conditions...,
then it is an X.”
Class Conditions (2)
NationalPark
(not everything that fulfills these conditions is a NationalPark)
QuietDestination
(everything that fulfills these conditions is a QuietDestination)
Classification


NationalPark


BackpackersDestination
A RuralArea is a
Destination
A Campground is
BudgetAccomodation
Hiking is a Sport
Therefore:
Every NationalPark is a
Backpackers-Destiantion
Classification (2)


Input: Asserted class definitions
Output: Inferred subclass relationships
Creating an enumerated class out of individuals
Creating a hasValue restriction
Creating a hasValue restriction
Creating a defined class
Classifying Campground
Adding restrictions to City and Capital
Creating defined class BackpackersDestination
Creating defined class FamilyDestination
Creating defined class QuietDestination
Creating defined class RetireeDestination
Classification
Consistency Checking
Visualization with OWLViz
OWL Wizards
Ontology Import
Adds all classes, properties and individuals
from an external OWL ontology into your
project
 Allows to create individuals, subclasses, or
to further restrict imported classes
 Can be used to instantiate an ontology for
the Semantic Web

Tourism Semantic Web (2)
OWL
Metadata
(Individuals)
Tourism Ontology
Destination
Activity
Accomodation
Web Services
Ontology Import with Protégé

On the Metadata tab:


Add namespace, define prefix
Check “Imported” and reload your project
Individuals
Individuals
Generated OWL File
<?xml version="1.0"?>\
<rdf:RDF
xmlns="http://protege.stanford.edu/plugins/owl/owl-library/heli-bunjee.owl#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:travel="http://protege.stanford.edu/plugins/owl/owl-library/travel.owl#"
xml:base="http://protege.stanford.edu/plugins/owl/owl-library/heli-bunjee.owl">
<owl:Ontology rdf:about="">
<owl:imports rdf:resource="http://protege.stanford.edu/plugins/owl/owl-library/travel.owl"/>
</owl:Ontology>
<owl:Class rdf:ID="HeliBunjeeJumping">
<rdfs:subClassOf rdf:resource="http://protege.stanford.edu/plugins/owl/owl-library/travel.owl#BunjeeJumping"/>
</owl:Class>
<HeliBunjeeJumping rdf:ID="ManicSuperBunjee">
<travel:isPossibleIn>
<rdf:Description rdf:about="http://protege.stanford.edu/plugins/owl/owl-library/travel.owl#Sydney">
<travel:hasActivity rdf:resource="#ManicSuperBunjee"/>
</rdf:Description>
</travel:isPossibleIn>
<travel:hasContact>
<travel:Contact rdf:ID="MSBInc">
<travel:hasEmail rdf:datatype="http://www.w3.org/2001/XMLSchema#string">[email protected]
</travel:hasEmail>
<travel:hasCity rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Sydney</travel:hasCity>
<travel:hasStreet rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Queen Victoria
St</travel:hasStreet>
<travel:hasZipCode rdf:datatype="http://www.w3.org/2001/XMLSchema#int">1240</travel:hasZipCode>
</travel:Contact>
</travel:hasContact>
<rdfs:comment rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Manic super bunjee now offers nerve
wrecking jumps from 300 feet right out of a helicopter. Satisfaction guaranteed.</rdfs:comment>
</HeliBunjeeJumping>
</rdf:RDF>
Lots of other tools

RDFStore


Raptor


triple based database systems
RAP


RDF parser library
Kowari, Gateway


RDF framework for Perl
RDF framework for PHP
Validators

For RDF


W3C RDF
For OWL


WonderWeb
Pellet
References

Sesame

User Guide for Sesame
 http://www.openrdf.org/doc/sesame/users/
userguide.html




Broekstra J., Sesame: A Generic Architecture for
Storing and Querying RDF and RDF Schema, ISWC’02
http://sesame.aidministrator.nl
http://www.openRDF.org
Protégé
 http://protege.stanford.edu/

http://www.co-ode.org
References

Jena

Official site of Jena 2


Jena 2 Ontology API


http://jena.sourceforge.net/DB/
Jena 2 Inference support


http://jena.sourceforge.net/tutorial/RDQL/
Jena 2 Database Interface


http://jena.sourceforge.net/tutorial/RDF_API/
A Programmer's Introduction to RDQL


http://jena.sourceforge.net/ontology/
An Introduction to RDF and the Jena RDF API


http://jena.sourceforge.net/
http://jena.sourceforge.net/inference/
Other tools

http://www.daml.org/tools/
The End