39
RDF & RDF Schema chine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

Embed Size (px)

Citation preview

Page 1: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

RDF & RDF SchemaMachine Understandable Metadata for the Web

Semantic Web - Spring 2006

Computer Engineering Department

Sharif University of Technology

Page 2: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

2

Outline

• Metadata

• RDF

• RDFS

• RDF(S) Tools

Page 3: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

3

Semantic Web: Problems

• Too much Web information– around 1,000,000,000 (1109) resources– Many different types of resources

• text, images, graphics,

• audio, video, multimedia,

• databases, Web applications, …

Page 4: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

4

Semantic Web: Problems (2)

• Information not indexable– No common “scheme” for doing so– Short-lived, dynamic resources– Differing relationships between authors, publishers, info

intermediaries, users• Each community uses their own approach

Page 5: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

5

Semantic Web: Problems (3)

• Information not shareable– Difficult to share information– Difficult to share information about information

• no common cataloging schemes

Page 6: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

6

Main Issues:

• Metadata – Information about information– Structured data about data

• Many types/forms of metadata, dependent on role:

Page 7: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

7

Types of Metadata:

Web Resource discovery

Content ratings (PICS)

Product &ServicesDescriptions

Document management administration

Security & Userauthentication

(Intellectual)property rightsmanagement

Database / data schemas

Archivalinformation /status

Process description &control

Page 8: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

8

Second Issue:

• Language for expressing metadata must be:– universal (so all can understand)– flexible (to incorporate different types) – extensible (flexible to custom types)– simple (to encourage adoption)– modular (so that schemes can be mixed, extended)

Page 9: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

9

RDF

• RDF stands for Resource Description Framework

• It is a machine understandable metadata

• RDF is graphical formalism ( + XML syntax + semantics)– for representing metadata– for describing the semantics of information in a

machine- accessible way

Page 10: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

10

RDF (cont.)

• RDF is an assertional language intended to be used to express propositions using precise formal vocabularies.

• It is intended to provide a basic foundation for more advanced assertional languages with a similar purpose

• The overall design goals emphasise generality and precision in expressing propositions about any topic, rather than conformity to any particular processing model

Page 11: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

11

RDF in SW Architecture

Page 12: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

12

RDF Model

• A model is a collection of statements• Statement := (predicate,subject,object)• Predicate is a resource• Subject is a resource• Object is either a resource or a literal

Subject Object

Predicate

Statement

Page 13: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

13

Example (generated by RDFPic)

Page 14: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

14

Example shown in triples view

Page 15: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

15

RDF model and natural language

• Subject. In grammar, this is the noun or noun phrase that is the doer of the action. In the sentence “The company sells batteries,” the subject is “the company.”

• Predicate. In grammar, this is the part of a sentence that modifies the subject and includes the verb phrase. In our sentence, the predicate is the phrase “sells”

• Object. In grammar this is a noun that is acted upon by the verb. In our sentence, the object is the noun “batteries.”

Page 16: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

16

XML vs. RDF

• RDF is not just an XML dialect.– XML:

• Has a tree structure data model.

• Only nodes are labeled.

– RDF:• Has a graph structure data model.

• Both edges (properties) and nodes (subjects/objects) are labeled.

Page 17: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

17

Linking Statements

• The subject of one statement can be the object of another

• Such collections of statements form a directed, labeled graph

Ganji CEstudentOF

Sharif http://ce.sharif.edu

departmentOF hasHomePage

Page 18: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

18

RDF Graph: ‘anonymous’ nodes

Person12345

Jonathan

Borden

person.name

first

last

value

value

PersonName LiteralPerson

Page 19: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

19

Using XPointer to name

Person12345

/1/1/1/1/1

/1/1/2

Jonathan

Borden

person.name

first

last

value

value

PersonName LiteralPerson

Page 20: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

20

How can RDF be implemented

• Usually RDF/XML syntax• However other notations are possible

– e.g. Notation3:• Buddy Belden owns a business.• The business has a Web site accessible at

http://www.c2i2.com/~budstv.• Buddy is the father of Lynne.

• <#Buddy> <#owns> <#business>.• <#business> <#has-website>

<http://www.c2i2.com/~budstv>.• <#Buddy> <#father-of> <#Lynne>.

Page 21: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

21

Converting N3 to RDF

• Jena toolkit can do such conversion

Page 22: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

22

XML Syntax for RDF

• RDF has an XML syntax that has a specific meaning:• Every Description element describes a resource• Every attribute or nested element inside a Description is a

property of that Resource• We can refer to resources by using URIs

<rdf:Description about="some.uri/person/ganji"> <studentOf resource="some.uri/Sharif/CE"/></Description><Description about="some.uri/Sharif/CE"> <hasHomePage>http://ce.sharif.edu</hasHomePage>

<departmentOf resource="some.uri/~Sharif"/></rdf:Description>

