Tutorial on the Semantic Web

Ivan Herman, World Wide Web Consortium
Beijing, China, 28 April 2006

3 view of the Earth from space

Semantic Web Tutorial

A Simple RDF Graph with full URI-s

Slides of the presentation held in Beijing, China, on the 28 April 2006, as part of the two days’ event celebrating the opening of the W3C Chinese Office.

Towards a Semantic Web

Towards a Semantic Web


Example: Searching

Example: Automatic Airline Reservation

Example: Data(base) Integration

Example: Digital Libraries

Example: Semantics of Web Services

What Is Needed?

What Is Needed (Technically)?


Basic Metadata Architecture: RDF

RDF Triples

RDF Triples (cont.)

(http://www.ivan-herman.net, http://…/myCalendar, http://…/calendar)

RDF Triples (cont.)

RDF is a Graph

A Simple RDF Example (in RDF/XML)

A Simple RDF Graph with full URI-s
<rdf:Description rdf:about="http://.../membership.svg#FullSlide">
    <axsvg:labelledBy rdf:resource="http://...#BottomLegend"/>

A Simple RDF Example (in Turtle)

A Simple RDF Graph with full URI-s
    axsvg:graphicsType "Chart";
    axsvg:labelledBy <http://...#BottomLegend>;
    axsvg:chartType "Line".

URI-s Play a Fundamental Role

URI-s: Merging

What Merge Can Do...

simple node with myself only
Scotts' environemnt added via a foaf statement starting from me
coauthors of IEEE TVCG paper added by Scott, with Scott, me, and Guy
coauthors of CGF paper added by Guy, with Maylis, me, and Guy
'know' links between me and Maylis and between me and Guy


RDF Vocabulary Description Language (RDFS)
(a.k.a. RDFS)

Need for RDF Schemas

Classes, Resources, …

Classes, Resources, … (cont.)

Classes, Resources in RDF(S)

A slide showing the Flipper with its own Schema and the RDFS entitites, all merged

Schema Example in RDF/XML

<rdf:Description rdf:ID="Dolphin">
  <rdf:type rdf:resource=
<rdf:Description rdf:about="#Flipper">
   <rdf:type rdf:resource="animal-schema.rdf#Dolphin"/>

Inferred Properties

A slide showing an inferred property

Inference: Let Us Be Formal…

  uuu rdfs:subClassOf xxx .
  vvv rdf:type uuu .
Then add:
  vvv rdf:type xxx .


Property Specification Example

A slide showing the Fullslide (in appl. space) with its own Schema and the RDFS entitites, all merged


Literals Serialized


<rdf:Description rdf:about="#Flipper">

In Turtle

   animal:is_TV_Star "True"^^<http://www.w3.org/2001/XMLSchema#boolean>.


Querying RDF Data: SPARQL

How to retrieve triples?

triples = graph.triples((Resource,Property,None))

Querying RDF Graphs

Simple SPARQL Example

SELECT ?cat ?val # note: not ?x!
WHERE { ?x rdf:value ?val. ?x category ?cat }
A simple RDF Graph, with some matching patterns highlighted

Other SPARQL Features

SPARQL Usage in Practice


Ontologies (OWL)


W3C’s Ontology Language (OWL)

Classes in OWL

OWL Resource and Thing

Union of Classes

Showing unionOf with marine mammals

Same Serialized

<owl:Class rdf:ID="MarineMammal">
   <owl:unionOf rdf:parseType="Collection">
       <owl:Class rdf:about="#Dolphin"/>
       <owl:Class rdf:about="#Orca"/>
       <owl:Class rdf:about="#Whale"/>
:Dolphin rdf:type owl:Class.
:Orca     rdf:type owl:Class.
:Whale    rdf:type owl:Class.
:MarineMammal rdf:type owlClass;
   owl:unionOf (:Dolphin, :Orca, :Whale).

Property Restrictions

Property Restrictions in OWL

Property Restriction Example

Restriction example, using allValuesFrom

Property Characterization

The top level OWL property definitions

Characterization Example

Restriction example, using cardinality

OWL: Additional Features

Example: Connecting to Hungarian

Example of equivalence between English and Hungarian terms

However: Ontologies are Hard!

concentric arcs with RDF, RDFS, OWL Lite, DL, and Full

I am sorry, you need to have an SVG enabled browser to see this slide...

Ontologies are Hard! (cont)

concentric arcs with RDF, RDFS, OWL Lite, DL, and Full


RDF/OWL in Practice

RDF in Programming Practice

Example: Jena

  // create a model (a.k.a. Triple Store)
  Model model = new ModelMem();
  Resource subject = model.createResource("URI_of_Subject")
  // 'in' refers to the input file
  model.read(new InputStreamReader(in));
  StmtIterator iter = model.listStatements(subject,null,null);
  while(iter.hasNext()) { 
     st = iter.next();
     p = st.getProperty();
     o = st.getObject();

Jena (cont)

Lots of Other tools


Current/future Developments

Simple Knowledge Organization System

Example: Entries in a Glossary (1)

“(i) Any expression which is claimed to be true. (ii) The act of claiming something to be true.”
“A general concept, category or classification. Something used primarily to classify or categorize other things.”
“(i) An entity; anything in the universe. (ii) As a class name: the class of everything; the most inclusive category possible.”

(from the RDF Semantics Glossary)

Example: Entries in a Glossary (2)

A slide for a simple SKOS glossary

Example: Entries in a Glossary (3)

A slide for a simple SKOS glossary

Example: Thesaurus (1)

Economic cooperation
Used For
Economic co-operation
Broader terms
Economic policy
Narrower terms
Economic integration, European economic cooperation, …
Related terms
Scope Note
Includes cooperative measures in banking, trade, …

(from UK Archival Thesaurus)

Example: Thesaurus (2)

A slide for a simple SKOS thesaurus

Why Having SKOS OWL?

“Core” Vocabularies


Rules Interchange Format Working Group

RIF Phase 1 Goals

RIF Use Cases and Requirements

RIF Phase 2 Goals

Lots of Theoretical Questions to Solve

The traditional layercake model of SW The two tower lternative for the SW architecture (with Rules and Ontologies side by side)

Beyond Rules: Trust

Other Issues…


Available Documents

Some Books

Further Information

SWBP Working Group Documents

Further Information (cont)

Public Fora at W3C

Semantic Web Interest Group
a forum for discussions on applications
RDF Logic
public (archived) mailing list for technical discussions


Some Application Examples

SW Applications

Data integration

MuseoSuomi Application dump DOPE Application dump


Vodafone screen dump

Improved Search via Ontology: GoPubMed

GoPubMed Application dump

Adobe's XMP

XMP Application dump

Baby CareLink

XMP Application dump

Further Information

Logo of the Chinese Office
These slides are at:
Semantic Web homepage
More information about W3C:
Contact information:
Office in China
Mail me: