16
1 PalGov © 2011 1 PalGov © 2011 فلسطينيةلكترونية الية الحكومة ا أكاديمThe Palestinian eGovernment Academy www.egovacademy.ps Tutorial II: Data Integration and Open Information Systems RDF Schema Session 5.2 Prof. Mustafa Jarrar Sina Institute, University of Birzeit [email protected] www.jarrar.info Reviewed by Prof. Marco Ronchetti, Trento University, Italy

Pal gov.tutorial2.session5 2.rdfs_jarrar

Embed Size (px)

Citation preview

Page 1: Pal gov.tutorial2.session5 2.rdfs_jarrar

1PalGov © 2011 1PalGov © 2011

أكاديمية الحكومة اإللكترونية الفلسطينيةThe Palestinian eGovernment Academy

www.egovacademy.ps

Tutorial II: Data Integration and Open Information Systems

RDF Schema

Session 5.2

Prof. Mustafa Jarrar

Sina Institute, University of Birzeit

[email protected]

www.jarrar.info

Reviewed by

Prof. Marco Ronchetti, Trento University, Italy

Page 2: Pal gov.tutorial2.session5 2.rdfs_jarrar

2PalGov © 2011 2PalGov © 2011

About

This tutorial is part of the PalGov project, funded by the TEMPUS IV program of the

Commission of the European Communities, grant agreement 511159-TEMPUS-1-

2010-1-PS-TEMPUS-JPHES. The project website: www.egovacademy.ps

University of Trento, Italy

University of Namur, Belgium

Vrije Universiteit Brussel, Belgium

TrueTrust, UK

Birzeit University, Palestine

(Coordinator )

Palestine Polytechnic University, Palestine

Palestine Technical University, PalestineUniversité de Savoie, France

Ministry of Local Government, Palestine

Ministry of Telecom and IT, Palestine

Ministry of Interior, Palestine

Project Consortium:

Coordinator:

Dr. Mustafa Jarrar

Birzeit University, P.O.Box 14- Birzeit, Palestine

Telfax:+972 2 2982935 [email protected]

Page 3: Pal gov.tutorial2.session5 2.rdfs_jarrar

3PalGov © 2011 3PalGov © 2011

© Copyright Notes

Everyone is encouraged to use this material, or part of it, but should

properly cite the project (logo and website), and the author of that part.

No part of this tutorial may be reproduced or modified in any form or by

any means, without prior written permission from the project, who have

the full copyrights on the material.

Attribution-NonCommercial-ShareAlike

CC-BY-NC-SA

This license lets others remix, tweak, and build upon your work non-

commercially, as long as they credit you and license their new creations

under the identical terms.

Page 4: Pal gov.tutorial2.session5 2.rdfs_jarrar

PalGov © 2011 4

Tutorial Map

Topic h

Session 1: XML Basics and Namespaces 3

Session 2: XML DTD’s 3

Session 3: XML Schemas 3

Session 4: Lab-XML Schemas 3

Session 5: RDF and RDFs 3

Session 6: Lab-RDF and RDFs 3

Session 7: OWL (Ontology Web Language) 3

Session 8: Lab-OWL 3

Session 9: Lab-RDF Stores -Challenges and Solutions 3

Session 10: Lab-SPARQL 3

Session 11: Lab-Oracle Semantic Technology 3

Session 12_1: The problem of Data Integration 1.5

Session 12_2: Architectural Solutions for the Integration Issues 1.5

Session 13_1: Data Schema Integration 1

Session 13_2: GAV and LAV Integration 1

Session 13_3: Data Integration and Fusion using RDF 1

Session 14: Lab-Data Integration and Fusion using RDF 3

Session 15_1: Data Web and Linked Data 1.5

Session 15_2: RDFa 1.5

Session 16: Lab-RDFa 3

Intended Learning Objectives

A: Knowledge and Understanding

2a1: Describe tree and graph data models.

2a2: Understand the notation of XML, RDF, RDFS, and OWL.

2a3: Demonstrate knowledge about querying techniques for data

models as SPARQL and XPath.

2a4: Explain the concepts of identity management and Linked data.

2a5: Demonstrate knowledge about Integration &fusion of

heterogeneous data.

B: Intellectual Skills

2b1: Represent data using tree and graph data models (XML &

RDF).

2b2: Describe data semantics using RDFS and OWL.

2b3: Manage and query data represented in RDF, XML, OWL.

2b4: Integrate and fuse heterogeneous data.

C: Professional and Practical Skills

2c1: Using Oracle Semantic Technology and/or Virtuoso to store

and query RDF stores.

D: General and Transferable Skills

2d1: Working with team.

2d2: Presenting and defending ideas.

2d3: Use of creativity and innovation in problem solving.

2d4: Develop communication skills and logical reasoning abilities.

Page 6: Pal gov.tutorial2.session5 2.rdfs_jarrar

6PalGov © 2011 6PalGov © 2011

RDF Schema

• RDF Schema provides the framework to describe application-

specific classes and properties.

• RDF Schema ‘semantically extends’ RDF to enable us to talk

about classes of resources, and the properties that will be used with

them.

• Classes in RDF Schema is much like classes in object oriented

programming languages. This allows resources to be defined as

instances of classes, and subclasses of classes.

• RDF schemas are Web resources (and have URIs) and can be

described using RDF

Page 7: Pal gov.tutorial2.session5 2.rdfs_jarrar

7PalGov © 2011 7PalGov © 2011

Describing Classes with RDFS

• To describe classes we can use built in RDF Schema

resources:

• rdfs:Class

• rdfs:subClassOf

• These are used in conjunction with the rdf:type property.

:Person:Man