Page 23: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

23

RDF type

• RDF predifined property• Its value – a resource that represent a category or class• Its subject – Instance of that category or class

prefix ex: URI: http://www.example.org/terms

Page 24: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

24

Containers

• Containers are collections– they allow grouping of resources (or literal values)

• It is possible to make statements about the container (as a whole) or about its members individually

• It is also possible to create collections based on URI patterns– for example, all files in a particular web site

Page 25: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

25

RDF containers

• Bag: (A resource having type rdf:Bag)

– Represents an unordered list of resources or literals

– Duplicated values are prermitted• Sequence: (A resource having type rdf:Seq)

– Represents ordered list of resources or literal– Duplicated values are permitted

• Alternatives: (A resource having type rdf:Alt)– Represents group of resources or literals that are

alternatives

Page 26: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

26

Sequence example

http://www.w3.org/TR/REC-rdf-syntax

“Ora Lassila”

rdf:_1

rdf:Seq

dc:Creator

rdf:Type

“Ralph Swick”

rdf:_2

Page 27: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

27

Bag example

Page 28: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

28

RDF reification

• association of a statement and a specific resource representing the statement

• used to make statements about statements• Vocabulary:

• type rdf:asserts

• properties• rdf:subject

• rdf:predicate

• rdf:object

Page 29: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

29

Reification example

• In N3:

Page 30: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

30

Reification example (cont.)

• In RDF:

Page 31: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

31

Reification example (cont.)

• RDF Graph (by IsaViz):

Page 32: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

32

RDF Schema (RDFS)

• RDF gives a formalism for meta data annotation, and a way to write it down in XML, but it does not give any special meaning to vocabulary such as subClassOf or type– Interpretation is an arbitrary binary relation

• RDF Schema allows you to define vocabulary terms and the relations between those terms– it gives “extra meaning” to particular RDF predicates and

resources

– this “extra meaning”, or semantics, specifies how a term should be interpreted

Page 33: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

33

Core Classes & Properties

Core Classes

Core Properties

rdfs:Resource

rdfs:Literal

rdfs:XMLLiteral

rdfs:Class

rdfs:Property

rdfs:Type

rdfs:SubClassOf

rdfs:SubPropertyOf

rdfs:Domain

rdfs:Range

rdfs:Label

rdfs:Comment

Page 34: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

34

RDFS Examples

<Person,type,Class><hasColleague,type,Property><Professor,subClassOf,Person><Carole,type,Professor><hasColleague,range,Person><hasColleague,domain,Person>

Page 35: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

35

RDF/RDFS “Liberality”

• No distinction between classes and instances (individuals)<Species,type,Class><Lion,type,Species><Leo,type,Lion>

• Properties can themselves have properties<hasDaughter,subPropertyOf,hasChild><hasDaughter,type,familyProperty>

• No distinction between language constructors and ontology vocabulary, so constructors can be applied to themselves/each other<type,range,Class><Property,type,Class><type,subPropertyOf,subClassOf>

Page 36: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

36

Problems with RDFS

• RDFS too weak to describe resources in sufficient detail– No localised range and domain constraints

• Can’t say that the range of hasChild is person when applied to persons and elephant when applied to elephants

– No existence/cardinality constraints• Can’t say that all instances of person have a mother that is also

a person, or that persons have exactly 2 parents– No transitive, inverse or symmetrical properties

• Can’t say that isPartOf is a transitive property, that hasPart is the inverse of isPartOf or that touches is symmetrical

– …

• Difficult to provide reasoning support– No “native” reasoners for non-standard semantics– May be possible to reason via FO axiomatisation

Page 37: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

37

RDF(S) tools

• Read RDF data – Parsers: Jena, Redland, SWI-Prolog– Validators: W3C RDF validation service– Editors: IsaViz, RDF Author, RDFEd, InferEd

• Store RDF data (XML format, tripples or relational/oo DB)– Sesame, RSSDB, RDFLib

• Use RDF data (applications, RSS news, etc.)• Manipulate RDF data (inference, query, etc.)

– Jena RDQL, etc.– Example:

SELECT ?person, ?knowsWHERE (?x <http://xmlns.com/foap/knows> ?z),(?x <http://xmlns.com/foap/name> ?person), (?z <http://xmlns.com/foap/name> ?knows)

Page 38: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

38

RDF Validators

• RDF Validation Service– http://www.w3.org/RDF/Validator/

• In general all the RDF parsers do some kind of validation

Page 39: RDF & RDF Schema Machine Understandable Metadata for the Web Semantic Web - Spring 2006 Computer Engineering Department Sharif University of Technology

39

References

• RDF Resource Guide:– http://www.ilrt.bris.ac.uk/discovery/rdf/resources/

• http://www.w3.org/RDF

• http://www.w3.org/RDF/Validator/

• Chapter 5 of the book