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
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
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
Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
4
2. Semantic Web - Basic ArchitectureLanguages of the Semantic Web - Part 1
Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
5
Why RDFSchema...?
Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
5
Why RDFSchema...?
• An application program can define and use RDF data
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.
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, …
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…
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, …
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.....
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?
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?
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?
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
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”
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
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
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
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
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
Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam
s – subclass relationt – instance relation
rdfs:Resourcerdfs:Class
t
ts
Language Model
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
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
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
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
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
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
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
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