:Edward Said

rdfs:Class

Rdfs:subclassOf

Rdf:Type

Rdf:Type

Page 8: Pal gov.tutorial2.session5 2.rdfs_jarrar

8PalGov © 2011 8PalGov © 2011

Defining a class (e.g., passport)

<?xml version="1.0"?>

<rdf:RDF xmlns:rdf="http://www.egov.pal-rdf-syntax-ns#"

<rdfs:Class rdf:ID=“passport“/>

<rdfs:Class rdf:ID=“passport">

<rdfs:subClassOf rdf:resource="#personal"/>

</rdfs:Class>

...

</rdf:RDF>

This is read as:

"I hereby define a passport Class. diplomatic is a subClassOf passport.”

personal.rdfs

All classes and

properties are

defined within

rdf:RDF

Defines the

Passport class

Defines the

Diplomatic class

idea Source: Roger L. Costello,David B. Jacobs,The MITRE Corporation

Page 9: Pal gov.tutorial2.session5 2.rdfs_jarrar

9PalGov © 2011 9PalGov © 2011

Describing Properties with RDF(S)

• RDF Schema allows us to describe properties. (Properties are instances of the class rdf:Property!)

• We can specify a domain using rdfs:domain.

• We can specify a range using rdfs:range.

:Person

rdfs:Calss

rdf:Type

Rdf:Type:hasColleague

rdf:Property rdfs:range

rdfs:domain

Page 10: Pal gov.tutorial2.session5 2.rdfs_jarrar

10PalGov © 2011 10PalGov © 2011

RDF Schema

• Defines small Vocabulary for RDF: • Class, subClassOf, type

• Property, subPropertyOf

• domain, range

• Vocabulary can be used to define other vocabularies for your application domain.

Person

Student Researcher

subClassOfsubClassOf

Jeen

type

hasSuperVisor

Frank

type

hasSuperVisor

Page 11: Pal gov.tutorial2.session5 2.rdfs_jarrar

11PalGov © 2011 11PalGov © 2011

RDFS Example

<?xml version="1.0"?>

<rdf:RDF

xmlns:rdf= "http://www.w3.org/1999/02/22-rdf-syntax-ns#"

xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"

xml:base= "http://www.animals.fake/animals">

<rdfs:Class rdf:ID="animal" />

<rdfs:Class rdf:ID="horse">

<rdfs:subClassOf rdf:resource="#animal"/>

</rdfs:Class>

<rdfs:Class rdf:ID="dog">

<rdfs:subClassOf rdf:resource="#animal"/>

</rdfs:Class>

</rdf:RDF>

Observe that it is

an rdf document

Page 12: Pal gov.tutorial2.session5 2.rdfs_jarrar

12PalGov © 2011 12PalGov © 2011

…<rdf:Description ID=“Teacher">

<rdf:type resource=“rdf:Class"/><rdfs:subClassOf rdf:resource=“foaf:Person"/>

</rdf:Description>

<rdf:Description ID=“Course"><rdf:type resource=“rdf:Class"/>

</rdf:Description>

<rdf:Description ID=“Address"><rdf:type resource=“rdf:Class"/>

</rdf:Description>

<rdf:Description ID="Truck"><rdf:type resource="http://www.w3.org/...#Class"/><rdfs:subClassOf rdf:resource="#MotorVehicle"/>

</rdf:Description>

<rdf:Description ID="registeredTo"><rdf:type resource="http://www.w3.org/...#Property"/><rdfs:domain rdf:resource="#MotorVehicle"/>

RDF Schema (Another Example)

Page 13: Pal gov.tutorial2.session5 2.rdfs_jarrar

13PalGov © 2011 13PalGov © 2011

Main RDFS constructs

• rdfs:Class allows to declare a resource as a class for other resources.

• rdfs:subClassOf allows to declare hierarchies of classes.

• rdfs:domain of an rdf:predicate declares the class of the subject in a triple

whose second component is the predicate.

• rdfs:range of an rdf:predicate declares the class or datatype of the object in a

triple whose second component is the predicate.

• rdfs:subPropertyOf is an instance of rdf:Property that is used to state that all

resources related by one property are also related by another.

• rdfs:seeAlso is an instance of rdf:Property that is used to indicate a resource that might

provide additional information about the subject resource.

• rdfs:label is an instance of rdf:Property that may be used to provide a human-readable

version of a resource's name.

• rdfs:comment is an instance of rdf:Property that may be used to provide a human-

readable description of a resource.

• rdfs:Literal is the class of literal values such as strings and integers.property values

such as textual strings are examples of RDF literals. Literals may be plain or typed.

• rdfs:Datatype is the class of datatypes…

Page 14: Pal gov.tutorial2.session5 2.rdfs_jarrar

14PalGov © 2011 14PalGov © 2011

RDFS is not enough

• In the next lecture, we shall learn bout OWL, in order to be

more expressive in representing the meaning.

Page 15: Pal gov.tutorial2.session5 2.rdfs_jarrar

15PalGov © 2011 15PalGov © 2011

A Few Words on RDFa

• Bringing the "Web of Documents“ and the "Web of Data" (Semantic

Web) closer.

• Making XHTML web ages structured data. (by embedding RDF triples

inside XHML).

Page 16: Pal gov.tutorial2.session5 2.rdfs_jarrar

16PalGov © 2011 16PalGov © 2011

A Few Words on Linked Data

• A community project to publish various open datasets as RDF on the

Web and by setting RDF links between data items from different data

sources.

• Data items are linked across datasets (Palestine is DBPedia is the same

Palestine in Yago)

• By May 2009 this had grown to 4.2 billion RDF triples.