SEMANTIC WEB TECHNOLOGIES

Instructor Lecture Date : Amna Basharat Haider : 9&10 : 10th February, 2009

RDF SCHEMA

FAST-NU, Islamabad

Fall 2008 - Lecture 1

Instructor: Amna Basharat Haider

Semantic Web Technologies

Basic Ideas of RDF Schema
• RDF is a universal language that lets users describe resources in their own vocabularies
▫ RDF does not assume, nor does it define semantics of any particular application domain yp pp Classes and Properties Class Hierarchies and Inheritance Property Hierarchies

The user can do so in RDF Schema using:
▫ ▫ ▫

Semantic Web Technologies

What is RDFS ?
• RDF Schema
▫ Defines vocabulary for RDF ▫ Organizes this vocabulary in a typed hierarchy (Class, subClassOf, type, Property, subPropertyOf)

• Rich, web-based publication format for declaring semantics (XML for exchange) • Capability to explicitly declare semantic relations between vocabulary terms

Semantic Web Technologies

RDF Schema Vocabulary
• Vocabulary can be used to define other vocabularies for your application domain
Person subClassOf Student type Frank S
domain

subClassOf
range

S

Researcher type Jeen

Semantic Web Technologies

RDF Schema
• • • • • Semantic network on the Web Nodes are identified by URIs y rdfs:Class rdfs:Property rdfs:subClassOf

Semantic Web Technologies

RDF Schema syntax in XML
<rdf:Description ID="MotorVehicle"> <rdf:type resource="http://www.w3.org/...#Class"/> yp p g <rdfs:subClassOf rdf:resource="http://www.w3.org/...#Resource"/> </rdf:Description> <rdf:Description ID="Truck"> <rdf:type resource="http://www.w3.org/...#Class"/> df t "htt // 3 / #Cl "/ <rdfs:subClassOf rdf:resource="#MotorVehicle"/> </rdf:Description> <rdf:Description ID="registeredTo"> ID= registeredTo > <rdf:type resource="http://www.w3.org/...#Property"/> <rdfs:domain rdf:resource="#MotorVehicle"/> <rdfs:range rdf:resource="#Person"/> </rdf:Description> <rdf:Description ID=”ownedBy"> <rdf:type resource="http://www.w3.org/...#Property"/> p y g <rdfs:subPropertyOf rdf:resource="#registeredTo"/> </rdf:Description>

Semantic Web Technologies

Classes and their Instances
• We must distinguish between
▫ ▫ Concrete “things” (individual objects) in the domain: Discrete Maths, David Billington etc. Sets of individuals sharing properties called classes: lecturers, students, courses etc.

Individual objects that belong to a class are referred to as instances of that class The relationship between instances and p classes in RDF is through rdf:type

Semantic Web Technologies

Why Classes are Useful?
• Impose restrictions on what can be stated in an RDF document using the schema
▫ ▫ ▫ As in programming languages E.g. A+1 E g A+1, where A is an array Disallow nonsense from being stated

Semantic Web Technologies

Nonsensical Statements disallowed through the Use of Classes Cl • Discrete Maths is taught by Concrete Maths
▫ ▫ We want courses to be taught by lecturers only p p y g Restriction on values of the property “is taught by” (range restriction)

Room MZH5760 i t R is taught b D id ht by David Billington
▫ ▫ Only courses can be taught This imposes a restriction on the objects to which the property can be applied (domain restriction)

Semantic Web Technologies

Class Hierarchies
• Classes can be organised in hierarchies
▫ ▫ A is a subclass of B if every instance of A is also an instance of B Then B is a superclass of A

• •

A subclass graph need not be a tree A class may have multiple superclasses

Semantic Web Technologies

Class Hierarchy Example

Semantic Web Technologies

Inheritance in Class Hierarchies
• • • • Range restriction: Courses must be taught by academic staff members only Michael Maher is a professor He inherits the ability to teach from the class of academic staff members This is done in RDF Schema by fixing the semantics of “is a subclass of”
▫ It is not up to an application (RDF processing software) to interpret “is a subclass of

Properties are not encapsulated but defined globally

Semantic Web Technologies

