You are on page 1of 35

RDF: Resource Description Framework

RDF is...
A standard syntax to represent (edge labeled) directed graphs in XML ? It is a standard by World Wide Web Consortium
?

An Example

http://www.srdc.metu.edu.tr/~asuman

Creator

Asuman Dogac

* Asuman

Dogac is the value of property Creator for resource http:// www.srdc.metu.edu.tr/~asuman * Resource http:// www.srdc.metu.edu.tr/~asuman has a property Creator with a value Asuman Dogac *Creator of http:// www.srdc.metu.edu.tr/~asuman is Asuman Dogac

RDF Schemas
Describe rules for using RDF properties ? Are expressed in RDF ? Are not to be confused with XML Schemas
?

Schema URIs
?

? ? ? ?

Ordinary XML namespace URIs are just to guarantee uniqueness: there is no assumption that the URI refers to anything useful (or even refers at all) URIs for namespaces used in RDF, though, should refer to an RDF schema document RDF namespace uses rdf prefix by convention RDF Schema namespace uses rdfs prefix by convention Properties are declared in other namespaces, so they are Web-unique
5

Resources, Properties, Statements


? ? ?

All things being described by RDF expressions are called resources Resources are always specified by URIs A property is a specific aspect, characteristic, attribute, or relation used to describe a resource A specific resource together with a named property plus the value of that property for that resource is an RDF statement Statement: subject (resource), predicate (named property), object (property value) Object can be another resource or it can be literal

Example
<?xml version = 1.0?> <rdf:RDF xmlns:rdf=http://www.w3.org/1999/rdf-syntax-ns# xmlns:s=http://description.org/schema/> <rdf: Description about = http://www.srdc.metu.edu.tr/~asuman> <s:Creator> Asuman Dogac</s:Creator> </rdf:Description> </rdf:RDF>

Basic RDF Serialization Syntax


? ?

? ?

The Description element names, in an about attribute, the resource to which each of the statements apply If the resource does not yet exist (i.e. does not have a resource identifier) than a Description element can create the identifier for the resource using an ID attribute Property names must always be associated with a schema This can be done by qualifying the element names with a namespace prefix to connect the property definition with the corresponding RDF schema

Core Classes
?

rdfs:Resource - All things being described by RDF expressions are resources and are considered to be instances of the class rdfs:Resource rdfs:Class - represents the generic concept of a type or category and can be defined to represent almost everything, e.g. Web pages, people, document types rdf:Property - represents the subset of RDF resources that are properties

Example Classes and Subclass property


<rdf:Description ID=BusinessDocs"> <rdf:type resource="http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/> </rdf:Description>
BusinessDocs

The same definition with different syntax


PurchaseOrder <rdfs:Class rdf:ID=BusinessDocs"> <rdfs:subClassOf rdf:resource=#BusinessDocs> </rdfs:Class>

Core Properties
?

rdf:type - indicates that a resource is a member of a class, and thus has all the characteristics that are to be expected of a member of that class When a resource has an rdf:type property whose value is some specific class, we say that the resource is an instance of the specified class The value of an rdf:type property for some resource is another resource which must be an instance of rdfs:Class

What is the rdf:type property?


?

It specifies a class (there may be more than one) to which the resource belongs Its value is always a Web resource representing the class It can be expressed as a type attribute on a Description element It can also be implied by using a special element instead of a Description element

12

Example Classes and Subclass property


<rdf:Description ID=PurchaseOrder"> <rdf:type resource="http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource=# BusinessDocs "/> </rdf:Description> The same definition with different syntax
PurchaseOrder

BusinessDocs

<rdfs:Class rdf:ID="PurchaseOrder"> <rdfs:subClassOf rdf:resource=#BusinessDocs> </rdfs:Class>

Example Property Definition


BusinessDocs poNumber PurchaseOrder Literal

An Example Property Definition: <rdfs:Property rdf:ID=poNumber"> <rdfs:domain rdf:resource="#PurchaseOrder"/> <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdfschema#Literal"/> </rdfs:Property>

An Example Class Instance


<PurchaseOrder rdf:ID=My_PO_for_a_disk"> <PONumber>1234ABCD</PONumber> </PurchaseOrder>

PONumber

My_PO_for_a_disk

1234ABCD

Core Properties
? ? ?

rdfs:subClassOf - This property specifies a subset/superset relation between classes The rdfs:subClassOf property is transitive If class A is a subclass of some broader class B, and B is a subclass of C, then A is also implicitly a subclass of C Consequently, resources that are instances of class A will also be instances of C, since A is a sub-set of both B and C rdfs:subPropertyOf - is an instance of rdf:Property that is used to specify that one property is a specialization of another

Core Properties
rdfs: range - is used to define that the values of a property are instances of one or more stated classes ? rdfs: domain - is used to state that any resource that has a given property is an instance of one or more classes
?

Property-centric classes
In typical OO classes, each class specifies completely what properties it has and what their types are ? In RDF classes, each property specifies what classes of subjects and objects it relates ? Therefore, new properties can be added to a class without modifying the class
?

18

Summary of useful properties


rdf:type relates any resource to its class ? rdfs:subClassOf relates a subclass to its superclass (multiple inheritance is OK) ? rdfs:subPropertyOf relates a subproperty to its superproperty
?

