30
This file is licensed under the Creative Commons Attribution-NonCommercial 3.0 (CC BY-NC 3.0 ) Dr. Harald Sack Hasso Plattner Institute for IT Systems Engineering University of Potsdam Spring 2013 Semantic Web Technologies Lecture 2: Semantic Web - Basic Architecture I 06: How to Model Classes and Relations? - RDFS

OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

This file is licensed under the Creative Commons Attribution-NonCommercial 3.0 (CC BY-NC 3.0)

Dr. Harald Sack

Hasso Plattner Institute for IT Systems Engineering

University of Potsdam

Spring 2013

Semantic Web Technologies

Lecture 2: Semantic Web - Basic Architecture I06: How to Model Classes and Relations? - RDFS

Page 2: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

2

Lecture 2: Semantic Web - Basic Architecture I

Open HPI - Course: Semantic Web Technologies

Page 3: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

3

SO ... WE NEED A WAY TO DEFINE RDF SCHEMATA FORCLASSES AND RELATIONS ?!

06 How to Model Classes and Relations? - RDFS

Open HPI - Course: Semantic Web Technologies - Lecture 2: Semantic Web Basic Architecture I

Page 4: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

4

2. Semantic Web - Basic ArchitectureLanguages of the Semantic Web - Part 1

Page 5: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

5

Why RDFSchema...?

Page 6: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

5

Why RDFSchema...?

• An application program can define and use RDF data

Page 7: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

5

Why RDFSchema...?

• An application program can define and use RDF data

• ….if the application program knows, which terms and classes to use, as e.g.

Page 8: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

5

Why RDFSchema...?

• An application program can define and use RDF data

• ….if the application program knows, which terms and classes to use, as e.g.

•name, title, year, …

Page 9: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

5

Why RDFSchema...?

• An application program can define and use RDF data

• ….if the application program knows, which terms and classes to use, as e.g.

•name, title, year, … •name, blog, phone number…

Page 10: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

5

Why RDFSchema...?

• An application program can define and use RDF data

• ….if the application program knows, which terms and classes to use, as e.g.

•name, title, year, … •name, blog, phone number…•author, cites, …

Page 11: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

5

Why RDFSchema...?

• An application program can define and use RDF data

• ….if the application program knows, which terms and classes to use, as e.g.

•name, title, year, … •name, blog, phone number…•author, cites, …

• But.....

Page 12: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

5

Why RDFSchema...?

• An application program can define and use RDF data

• ….if the application program knows, which terms and classes to use, as e.g.

•name, title, year, … •name, blog, phone number…•author, cites, …

• But.....

• Are all terms known?

Page 13: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

5

Why RDFSchema...?

• An application program can define and use RDF data

• ….if the application program knows, which terms and classes to use, as e.g.

•name, title, year, … •name, blog, phone number…•author, cites, …

• But.....

• Are all terms known?• Are all terms correct?

Page 14: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

5

Why RDFSchema...?

• An application program can define and use RDF data

• ….if the application program knows, which terms and classes to use, as e.g.

•name, title, year, … •name, blog, phone number…•author, cites, …

• But.....

• Are all terms known?• Are all terms correct?• Are there (logical) relations among the terms?

Page 15: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

5

Why RDFSchema...?

• An application program can define and use RDF data

• ….if the application program knows, which terms and classes to use, as e.g.

•name, title, year, … •name, blog, phone number…•author, cites, …

• But.....

• Are all terms known?• Are all terms correct?• Are there (logical) relations among the terms?

• We need a language for data definition: RDF Schema

Page 16: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

5

Why RDFSchema...?

• An application program can define and use RDF data

• ….if the application program knows, which terms and classes to use, as e.g.

•name, title, year, … •name, blog, phone number…•author, cites, …

• But.....

• Are all terms known?• Are all terms correct?• Are there (logical) relations among the terms?

• We need a language for data definition: RDF Schema

• officially called “RDF Vocabulary Description Language”

Page 17: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

6• First W3C draft in April 1998,

W3C Recommendation Feb. 2004.

• RDF Schema defines a data model for the creation of RDF statements

• RDFSchema allows:

• Definition of classes

•Class instantiation in RDF via <rdf:type>

• Definition of properties and restrictions

• Definition of hierarchies

•Subclasses and superclasses

•Subproperties and superproperties

RDFSchema

Page 18: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

7

•Classes• rdfs:Class

Concept of a class, defines an abstract object and is applied (with rdf:type)to create instances

