Professional Documents
Culture Documents
04a. Resource Description Framework
04a. Resource Description Framework
04a. Resource Description Framework
Description of resources
Description is a set of attributes, features and relation concerning a resource (metadata)
Essential for understanding and reasoning about resources
The Framework
Provided models, languages and syntaxes for the descriptions
Resource Description Framework (RDF)
RDF is a graph based data model
dbr:Lionel_Messi
rdf:type
dbo:currentMember
dbo:position
dbr:FC_Barcelona dbo:SoccerPlayer
dbr:Forward_(association_football)
dbo: <http://dbpedia.org/ontology/>
dbr: <http://dbpedia.org/resource/>
RDF: Why Graph Model?
rdf:type
dbr:Lionel_Messi dbo:SoccerPlayer
dbo:position dbr:Forward_(association_
dbr:Lionel_Messi
football)
dbo:currentMember dbr:FC_Barcelona
dbr:Lionel_Messi
PREDICATE OBJECT
SUBJECT
Triples as Atoms of Knowledge
Amitav Ghosh has written a thriller book ‘The Calcutta
Chromosome’
(The_Calcutta_Chromosome, author, Amitav_Ghosh)
(The_Calcutta_Chromosome, theme, “thriller”)
Literal
URI
ex:cites
ex:augments
ex:paper1 ex:paper2
ex:hasCoAuthor
tor
http://....#crea http://...#Kroetzsch
http://....#crea
http://...#FSWT.pdf tor
http://...#Hitzler
http:/
/....#
theme
http://...#SW
http:/
/....#
noPage
s
456
Conceptual Vocabularies through Namespaces
Everything in SW is a resource
So do types of resources and relations
Relations and resource types are represented through customized vocabulary
▪ Each of the entries has a URI and is defined wrt a base URI
▪ Namespace
Namespace
rdf
▪ http://www.w3.org/1999/02/22-rdf-syntax-ns#
rdf:type
▪ http://www.w3.org/1999/02/22-rdf-syntax-ns#type
Conceptual Vocabularies through Namespaces
(http://example.org/FSWT.pdf , rdf:type , exs:Book)
(http://example.org/ FSWT.pdf, dc:creator , exr:Sebastian)
(http://example.org/ FSWT.pdf, dc:creator , exr:Kroetzsch)
((http://example.org/ FSWT.pdf, dc:creator , exr:Hitzler)
(http://example.org/ FSWT.pdf, exs:theme , exr:SW)
(http://example.org/ FSWT.pdf, exs:noPages , ‘‘456’’)
• dc
• http://purl.org/dc/elements/1.1/
• exs
• http://example.org/schema#
• exr
• http://example.org#
Data Values in RDF
<http://example.org/FSWT.pdf>
<http://purl.org/dc/elements/1.1/title> “Foundation of SWT”^^xsd:string;
< http://purl.org/dc/elements/1.1/title> “2009-08-06”^^xsd:date.
Language setting
<http://example.org/FSWT.pdf>
<http://purl.org/dc/elements/1.1/title> “Foundation of SWT”@en;
Data Values in RDF
<https://mitpress.mit.edu>
<http://example.org/name> “MIT Press”^^xsd:string,
“MIT Press”@en,
“MIT Press”.
<http://example.org/FSWT.pdf>
<http://example.org/schema#theme>
<http://example.org#Semantic_Web>.
<http://example.org/FSWT.pdf>
http://purl.org/dc/elements/1.1/creator>
<http://example.org#Sebastian>.
Turtle
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix exs: <http://example.org/schema#>.
@prefix exr: <http://example.org/#>.
@prefix dc: <http://purl.org/dc/elements/1.1/>.
<http://example.org/FSWT.pdf> a exs:Book ;
exs:theme <http://example.org#SW>,
dc:creator <http://example.org#Sebastian>,
<http://example.org#Kroetzsch>;
exs:nbPages ‘‘23’’^^xsd:int.
RDF/XML
<?xml version=‘‘1.0’’?>
<rdf:RDF xmlns:rdf=‘‘http://www.w3.org/1999/02/22-rdf-syntax-ns#’’
xmlns:exs=‘‘http://example.org/schema#’’
xmlms:dc=‘‘http://purl.org/dc/elements/1.1/’’>
<rdf:Description rdf:about=‘‘http://example.org/FSWT.pdf’’>
<rdf:type rdf:resource=‘‘http://example.org/schema#Book’’/>
<exs:theme rdf:resource=‘‘http://example.org#Semantic_Web’’/>
<dc:creator rdf:resource=‘‘http://example.org#Sebastian’’/>
<exs:noPages>456</exs:nbPages>
</rdf:Description>
</rdf:RDF>
RDF Serializations
RDF/XML
<?xml version=‘‘1.0’’?>
<rdf:RDF xmlns:rdf=‘‘http://www.w3.org/1999/02/22-rdf-syntax-ns#’’
xmlns:exs=‘‘http://example.org/schema#’’
xmlms:dc=‘‘http://purl.org/dc/elements/1.1/’’>
t ype exs:Book
exs:SW rdf:
eator
dc:cr exr:Sebastian
``456’’^^xsd:int exs:theme
rdf:type foaf:Person
exs:noPages dc:creator
_:abc
exr:FSWT.pdf
foaf:firstName foaf:lastName
rdf:Bag
exr:Virat
rdf:type _1
f:
rd
exr:Indian_Team rdf:_2
ex:hasPlayer exr:Rohit
rd
f :_
3
exr:Shami
Open Container: Bag
The Indian Cricket Team has Virat Kohli, Rohit Sharma and Mahammad Shami as Players
rdf:Seq
exr:Dhawan
rdf:type _1
f:
rd
exr:Innings_x rdf:_2
ex:batsman exr:Rahul
rd
f :_
3
……….
exr:Virat
Open Container : Alternative (Alt)
The Indian Team can have the wicketkeeper to be one of Rishabh Pant, Wriddhiman Saha or KL Rahul
rdf:Alt
exr:Pant
rdf:type _1
f:
rd
exr:Indian_Team rdf:_2
ex:wicketkeeper exr:Rahul
rd
f :_
3
……….
exr:Wriddhiman
Closed Collections
Collections
To represent closed list
Closed Collections
Mahammad Shami took wickets of David Warner, Steve Smith and Aron Finch in order
exr:Shami
ex:wickets
rdf:first
pe exr:Warner
: ty
rdf rdf:rest
rdf:type rdf:first
rdf:List exr:Smith
rd
f :t rdf:rest
yp
e rdf:first exr:Finch
rdf:rest
rdf:nil
Closed Collection
Mahammad Shami took wickets of David Warner, Steve Smith and Aron Finch in order
bject
rdf:su :Lucius
:Arthur_Weasley
:suspected rdf:predicate
:supported
rdf:object
:The_Dark_Lord
rdf:type
rdf:Statement
Reification: Turtle Descrption
Properties:
rdf:type , rdf:subject, rdf:predicate, rdf:object,
rdf:first , rdf:rest, rdf:_n
rdf:value
Resources:
rdf:nil
RDF Vocabulary
RDF representation L
ex:Fabien rdf:type ex:Person P
ex:Fabien rdf:type ex:Man
ex:Fabien rdf:type ex:LivingBeing M
Employ inference
ex:Fabien rdf:type ex:Man
ex:Fabien rdf:type ex:Person
ex:Fabien rdf:type ex:LivingBeing
Terminological Vs. Assertional Knowledge
Terminological
isA LivingBeing
Person
isMotherOf Mother
Schema
isA isA isA
Man Woman
type
type
type
isMotherOf
Fabien Jane Data
Assertional
RDF Schema (RDFS)
What is Schema?
Impose intended structure over data
▪ Organization of data
▪ Schema helps in performing inference over data
Defines the terminological knowledge
RDF Schema
Imposes structure over RDF data
RDFS: RDF Vocabulary Description Language
Types in RDF:
<john, rdf:type, Student>
What is a “Student”?
Define classes:
▪ “Student is a class”
Relationships between classes:
▪ “Student is a sub-class of Person”
Properties of classes:
▪ “Person has a property hasName”
Classes:
<Student, rdf:type, rdfs:Class>
Class hierarchies:
<Student, rdfs:subClassOf, Person>
Properties:
<hasName, rdf:type, rdf:Property>
Property hierarchies:
<hasMother, rdfs:subPropertyOf,hasParent>
RDFS: RDF Vocabulary Description Language
Associating properties with classes (a):
“The property hasName only applies to Person”
<hasName, rdfs:domain, Person>
Associating properties with classes (b):
“The type of value the property hasName is xsd:string”
<hasName, rdfs:range, xsd:string>
Domain Range
Person hasName xsd:string
Domain and Range
Restrict the possible values (instances) of subjects and object
of a given property to members of a specific class or type
PREDICATE
SUBJECT (PROPERTY) OBJECT
Domain: Range:
The subject of the property in The object of the property
the RDF triple must be a in the RDF triple must be a
member of a specific class member of a specific class
[or a literal]
Classes
Class-Subclass hierarchy
RDFS Ontology
Properties
Sub-properties
hasChild
isChildOf
hasFather
hasMother
RDF Schema (RDFS)
RDF Vocabulary Description Language
• rdfs:Resource • rdfs:subClassOf
• class of all resources • relates a class to one of its
• rdfs:Class superclass
• class of all classes • rdfs:subPropertyOf
• rdfs:Literal • Relates a property to one of
• class of all literals its superproperties
• rdf:Property • rdfs:Domain
• class of all properties • Specifies the domain of a
• rdf:Type property
• relates a resource to its • rdfs:Range
class • Specifies the range of a
property
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#">
<rdfs:Class rdf:ID="Musician">
<rdfs:Class rdf:ID="IndianClassicalMusician">
<rdfs:subClassOf rdf:resource="#Musician"/>
</rdfs:Class>
<rdf:Property rdf:ID=“performsWith">
<rdfs:domain rdf:resource="#Instrumentalist"/>
<rdfs:range rdf:resource="#MusicInstrument"/>
</rdf:Property>
<rdf:Property rdf:ID=“performsIn">
<rdfs:domain rdf:resource="#Musician"/>
<rdfs:range rdf:resource="#Concert"/>
</rdf:Property>
</rdf:RDF>
Person
ISA ISA
Male ISA
Female
Musician
Concert
performsIn
ISA
RDFS RaagaMusic
plays
IndianClassicalMusician
Ontology ISA
ISA
Vocalist Instrumentalist
performsWith
MusicInstrument
Flute
RDF pe
r fo
rm
sW
Raaga_yaman it
Individual/ play
s
h
Instance performs
I n Hariprasad_Chaurasia
Dover_Lane_Music_Conference
S rdfs:Resource RDFS Vocabulary and Relation
rdfs:Literal
S T S
T
S S
rdfs:Class T rdf:type
rdf:Property
rdfs:XMLLiteral
T T
S T rdfs:label
rdfs:ConstraintResource
T
T T
S rdfs:comment
S
rdfs:ConstraintProperty
rdfs:subClassOf
T T
rdfs:ContainerMembershipProperty
T T T
S = rdfs:subClassOf
rdf:_1 rdf:_2 rdf:_n
T = rdf:type
Coming up next…..