Property Hierarchies
• Hierarchical relationships for properties
▫ ▫ E.g., “is t E “i taught b ” i a subproperty of ht by” is b t f “involves” If a course C is taught by an academic staff member A, then C also involves Α

The converse is not necessarily true
▫ ▫ E.g., A may be the teacher of the course C, or a tutor who marks student homework but does not teach C

P is a subproperty of Q, if Q(x,y) is true p p y , ( ,y) whenever P(x,y) is true

Semantic Web Technologies

RDF Layer vs RDF Schema Layer
• Discrete Mathematics is taught by David Billington The schema is itself written in a formal language, RDF Schema, that can express g g , , p its ingredients:
▫ subClassOf, Class, Property, subPropertyOf, Resource, etc.

Semantic Web Technologies

RDF Layer vs RDF Schema Layer (2)

ΤHE LANGUAGE OF RDF SCHEMA

Semantic Web Technologies

RDF Schema in RDF
• The modeling primitives of RDF Schema are defined using resources and properties (RDF itself is used!) To declare that “lecturer” is a subclass of “academic staff member”
▫ ▫ ▫ Define D fi resources lecturer, l t academicStaffMember, and subClassOf define property subClassOf Write triple (subClassOf,lecturer,academicStaffMember)

We use the XML-based syntax of RDF

Semantic Web Technologies

Core Classes
• • • • • rdfs:Resource, rdfs:Resource the class of all resources rdfs:Class, the class of all classes rdfs:Literal, the class of all literals (strings) rdf:Property, the class of all properties rdf:Statement, th class of all reified df St t t the l f ll ifi d statements

Semantic Web Technologies

Core Properties
• rdf:type, which relates a resource to its class
▫ The resource is declared to be an instance of that class

rdfs:subClassOf, which relates a class to , one of its superclasses
▫ All instances of a class are instances of its superclass

rdfs:subPropertyOf, relates a property to one of i superproperties f its i

Semantic Web Technologies

Core Properties (2)
• rdfs:domain, which specifies the domain of a property P f t
▫ ▫ The class of those resources that may appear as subjects in a triple with predicate P If the domain is not specified, then any resource can be the subject

rdfs:range, which specifies the range of a property P
▫ The l Th class of those resources that may appear f h h as values in a triple with predicate P

Semantic Web Technologies

Examples
<rdfs:Class rdf:about="#lecturer"> <rdfs:subClassOf rdf:resource="#staffMember"/> </rdfs:Class> <rdf:Property rdf:ID="phone"> <rdfs:domain rdf:resource="#staffMember"/> rdf:resource= #staffMember /> <rdfs:range rdf:resource="http://www.w3.org/ 2000/01/rdf-schema#Literal"/> </rdf:Property>

Semantic Web Technologies

Subclass Hierarchy of some Modelling primitives of RDFS y gp

FAST-NU, Islamabad

Fall 2008 - Lecture 1

Instructor: Amna Basharat Haider

Semantic Web Technologies

Instance Relationships of some Modelling p p g primitives of RDFS

FAST-NU, Islamabad

Fall 2008 - Lecture 1

Instructor: Amna Basharat Haider

Semantic Web Technologies

Relationships Between Core Classes and Properties p p • rdfs:subClassOf and rdfs:subPropertyOf are transitive, transitive by definition • rdfs:Class is a subclass of rdfs:Resource
▫ Because every class is a resource

• rdfs:Resource is an instance of rdfs:Class
▫ rdfs:Resource is the class of all resources, so it is a class

• Every class is an instance of rdfs:Class
▫ For the same reason

Semantic Web Technologies

Reification and Containers
• • • • • • • rdf:subject, relates a reified statement to its subject rdf:predicate, relates a reified statement to its predicate rdf:object, rdf:object relates a reified statement to its object rdf:Bag, the class of bags rdf:Seq, the class of sequences , rdf:Alt, the class of alternatives rdfs:Container, which is a superclass of all container classes, including the three above

Semantic Web Technologies

Utility Properties
• • rdfs:seeAlso relates a resource to another resource that explains it p rdfs:isDefinedBy is a subproperty of rdfs:seeAlso and relates a resource to the place where its definition, typically an RDF schema, is found rfds:comment. Comments rfds:comment Comments, typically longer text can text, be associated with a resource rdfs:label. A h df l b l human-friendly label (name) is f i dl l b l ( )i associated with a resource

