Pla, m. curriculo y educacion. campo semantico de la didactica
RDF – Resource Description Framework M. Missikoff – F. Taglino LEKS, IASI-CNR Una piattaforma...
-
Upload
eileen-wheeler -
Category
Documents
-
view
216 -
download
1
Transcript of RDF – Resource Description Framework M. Missikoff – F. Taglino LEKS, IASI-CNR Una piattaforma...
RDF – ResourceDescription Framework
M. Missikoff – F. TaglinoLEKS, IASI-CNR
Una piattaforma inferenziale per il Web Semantico: Jena2
Roma, 2006
Web Semantico
2
Summary Motivations RDF knowledge model RDF(S) modelling notions XML/RDF, an XML syntax for RDF(S) Using RDF for inferring knowledge Extending RDF(S): OWL Conclusions
3
Motivations Semantic Web: Information needs to be
processed by applications, rather than being only displayed to people (e.g., like with HTML)
Common convention about semantics, syntax, and structure required
Define a language for representing meta-data, with a semantic “flavor”
4
What is RDF? The Resource Description Framework is a
Flexible language for representing knowledge over the web
It models: conceptual knowledge (schemas) and factual knowledge (data)
Enables the encoding, exchange, and reuse of structured knowledge about defined entities (identified by URI)
Enables data interoperability through the design of mechanisms that support common conventions of semantics, syntax, and structure.
The W3C Recommendation
http://www.w3.org/TR/rdf-syntax-grammar/
5
URI - Uniform Resource Identifier Used to identify items on the Web Anyone can create a URI A URI can be associated to anything
Network-accessible things, e.g., electronic document, image, service, …
Not network-accessible things, e.g., human beings, corporation, book, car, …
Abstract concepts, e.g., creator, member, … Uniform Resource Locator (URL) – one form
of URI e.g., http://www.w3.org
6
RDF (Meta)Model
Resource – thing that can be identified on the Web Property – specific aspect, characteristic, attribute, or
relation used to describe a resource Value - Property’s value: resource or literal Connecting triples together we can represent a graph
resource(subject)
property(predicate)
value(object)
Knowledge is represented as collections of Triples
7
RDF: abstract (graph) representation
johnjohn
has_age
johnjohn PersonPersontype
ProfProfStudentStudent
subClassOf
marymaryhas_sister
2727
8
Statement (triple) The following sentence
http://www.example.org/index.html has creator whose_value_is John Smith
Can be expressed by an RDF statement having: Subject http://www.example.org/index.html Predicate http://purl.org/dc/creator Object John Smith
9
Basic RDF Model - example
http://www.example.org/index.html has creator whose value is John Smith
http://www.example.org/index.html John SmithJohn Smith
http://purl.org/dc/creator
resource(subject)
property(predicate)
value(object)
RDF Statement
Please Note: when the object is a Literal it is represented by a BOX
10
RDF Schema The purpose is to define an XML vocabulary to:
Denote classes (subclasses) and their relationships Define properties and associate them with classes
The benefit is that Data are modeled according to schema (as usual in
DB) inferencing on data, and enhanced searching are
facilitated
http://www.w3.org/TR/rdf-schema/
11
Knowledge model of RDF(S)
ClassClass rangerange
RDF(S)Meta-model
Application specific schema(RDF(S) Model)
Application specific actual data(RDF Instances)
property
PersonPerson IntInthas_age
JohnJohnhas_age
2323
12
RDF(S) modelling notionsThe following RDF(S) modelling notions are presented Schema definition: useful for defining new
vocabularies (i.e., names of classes, of attributes, …) Utility: additional notions useful to enrich the entity
definiton Label and Comment Complex Structures, e.g., Container Synonyms
Note: we will present a simplified version of RDF(S). In particular, “reification” will be omitted
13
Schema definition (RDFS vocabulary) rdfs:Class
Set of resources rdfs:subClassOf
For defining specialisation among Classes rdfs:domain and rdfs:range
Constraints on properties definition rdfs:subProperty
For defining specialisation among Properties rdf:Property
Borrowed from RDF (ground), but used at schema level
14
rdfs:Class Class is a resource denoting a set of
resources (instances) Examples:
Person River PersonPerson
rdfs:Classrdfs:Class
RiverRiver
<rdfs:Class rdf:ID=“River”/><rdfs:Class rdf:ID=“Person”/>
15
rdfs:subClassOf – Example
<rdfs:Class rdf:ID=“NaturallyOccurringWaterSource”/><rdfs:Class rdf:ID=“BodyOfWater”/> <rdfs:subClassOf rdf:resource=“#NaturallyOccurringWaterSource”/></rdfs:Class><rdfs:Class rdf:ID=“Stream”> <rdfs:subClassOf rdf:resource=“#NaturallyOccurringWaterSource”/></rdfs:Class><rdfs:Class rdf:ID=“River”> <rdfs:subClassOf rdf:resource=“#Stream”/></rdfs:Class>…
NaturallyOccurringWaterSourceNaturallyOccurringWaterSource
StreamStream BodyOfWaterBodyOfWater
BrookBrook RiverRiver TributaryTributary LakeLake OceanOcean SeaSea
rdfs:subClassOf
16
rdfs:subClassOf – Properties Allows specialisation hierarchy among
Classes to be defined Multiple subClassOf properties may be
specified Transitive (i.e., any River is a
NaturallyOccurringWaterSource too)
17
Definition of a Property at intensional level rdfs:domain and rdfs:range
Used to define properties at intentional level rdfs:domain, restricts the set of resources
that may have a given property rdfs:range, restricts the set of valid values
for a property. A property may have multiple domain, and
more than one range
18
Example of definition of a Property at intensional level (1)
<rdfs:Class rdf:ID=“River”/><rdf:Property rdf:ID=“hasName”> <rdfs:domain rdf:resource=“#River”/> <rdfs:range
rdf:resource=“http://www.w3.org/2000/01/rdfschema#Literal”/></rdf:Property>
RiverRiver
rdfs:Literalrdfs:Literal
hasNamehasName
rdfs:domain
rdfs:range Class representingliterals (strings)
A River has a name expressed as a Literal
rdf:Property
rdfs:Class
19
Example of definition of a Property at intensional level (2)
<rdf:Property rdf:ID=“emptiesInto”> <rdfs:domain rdf:resource=“#River”/> <rdfs:range rdf:resource=“#BodyOfWater”/></rdf:Property>
RiverRiver
BodyOfWaterBodyOfWater
emptiesIntoemptiesInto
rdfs:domain
rdfs:range
rdf:Property
rdfs:Class
rdfs:Class
20
rdfs:subPropertyOf Allows specialisation hierararchy among
properties to be defined Multiple subPropertyOf properties for the
same property can be specified
21
Example of a subProperty definition
<rdf:Property rdf:ID=“hasParent”> <rdfs:domain rdf:resource=“#Person”/> <rdfs:range rdf:resource=“#Person”/></rdf:Property ><rdf:Property rdf:ID=“hasMother”> <rdfs:subPropertyOf rdf:resource=“#hasParent”/></rdf:Property>
PersonPerson hasParenthasParent
hasMotherhasMother
rdfs:domain
rdfs:rangerdfs:subPropertyOf
The hasMother property is a sub property of the hasParent property
rdfs:Classrdf:Property
rdf:Property
22
Class instance definitionrdf:type Instances are defined through the rdf:type
property
YangtzeYangtze RiverRiverrdf:type
<rdf:Description rdf:ID=“Yangtze”> <rdf:type rdf:resource=“River”/></rdf:Description>
The Yangtze is an instance of the River Class
23
Utility notions rdfs:label and rdfs:comment
For describing resources with human readable text
rdfs:Container Collections of resources
rdfs:seeAlso and rdfs:isDefinedBy For referring to alternative descriptions of
resources
24
rdfs:label and rdfs:commentDescribe a resource with human readable text in
addition to pure RDF properties rdfs:label, to assign a human readable name to a
resource rdfs:comment, to give a longer natural language
description to a resource YangtzeYangtze
The biggest Chinese riverThe biggest Chinese river
rdfs:label
rdfs:comment
http://www.china.org/geography/rivers/Yangtze
http://www.china.org/geography/rivers/Yangtze
<rdf:Description rdf:ID=“http://www.china.org/geography/rivers/Yangtze”> <rdfs:label>Yangtze</rdfs:label> <rdfs:comment>The biggest Chinese river</rdfs:comment></rdf:Property>
25
Summary of RDF(S) modeling constructs rdfs:Class and rdf:type rdfs:subClassOf rdfs:domain and rdfs:range rdfs:subProperty and rdf:property rdfs:label and rdfs:comment rdfs:Container rdfs:seeAlso and rdfs:isDefinedBy rdf:Resource (the generic entity) rdf:ID (when the entity is first introduced) rdf:about (when the entity is referred to) rdf:Description
26
How RDF can be implemented
Diagrammatic representation is an Abstract Syntax
Several Concrete Sintaxes: usually RDF/XML syntax
However, other notations possiblee.g., Notation3 (N3):<#pat> <#loves> <#joe><http://xyz.org/#a> <http://xyz.org/#b> <http://xyz.org/#c><http://xyz.org/#Sean> <http://xyz.org/#name> “Sean”
RDF/XML Abreviated syntaxNote: the symbol “#” is a separator between the Prefix and the resource ID
Using RDF(S) for Ontologies and Inferencing
28
An extract of an RDF ontology<?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.geodesy.org/water/naturally-occurring”>
<rdfs:Class rdf:ID=“NaturallyOccurringWaterSource”/><rdfs:Class rdf:ID=“BodyOfWater”/> <rdfs:subClassOf rdf:resource=“#NaturallyOccurringWaterSource”/></rdfs:Class><rdfs:Class rdf:ID=“Stream”> <rdfs:subClassOf rdf:resource=“#NaturallyOccurringWaterSource”/></rdfs:Class><rdfs:Class rdf:ID=“River”> <rdfs:subClassOf rdf:resource=“#Stream”/></rdfs:Class> <rdf:Property rdf:ID=“emptiesInto”> <rdfs:domain rdf:resource=“#River”/> <rdfs:range rdf:resource=“#BodyOfWater”/></rdf:Property><rdf:Property rdf:ID=“length”> <rdfs:domain rdf:resource=“#River”/> <rdfs:range rdf:resource=“http://www.w3.org/2000/01/rdf-schema#Literal”/></rdf:Property >
</rdf:RDF>
Propertiesdefinition
Domain andRange definition
Namespacesdeclaration
Classesdefinition
Sub classesdefinition
29
What inferences can be made?
NaturallyOccurringWaterSourceNaturallyOccurringWaterSource
StreamStream BodyOfWaterBodyOfWater
BrookBrook RiverRiver TributaryTributary LakeLake OceanOcean SeaSea
rdfs:subClassOf
InferenceEngine
<River rdf:ID=“http://www.china.org/geography/rivers/Yangtze”
xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns=“http://www.geodesy.org/river#”><lenght>6300 kilometers</lenght><emptiesInto rdf:resource=“http://www.china.org/EastChinaSea”/>
</River>Inferences:
- Yangtze is a Stream- Yangtze is a NaturallyOccurringWaterSource- http://www.china.org/EastChinaSea is a BodyOfWater
- length: Literal- emptiesInto: BodyOfWater
30
How does a taxonomy facilitate searching?
NaturallyOccurringWaterSourceNaturallyOccurringWaterSource
StreamStream BodyOfWaterBodyOfWater
BrookBrook RiverRiver TributaryTributary LakeLake OceanOcean SeaSea
rdfs:subClassOf
- length: Literal- emptiesInto: BodyOfWater
<River rdf:ID=“http://www.china.org/geography/rivers/Yangtze”
xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns=“http://www.geodesy.org/river#”><lenght>6300 kilometers</lenght><emptiesInto rdf:resource=“http://www.china.org/EastChinaSea”/>
</River>Results:
- Yangtze is a Stream, so this document is relevant to the query
InferenceEngine“Show me all the documents that
contain info about streams”
31
Desire more expressiveness Two classes, same concept
Equivalent classes: Airplane and Plane Cardinality constraints
Ocean has one maxDepth
OWL
RDF(S)
RDF Schema: Building Block to more expressive Ontology Languages like OWL
32
OWL (Ontology Web Language) Provides three increasingly expressive
languages OWL Full maximum expressiveness with no
computational guarantees OWL DL, expressiveness of Description Logics
without losing computational completeness OWL Lite, simple constraint features. E.g.,
cardinality constraints
OWL Lite
OWL DL
OWL Full
33
Rules Allows for derivations, by introducing a
“special” binary predicate: log:implies =>
Subject and Object are RDF triples, called formulae
Derivation (n3 syntax): {X :parent Y; :brother Z } => {Z :uncle Y }
34
Conclusions RDF has potential to make web contents
machine readable RDF describes resources and anything can be
seen as a Resources RDF(S) comprises vocabulary for describing
also the intentional level Several serializations (i.e., RDF/XML, N3) Suitable for applying inference Limited features (i.e., no cardinality
constraints) OWL for a more expressiveness
35
Sources http://www.w3.org/TR/rdf-primer/ http://www.w3.org/TR/rdf-syntax-grammar/ http://www.w3.org/TR/rdf-schema/ P.A. Champin, RDF Tutorial -
http://www710.univ-lyon1.fr/~champin/rdf-tutorial/rdf-tutorial.pdf
A. Wilk, RDF(S) - www.ida.liu.se/labs/iislab/courses/LW/slides/RDFS.pdf
36
Qualche esercizio rapido Rappresentare in RDF alcune frasi di
linguaggio naturale Ugo ama Anna Il treno parte alle 10:40 Il treno è partito in ritardo Le auto vecchie inquinano Il corso di Knowledge Extraction è interessante La prima domenica del mese c’è il mercatino in
Piazza Dante
37
Passaggio a RDF/Diagramma Ugo ama Anna
Ex:Ugo Ex:AnnaEx:ama
Persona
rdf:typeStudente
Rdfs:subClassOf