SWT Lecture Session 5 - RDFS

49
+ RDFS A little semantics goes a long way Mariano Rodriguez-Muro, Free University of Bozen-Bolzano

description

 

Transcript of SWT Lecture Session 5 - RDFS

Page 1: SWT Lecture Session 5 - RDFS

+

RDFSA little semantics goes a long way

Mariano Rodriguez-Muro, Free University of Bozen-Bolzano

Page 2: SWT Lecture Session 5 - RDFS

+Disclaimer

License This work is licensed under a

Creative Commons Attribution-Share Alike 3.0 License (http://creativecommons.org/licenses/by-sa/3.0/)

A few examples from these slides has been taken from Semantic Web for the working Ontologist. Chapter 6.

Some of the slides on the use of taxonomies are based on: http://info.earley.com/webinar-replay-business-value-

taxonomy-aug-2012

Page 3: SWT Lecture Session 5 - RDFS

+Reading material

Semantic Web for the working Ontologist. Chapter 6http://proquest.safaribooksonline.com/book/-/9780123859655

Page 4: SWT Lecture Session 5 - RDFS

+

Overview

Motivation

Ontologies

RDFS ontologies

Annotations

Page 5: SWT Lecture Session 5 - RDFS

+

Motivation

Page 6: SWT Lecture Session 5 - RDFS

+Motivation

Motivations for semantic technology Making the web machine

understandable Expressing knowledge Reasoning with

knowledge

However, points 2 and 3 are not possible with the technologies seen so far

RDF doesn’t define vocabularies, and

Different datasets may use different URI’s to represent the same kind of data

Page 7: SWT Lecture Session 5 - RDFS

+Motivation

Agreement in RDF graphs concerns only the data model and the use of URI as identifiers

No semantics!

Page 8: SWT Lecture Session 5 - RDFS

+Ontologies and Ontology Languages

Page 9: SWT Lecture Session 5 - RDFS

+What is an ontology language?

Specification of valid “axioms”

Specifications of vocabularies with “predefined” meaning in axioms

Informal: Topic Maps, UML diagrams

Formal examples: Predicate Logic, First Order Logic

Semantic Web examples: RDFS SWRL, OWL

Different languages have different expressive power

Axioms allow to produce “inferences”

The more expressive power, more complex and costly the inferences

Page 10: SWT Lecture Session 5 - RDFS

+What is an ontology?

Collections of “axioms”

Describe the meaning of the vocabulary of a domain (e.g., an area of expertise)

Expressed in an Ontology Language

Valuable on their own as knowledge repositories

In combination with data valuable to implement complex behavior with little or no coding

Page 11: SWT Lecture Session 5 - RDFS

+Example: Schema.org

Schema.org IS a simple ontology

Organizes terms in hierarchies with predefined meaning

The language is a variation of RDFS

Page 12: SWT Lecture Session 5 - RDFS

+

RDFSIntroduction by example

Page 13: SWT Lecture Session 5 - RDFS

+RDFS

W3C standard for an ontology language

RDFS introduces resources (URIs) with a predefined meaning

Inference engines that support RDFS allow to take that meaning into account

RDFS inferences extend the RDF graph by means of inference and hence, affect query answering

RDFS is very simple compared to SWRL or OWL, however, it is very useful in many context, allowing for increased productivity, easy data integration and interesting AI applications

Page 14: SWT Lecture Session 5 - RDFS

+Building blocks

New namespace rdfs: <http://www.w3.org/2000/01/rdf-schema#>

New categories: Classes, resources that share something in common, allow

us to group things together. For example, Employee, Company. Resources that identify classes have rdf:type rdfs:Class

Instances, resources that are “members” of a class

Commonly, Class names are nouns

Page 15: SWT Lecture Session 5 - RDFS

+Building blocks

Resources can belong to multiple classes

Page 16: SWT Lecture Session 5 - RDFS

+Building blocks (cont.)

Properties: Resources used as a predicate in statements

Commonly, Property names are multiple words, expressing direction and in camel-casing

Page 17: SWT Lecture Session 5 - RDFS

+RDFS Ontologies

RDFS Axioms Are RDF triples!

RDFS ontology is an RDF graph!

An RDF graph may have a subgraph expressed in RDFS We call the RDFS axioms/triples the Tbox of the ontology

(terminological information, predefined meaning) The rest is the Abox of the ontology (plain data, no

predefined meaning)

Page 18: SWT Lecture Session 5 - RDFS

+Type propagation

RDFS vocabulary:rdfs:subClassOf

Key notions sub class (on the left) super class (on the

right)

Intuitive meaning, if :mariano is an instance of subclass it is also an instance of superclass

Formal meaning: subsets

Inference: type propagation

Similar to inheritance in Object Oriented formalisms

Page 19: SWT Lecture Session 5 - RDFS

+Type propagation

RDFS vocabulary:rdfs:subClassOf

Key notions sub class (on the left) super class (on the

right)

Intuitive meaning, if :mariano is an instance of subclass it is also an instance of superclass

Formal meaning: subsets

Inference: type propagation

Similar to inheritance in Object Oriented formalisms

Page 20: SWT Lecture Session 5 - RDFS

+Relation propagation

RDFS vocabulary:rdfs:subPropertyOf

Key notions sub property(on the left) super property(on the right)

Intuitive meaning, if (x,y) are connected with subproperty they are also connected with superproperty

Formal meaning: subsets (of binary tuples)

Inference: relationship propagation

Page 21: SWT Lecture Session 5 - RDFS

+Relation propagation

RDFS vocabulary:rdfs:subPropertyOf

Key notions sub property(on the left) super property(on the right)

Intuitive meaning, if (x,y) are connected with subproperty they are also connected with superproperty

Formal meaning: subsets (of binary tuples)

Inference: relationship propagation

Page 22: SWT Lecture Session 5 - RDFS

+Types by usage

RDFS vocabulary:rdfs:domain, rdfs:range

Key notions domain of a triple:

the subject range of a triple:

the object

:p rdfs:domain :C > the domain of any triple where :p is the predicate is an instance of :C (similar for rdfs:range)

Formal meaning: if (x,y) in P, then x in :C

Inference: type assignment by property usage

Page 23: SWT Lecture Session 5 - RDFS

+Types by usage

RDFS vocabulary:rdfs:domain, rdfs:range

Key notions domain of a triple:

the subject range of a triple:

the object

:p rdfs:domain :C > the domain of any triple where :p is the predicate is an instance of :C (similar for rdfs:range)

Formal meaning: if (x,y) in P, then x in :C

Inference: type assignment by property usage

Page 24: SWT Lecture Session 5 - RDFS

+Interactions

All inferences interact to allow complex behavior

Page 25: SWT Lecture Session 5 - RDFS

+Interactions

All inferences interact to allow complex behavior

Page 26: SWT Lecture Session 5 - RDFS

+Set intersection

Proper set intersection is not possible in RDFS

However, expressing necessary membership to multiple classes is possible, i.e., A subset B AND C

A rdfs:subClassOf BA rdfs:subClassOf C

considerx rdf:type A

Page 27: SWT Lecture Session 5 - RDFS

+Set intersection

Proper set intersection is not possible in RDFS

However, expressing necessary membership to multiple classes is possible, i.e., A subset B AND C

A rdfs:subClassOf BA rdfs:subClassOf C

considerx rdf:type A

Page 28: SWT Lecture Session 5 - RDFS

+Set intersection

Proper set intersection is not possible in RDFS

However, expressing necessary membership to multiple classes is possible, i.e., A subset B AND C

A rdfs:subClassOf BA rdfs:subClassOf C

considerx rdf:type A

One direction only!

Page 29: SWT Lecture Session 5 - RDFS

+Set intersection

Similar for roles

Page 30: SWT Lecture Session 5 - RDFS

+Set intersection

Similar for roles

Page 31: SWT Lecture Session 5 - RDFS

+Set union

Proper set union is not possible in RDFS

However, A OR B subsetOf C

B rdfs:subClassOf AC rdfs:subClassOf A

considerx rdf:type B

orx rdf:type C

Page 32: SWT Lecture Session 5 - RDFS

+Set union

Proper set union is not possible in RDFS

However, A OR B subsetOf C

B rdfs:subClassOf AC rdfs:subClassOf A

considerx rdf:type B

orx rdf:type C

Page 33: SWT Lecture Session 5 - RDFS

+Set union

For roles. Aligning to a global vocabulary

Page 34: SWT Lecture Session 5 - RDFS

+Set union

For roles. Aligning to a global vocabulary

Page 35: SWT Lecture Session 5 - RDFS

+Equivalence

Merging vocabularies

To account for same use of different terms (classes or properties)

For classes or proeperties

Page 36: SWT Lecture Session 5 - RDFS

+Equivalence

Merging vocabularies

To account for same use of different terms (classes or properties)

For classes or proeperties

Page 37: SWT Lecture Session 5 - RDFS

+Last notes on RDFS axioms

Main new vocabulary: rdfs:subClassOf rdfs:subPropertyOf rdfs:domain rdfs:range

Different from CONSTRAINTS, missing triples are NOT a violation

Allow to infer new information

Allows to implement system behavior!

Page 38: SWT Lecture Session 5 - RDFS

+Open lists revisited

RDFS also facilitates access to Lists

Elements of lists are a possibly infinite set of elements of the form rdf:_1, rdf:_2, etc

Access difficult in practice

RDFS facilitates this by enforcing that: if x rdfs:_1 ythen x rdfs:member b

Page 39: SWT Lecture Session 5 - RDFS

+Open lists revisited

RDFS also facilitates access to Lists

Elements of lists are a possibly infinite set of elements of the form rdf:_1, rdf:_2, etc

Access difficult in practice

RDFS facilitates this by enforcing that: if x rdfs:_1 ythen x rdfs:member b

More detail on this on the lecture aboutRDFS semantics

Page 40: SWT Lecture Session 5 - RDFS

+Axiomatic triples

RDFS enforces certain facts to be always true

These facts are statements (triples)

Referred as Axiomatic triples

Listed in http://www.w3.org/TR/rdf-mt/

More detail on this on the lecture aboutRDFS semantics

Page 41: SWT Lecture Session 5 - RDFS

+RDFS Semantic Conditions

Every resource xx rdf:type rdfs:Resource

Every literal xx rdf:type rdfs:Literal

… etcMore detail on this on the lecture aboutRDFS semantics

Page 42: SWT Lecture Session 5 - RDFS

+Last notes on RDFS axioms

Main new vocabulary (not the only one): rdfs:subClassOf rdfs:subPropertyOf rdfs:domain rdfs:range

Different from CONSTRAINTS, missing triples are NOT a violation

Allow to infer new information

Allows to implement system behavior!

Page 43: SWT Lecture Session 5 - RDFS

+

Hands on examplesFrom Semantic Web for the Working Ontologist

Page 44: SWT Lecture Session 5 - RDFS

+Automatic classification of employees (part 1) Transform into an RDF representation

Automatically catalog objects as Employees, and as Active employees, Suspended employees and Ex-employees using a minimal set of “axioms”

<ID> Project Assignment

AbsentUntil

Termination Date

22 24 - -

34 24 Dec 23, 2012 -

73 - - Jun 4, 2010

Employee table. Primary key: 10Active employees are assigned to projects

Page 45: SWT Lecture Session 5 - RDFS

+Automatic classification of employees (part 2) Transform into an RDF representation

Automatically catalog objects as Employees as managers

<ID> Project Name

<Manager>

24 Project-x 34

25 Project Mayhem

22

Project table. Primary key: IDForeign key <Manager> to Employee table

Page 46: SWT Lecture Session 5 - RDFS

+Align vocabularies

• Align corresponding properties using RDFS

• Align with FOAF vocabulary (when possible) using RDFS (use foaf:name, foaf:homepage)

Page 47: SWT Lecture Session 5 - RDFS

+

Annotations

Page 48: SWT Lecture Session 5 - RDFS

+Annotations

URI’s are not readable

Readable information (comments, names, etc.) can be stored using properties, but

Property names are not standard, however, we could like some standard names for “human oriented information”

RDFS defines: rdfs:label

A readable name for a resource rdfs:comment

Human focused comments

These are propertiesSo, subPropertyOf can be used with them

Page 49: SWT Lecture Session 5 - RDFS

+Redirection

Redirecting to location of documents (RDF) with additional information about a subject

No formal semantics

RDFS provides: rdfs:seeAlso. Additional information rdfs:definedBy. Authority information, primary source.

These are propertiesSo, subPropertyOf can be used with them

Recall the semantic webidea, linked databases