• •

SUMMARY

FAST-NU, Islamabad

Fall 2008 - Lecture 1

Instructor: Amna Basharat Haider

Semantic Web Technologies

RDF Classes
Class name rdfs:Resource rdfs:Literal rdf:XMLLiteral rdfs:Class rdf:Property rdfs:Datatype rdf:Statement rdf:Bag rdf:Seq rdf:Alt rdfs:Container comment The class resource, everything. The class of literal values, e.g. textual strings and integers. The class of XML literals values. The class of classes. The class of RDF properties. The class of RDF datatypes. The class of RDF statements. The class of unordered containers. The class of ordered containers. The class of containers of alternatives alternatives. The class of RDF containers.

rdfs:ContainerMembershipProper The class of container membership properties, rdf:_1, rdf:_2, ..., all of ty which are sub-properties of 'member'. rdf:List The class of RDF Lists.

FAST-NU, Islamabad

Fall 2008 - Lecture 1

Instructor: Amna Basharat Haider

Semantic Web Technologies

RDF Properties (1)
Property name rdf:type rdfs:subClassOf rdfs:subPropertyOf rdfs:domain rdfs:range rdfs:label rdfs:comment comment The subject is an instance of a class. The subject is a subclass of a class. f l The subject is a subproperty of a property. A domain of the subject property. property A range of the subject property. A human-readable name for the subject. A description of the subject resource. domain rdfs:Resource rdfs:Class rdf:Property rdf:Property rdf:Property rdfs:Resource rdfs:Resource range rdfs:Class rdfs:Class rdf:Property rdfs:Class rdfs:Class rdfs:Literal rdfs:Literal

FAST-NU, Islamabad

Fall 2008 - Lecture 1

Instructor: Amna Basharat Haider

Semantic Web Technologies

RDF Properties (2)
Property name rdfs:member rdf:first rdf:rest rdfs:seeAlso rdfs:isDefinedBy comment A member of the subject resource. The first item in the subject RDF list. The rest of the subject RDF list after the first item. Further information about the subject resource. The definition of the subject resource. Idiomatic property used for structured values (see the RDF Primer for an example of its usage). The subject of the subject RDF statement. The predicate of the subject RDF statement. bj t t t t The object of the subject RDF statement. domain rdfs:Resource rdf:List rdf:List rdfs:Resource rdfs:Resource range rdfs:Resource rdfs:Resource rdf:List rdfs:Resource rdfs:Resource

rdf:value

rdfs:Resource

rdfs:Resource

rdf:subject rdf:predicate rdf:object FAST-NU, Islamabad

rdf:Statement rdf:Statement rdf:Statement

rdfs:Resource rdfs:Resource rdfs:Resource Instructor: Amna Basharat Haider

Fall 2008 - Lecture 1

EXAMPLE : UNIVERSITY

FAST-NU, Islamabad

Fall 2008 - Lecture 1

Instructor: Amna Basharat Haider

Semantic Web Technologies

Example: A University
<rdfs:Class rdf:ID="lecturer"> <rdfs:comment> rdfs:comment The class of lecturers. All lecturers are academic staff members. </rdfs:comment> <rdfs:subClassOf rdf:resource="#academicStaffMember"/> </rdfs:Class> / df Cl

Semantic Web Technologies

Example: A University (2)
<rdfs:Class rdf:ID="course"> <rdfs:comment>The class of courses</rdfs:comment> </rdfs:Class> <rdf:Property rdf:ID="isTaughtBy"> <rdfs:comment> df Inherits its domain ("course") and range ("lecturer") from its superproperty "involves" </rdfs:comment> <rdfs:subPropertyOf rdf:resource="#involves"/> </rdf:Property>

Semantic Web Technologies

Example: A University (3)
<rdf:Property rdf:ID="phone"> <rdfs:comment> It is a property of staff members and takes literals as values. </rdfs:comment> <rdfs:domain rdf:resource="#staffMember"/> <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdfschema#Literal"/> </rdf:Property>

RDF SCHEMA
Class Hierarchy Example!

FAST-NU, Islamabad

