1
Adapted from slides by Yolanda Gil / ISI - www.isi.edu/~gil/slides/SeWebClass-Feb02.ppt
RDF (Resource Description Framework)
1. RDF provides a way of describing resources via met adat a (dat a about dat a) It restricts the description of resources to triplets (subj ect,predicat e,obj ect) 1. It provides int eroperabilit y bet ween applicat ions that exchange machine underst andable information on t he Web. 3. The broad goal of RDF is to define a mechanism for describing resources that makes no assumptions about a particular application domain, nor defines (a priori) t he semantics of any application domain.
- Uses XML as t he int erchange synt ax.
- Provides a lightweight ont ology syst em.
The formal specification of RDF is available at: ht tp:/ / www.w3.org/ TR/ REC-rdf-synt ax/
2
Adapted from slides by Yolanda Gil / ISI - www.isi.edu/~gil/slides/SeWebClass-Feb02.ppt
RDF Syntax
S ubj ect, Predicate and Obj ect Triplets (Tuples)
- S
ubj ect: The resource being described.
- Predicate: A property of the resource
- Obj ect: The value of t he property
A combination of them is said to be a S tatement (or a rule)
http://foo.bar.org/index.html John Doe Author A web page being described [Subject] A property of the web page (author) [Predicate] The value of the predicate (here the author) [Object]
3
Adapted from slides by Yolanda Gil / ISI - www.isi.edu/~gil/slides/SeWebClass-Feb02.ppt
RDF Example
<? xml version="1.0"? > <rdf:RDF xmlns:rdf="ht t p:/ / www.w3.org/ TR/ WD-rdf-synt ax#" xmlns:s="ht t p:/ / descript ion.org/ schema/ "> <rdf:Description about="http:/ / foo.bar.org/ index.ht ml"> <s:Author>John Doe</ s:Author> </ rdf:Descript ion> </ rdf:RDF>
Namespace for the RDF spec Namespace ‘s’, a custom namespace Subject Author (property of the subject) (Also a resource)
- Object. Can also point to a resource
The above stat ement says : The Aut hor of ht tp:/ / foo.bar.org/ index.html is “ John Doe” In this way, we can have different obj ects (resources) pointing to other obj ects (resources) , thus forming a DLG (Directed Line Graph) You can also make st at ements about stat ements – reification Ex: ‘ xyz’ says that ‘ The Author of http:/ / foo.bar.org/ index.html is John Doe’
4
Adapted from slides by Yolanda Gil / ISI - www.isi.edu/~gil/slides/SeWebClass-Feb02.ppt
RDF Schema
- A schema defines the terms that will be used in the RDF
statements and gives specific meanings to them. http://www.w3.org/TR/rdf-schema/ Example:
<rdf:RDF xml:lang="en" xmlns:rdf="ht tp:/ / www.w3.org/ 1999/ 02/ 22-rdf-syntax-ns#" xmlns:rdfs="ht tp:/ / www.w3.org/ 2000/ 01/ rdf-schema#"> <rdf:Description ID="Mot orVehicle"> <rdf:type resource="htt p:/ / www.w3.org/ 2000/ 01/ rdf-schema#Class"/ > <rdfs:subClassOf rdf:resource="http:/ / www.w3.org/ 2000/ 01/ rdf-schema#Resource"/ > </ rdf:Description> <rdf:Description ID="PassengerVehicle"> <rdf:type resource="htt p:/ / www.w3.org/ 2000/ 01/ rdf-schema#Class"/ > <rdfs:subClassOf rdf:resource="#MotorVehicle"/ > </ rdf:Description> <rdf:Description ID="Truck"> <rdf:type resource="htt p:/ / www.w3.org/ 2000/ 01/ rdf-schema#Class"/ > <rdfs:subClassOf rdf:resource="#MotorVehicle"/ > </ rdf:Description>
RDF Schema Namespace An “ID” attribute actually defines a new resource PassengerVehicle is a subclass of MotorVehicle “Resource” is the top level class
5
Adapted from slides by Yolanda Gil / ISI - www.isi.edu/~gil/slides/SeWebClass-Feb02.ppt
Example (cont..)
<rdf:Description ID="Van"> <rdf:type resource="htt p:/ / www.w3.org/ 2000/ 01/ rdf-schema#Class"/ > <rdfs:subClassOf rdf:resource="#MotorVehicle"/ > </ rdf:Description> <rdf:Description ID="MiniVan"> <rdf:type resource="htt p:/ / www.w3.org/ 2000/ 01/ rdf-schema#Class"/ > <rdfs:subClassOf rdf:resource="#Van"/ > <rdfs:subClassOf rdf:resource="#PassengerVehicle"/ > </ rdf:Description> <rdf:Description ID="registeredTo"> <rdf:type resource="htt p:/ / www.w3.org/ 1999/ 02/ 22-rdf-syntax-ns#Property"/ > <rdfs:domain rdf:resource="#Mot orVehicle"/ > <rdfs:range rdf:resource="#Person"/ > </ rdf:Description> <rdf:Description ID="rearS eat LegRoom"> <rdf:type resource="htt p:/ / www.w3.org/ 1999/ 02/ 22-rdf-syntax-ns#Property"/ > <rdfs:domain rdf:resource="#PassengerVehicle"/ > <rdfs:domain rdf:resource="#Minivan"/ > <rdfs:range rdf:resource="ht tp:/ / www.w3.org/ 2000/ 03/ example/ classes#Number"/ > </ rdf:Description> </ rdf:RDF>
Domain of a property Range of a property Multiple Inheritance
6
Adapted from slides by Yolanda Gil / ISI - www.isi.edu/~gil/slides/SeWebClass-Feb02.ppt