• rdf:Property Base class for properties

• rdfs:Literal Class for literals

• rdfs:Resource every entity of an RDF model is instance of this class

• and additionallyrdfs:Datatype, rdf:XMLLiteral, rdfs:Container, rdfs:ContainerMembershipProperty

Vocabulary

Page 19: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

8

exv:isManagedByexv:SemanticWebTechnologies exv:HaraldSack

StaffisManagedBy

domainrange

rdf:type rdf:typeRDF

RDFS

Example

rdfs:Class

rdf:type

rdf:Property

rdf:type

Lecture

rdfs:Class

rdf:type

rdfs:Resourcerdfs:subClassOf

rdfs:subClassOf

rdfs:subClassOf

Page 20: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

9

•Properties• rdfs:subClassOf

transitive property to define inheritance hierarchies for classes

• rdfs:subPropertyOftransitive property to define inheritance hierarchies for properties

• rdfs:domain defines the domain of a property concerning a class

• rdfs:range defines range of a property concerning a class

Vocabulary

Page 21: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

10

exv:isManagedByexv:SemanticWebTechnologies exv:HaraldSack

Lecture

Staff

Prof. SeniorResearcher

Course

Seminar

isManagedBy

rdfs:domain

rdfs:rangesubClassOf

subClassOfsubClassOf

class

classclass class

classproperty

class

subClassOf

rdf:type rdf:typeRDF

RDFS

Example

rdf:Property

rdf:type

rdfs:Class

rdf:type

rdfs:Class

rdf:type

Page 22: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

s – subclass relationt – instance relation

rdfs:Resourcerdfs:Class

t

ts

Language Model

Page 23: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

s – subclass relationt – instance relation

rdfs:Resourcerdfs:Class

t

ts

rdfs:Literal

t s

Language Model

Page 24: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

s – subclass relationt – instance relation

rdfs:Resourcerdfs:Class

t

ts

rdfs:Literal

t s

rdf:Property

t s

Language Model

Page 25: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

s – subclass relationt – instance relation

rdfs:Resourcerdfs:Class

t

ts

rdfs:Literal

t s

rdf:Property

t s

rdfs:range rdfs:domain

tt

rdfs:subClassOf

t rdfs:comment

t

rdf:typet

rdfs:subPropertyOf

t

Language Model

Page 26: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

12

• Further Properties

• rdfs:seeAlsodefines a relation of a resource to another, which explains it

• rdfs:isDefinedBysubproperty of rdf:seeAlso, defines the relation of a resource to its definition

• rdfs:commentcomment, usually as text

• rdfs:label „readable“ name of a resource (contrary to ID)

Vocabulary

Page 27: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

13

exv:isManagedByexv:SemanticWebTechnologies exv:HaraldSack

Lecture

Staff

Prof. SeniorResearcher

Person

Course

Seminar

is managed by

rdfs:domainrdfs:range

rdfs:subClassOf

rdfs:subClassOf

rdfs:subClassOfrdfs:subClassOf

rdfs:subClassOf

rdf:type rdf:type RDF

RDFS

RDF(S) Knowledge Base

A-BoxAssertional Knowledge

T-BoxTerminologcal Knowledge

Page 28: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>

:Course a rdfs:Class .:Lecture a rdfs:Class; rdfs:subClassOf :Course.:Seminar a rdfs:Class ; rdfs:subClassOf :Course.

:Person a rdfs:Class .:Staff a rdfs:Class ; rdfs:subClassOf :Person .:SeniorResearcher a rdfs:Class ; rdfs:subClassOf :Staff .:Professor a rdfs:Class ; rdfs:subClassOf :Staff .

:isManagedBy a rdf:Property; rdfs:domain :Course ; rdfs:range :Staff .

:SemanticWebTechnologies a :Lecture .:HaraldSack a :SeniorResearcher .:SemanticWebTechnologies :isManagedBy :HaraldSack .

Turtle

Example

Page 29: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

• RDFSchema defines a data model for the definition of simple ontologies (knowledge representations).

• Via RDFSchema ontologies RDF statements (facts) can be expressed

•More than XML:

• (small) ontological agreement about modelling primitives

• Possibility to define own vocabularies

RDFS Summary

Page 30: OpenHPI 2.6 - How to Model Classes and Relations - RDFS

Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam

07 How much semantics is there in RDF(S)

Open HPI - Course: Semantic Web Technologies - Lecture 2: Semantic Web Basic Architecture I