19

Summary of useful properties


rdfs:domain specifies the domain of a property (the classes of its subjects); if unknown, anything can be a subject ? rdfs:range specifies the range of a property (the single class of its objects); if unknown, anything can be an object
?

20

Containers
?

Frequently it is necessary to refer to a collection of resources; RDF containers are used to hold such list of resources or literals Container model ? Bag ? Sequence ? Alternative

Containers
? ? ? ?

Bag: a simple collection with no ordering Seq: a collection with implicit ordering Alt: a set of alternatives (first one preferred) Elements are properties named _1, _2, _3, etc.

22

The Bag
Rdf:Bag Ceng 720 students Rdf:type Rdf._1 Rdf._2 /Students/Ayse /Sudents/Ali

RDF Description of the Example


<rdf:RDF> <rdf:Description about=http://metu.edu.tr/courses/Ceng520> <s:students> <rdf:Bag> <rdf:li resource =http://metu.edu.tr/students/Ali/> <rdf:li resource =http://metu.edu.tr/students/Ayse/> </rdf:Bag> </s:students> </ rdf:Description> </rdf:RDF>

An Example on the use of Collections


<dc:Identifier> <rdf:Bag ID=MirroredSites> <rdf:li rdf:resource=http://www.srdc.metu.edu.tr/yayin.html/> <rdf:li rdf:resource=http://www.srdc.com/papers.html> </rdf:Bag> </dc:Identifier> <dc:Title> <rdf:Alt> <rdf:li xml:lang=tr>Yayinlar</rdf:li> <rdf:li xml:lang=en>Papers</rdf:li> </rdf:Alt> </dc:Title> </ rdf:Description> </rdf:RDF>

Example
<rdf:RDF xmlns:rdf=http://www.w3.org/1999/rdf-syntax-ns#
xmlns:cs="http://www.srdc.metu.edu.tr/Catalog_Schema#">

<rdf:Description about="http://www.srdc.metu.edu.tr/ ElectronicCatalog/Components/C1"> <cs:madeUpOf> <rdf:Bag> <rdf:li resource="http://www.srdc.metu.edu.tr/ ElectronicCatalog/ ComponentParts/P1"/> <rdf:li resource="http://www.srdc.metu.edu.tr/ ElectronicCatalog/ ComponentParts/P2"/> <rdf:Alternative> <rdf:li resource="http://www.srdc.metu.edu.tr/ ElectronicCatalog/ComponentParts/P3"/> <rdf:li resource="http://www.srdc.metu.edu.tr/ ElectronicCatalog/ComponentParts/P4"/> </rdf:Alternative> </rdf:Bag> </cs:made_Up_Of> </rdf:Description> </rdf:RDF>

An Example to Container object Alternative

<rdf:RDF> <rdf:Description about=http://www.w3c.org/XML-QL> <s:DistributionSites> <rdf:Alt> <rdf:li resource=ftp://ftp.att.com/> <rdf:li resource=ftp://ftp.srdc.metu.edu.tr/> <rdf:Alt> </s: DistributionSites> </ rdf:Description> </rdf:RDF>

Reified statements
? ? ?

We reify statements so that we can talk about them rather than asserting them Ali believes that creator of http://srdc.metu.edu.tr is Asuman Dogac In order to model statements about statements RDF models the original statement with 4 properties ? subject: The resource about which the original statement is made ? predicate: Identifies the original property in the modeled statement ? object: Identifies the property value in the modelled statement ? type: describes the type of the new resource. All reified statements are instances of RDF:Statement; that is, they have a type property whose object is RDF:Statement

28

An Example
<rdf:RDF xmlns:rdf=http://www.w3.org/1999/rdf-syntax-ns# xmlns:s=http://description.org/schema/> <rdf: Description> <rdf:subject resource= http://www.srdc.metu.edu.tr/~asuman/> <rdf:predicate resource=http://description.org/schema/Creator/> <rdf:object Asuman Dogac</rdf:object> <rdf:type resource= =http://www.w3.org/1999/rdf-syntax-ns#Statement/> <s:attributedTo> Ali </s:attributedTo>

</ rdf:Description> </rdf:RDF>

Dublin Core
A set of fifteen basic properties for describing generalized Web resources ? The obvious mapping of Dublin Core properties into RDF properties has not yet been approved by the Dublin Core initiative, but is generally a good example
?

30

Dublin Core
Title: the name given to the resource ? Creator: the person or organization primarily responsible for the resource ? Subject: what the resource is about ? Description: a description of the content
?

31

Dublin Core
Publisher: the person or organization responsible for making the resource available ? Contributor: someone who has provided content to the resource other than the creator ? Date: date of creation or publication
?

32

Dublin Core
Type: type of resource, such as home page, technical report, novel, photograph ? Format: data format of the resource ? Identifier: URL, ISBN number, ? Source: another resource that this resource is derived from
?

33

Dublin Core
Language: the language of the content ? Relation: another resource and its relationship to this one ? Coverage: the portion of time or space described by this resource (atlases, histories, etc.)
?

34

Dublin Core
?

Rights: the intellectual property rights adhering to this resource, or a pointer to them

35

You might also like