Fall 2008 - Lecture 1

Instructor: Amna Basharat Haider

Semantic Web Technologies

Class Hierarchy for the Motor Vehicles Example y p •

Semantic Web Technologies

Class Hierarchy of the RDFS
Class hierarchy is shown using a "nodes and arcs" graph representation of the RDF data model. If one class is a subset of l i b t f another, then there is an rdfs:subClassOf arc from the node representing the p g first class to the node representing the second.

If a resource is an instance of a class, then there is an rdf:type arc f from th resource t th node representing th class. the to the d ti the l

Semantic Web Technologies

Example (1)

Example expresses the following class hierarchy. We first define a class MotorVehicle. We then define three subclasses of MotorVehicle, namely PassengerVehicle, PassengerVehicle Truck and Van We then define a class Minivan which is a Van. subclass of both Van and PassengerVehicle.

Semantic Web Technologies

Example (2)

<rdf:RDF xml:lang="en" xmlns:rdf= http://www.w3.org/1999/02/22-rdf-syntax-ns# xmlns:rdf="http://www w3 org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> <!-- Note: this RDF schema would typically be used in RDF instance data by referencing it with an XML namespace declaration, for example xmlns:xyz="http://www.w3.org/2000/03/example/vehicles#". This allows us to use abbreviations such as xyz:MotorVehicle to refer unambiguously to the RDF class 'MotorVehicle'. --> <rdf:Description ID="MotorVehicle"> <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> ...

Semantic Web Technologies

Example (3)

<rdf:Description ID="PassengerVehicle"> <rdf:type resource="http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource="#MotorVehicle"/> < df bCl Of df "#M t V hi l "/> </rdf:Description> <rdf:Description ID="Truck"> p <rdf:type resource="http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource="#MotorVehicle"/> </rdf:Description>
...

Semantic Web Technologies

Example (4)

<rdf:Description ID="Van"> <rdf:type resource="http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource="#MotorVehicle"/> </rdf:Description> <rdf:Description ID="MiniVan"> <rdf:type resource="http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource="#Van"/> <rdfs:subClassOf rdf:resource="#PassengerVehicle"/> </rdf:Description> </rdf:RDF>

DUBLIN CORE

Semantic Web Technologies

Dublin Core
• A set of fifteen basic properties for describing generalised Web resources • ISO Standard 15836-2003 (February 2003): http://www.niso.org/international/SC4/n515. http://www niso org/international/SC4/n515 pdf
The Dublin Core Metadata Initiative is an open forum engaged in the development of interoperable online metadata standards that support a broad range of purposes and business models.

http://dublincore.org/

Semantic Web Technologies

Dublin Core (15 basic properties):
• • • • • • • Title Creator Subject Description Publisher Contributor Date • • • • • • • • Type Format Identifier Source Language Relation Coverage C Rights

Semantic Web Technologies

Dublin Core Example
<?xml version="1.0"?> <rdf:RDF xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns:dc="http://purl.org/dc/elements/1.0/"> xmlns:dc="http://purl org/dc/elements/1 0/"> <rdf:Description rdf:about="http://www.ukoln.ac.uk/metadata/resources/dc/ datamodel/WD-dc-rdf/"> <dc:title> Guidance on expressing the Dublin Core within the Resource Description Framework (RDF) </dc:title> D i i F k /d i l <dc:creator> Eric Miller </dc:creator> <dc:creator> Paul Miller </dc:creator> <dc:creator> Dan Brickley </dc:creator> <dc:subject> Dublin Core; Resource Description Framework; RDF; eXtensible Markup Language; XML </dc:subject> <dc:publisher> Dublin Core Metadata Initiative </dc:publisher> <dc:contributor> Dublin Core Data Model Working Group </dc:contributor> <dc:date> 1999-07-01 </dc:date> <dc:format> text/html </dc:format> <dc:language> en </dc:language> </rdf:Description> </rdf:RDF>

Semantic Web Technologies

Where to look next?
• RDF: http://www.w3.org/RDF/ • RDF Schema: http://www.w3.org/TR/rdf-schema/

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer: Get 4 months of Scribd and The New York Times for just $1.87 per week!

Master Your Semester with a Special Offer from Scribd & The New York Times