RDF, RSS and all that

63
Silterra, April 2004 RDF, RSS and all that THREADING THE RDF MAZE

description

RDF, RSS and all that. THREADING THE RDF MAZE. Outline of Discussion. What is RDF? How is RDF different from XML? Some simple RDF Descriptions. Some simple RDF Schemas. Some simple RDF tools to combine data. What is RDF. Resource Description Format Tool of the Semantic Web - PowerPoint PPT Presentation

Transcript of RDF, RSS and all that

Page 1: RDF, RSS  and all that

Silterra, April 2004

RDF, RSS and all that

THREADING THE

RDF MAZE

Page 2: RDF, RSS  and all that

Silterra, April 2004

Outline of Discussion

• What is RDF?

• How is RDF different from XML?

• Some simple RDF Descriptions.

• Some simple RDF Schemas.

• Some simple RDF tools to combine data.

Page 3: RDF, RSS  and all that

Silterra, April 2004

What is RDF

• Resource Description Format

• Tool of the Semantic Web

• History: First Recommended Model and Syntax – 1999.

• RDF Schema Specification 2000

Page 4: RDF, RSS  and all that

Silterra, April 2004

Recent Specifications

• Feb 10, 2004

• RDF/XML Syntax Specification

• RDF Vocabulary Description Language 1.0: RDF Schema

• RDF Primer

• Resource Description Framework (RDF): Concepts and Abstract Syntax

Page 5: RDF, RSS  and all that

Silterra, April 2004

Goals of RDF

• Web metadata– Content Rating, like PICS

• PICS, the Platform for Internet Content Selection [PICS96], [PICSSYS96] is a system for associating metadata (PICS "labels") with Internet content

• Categorize and classify – step up from simple term searching to concept searching.

• Descriptions of capabilities, like CC/PP

Page 6: RDF, RSS  and all that

Silterra, April 2004

RDF? XML?

• Goals of RDF seem like those of XML

• Share data between across the Web.

• Reuse data between applications.

• XML is a data format standard.

• The structure of an xml document can get in the way of analyzing the information.

• An xml document is a tree.

Page 7: RDF, RSS  and all that

Silterra, April 2004

RDF model

• RDF consists of assertions about Web resources.

• RDF models can be represented, and built on top of XML.

• RDF and XML are complementary.

Page 8: RDF, RSS  and all that

Silterra, April 2004

Key Concepts of RDF

• Expression of simple facts

• Graph data model

• URI-based vocabulary

• Datatypes

• Literals

• Different syntaxes for representing the assertions, though RDF/XML is one.

Page 9: RDF, RSS  and all that

Silterra, April 2004

RDF Assertions, Examples• The Author of ISBN 0152038655 is Carl Sandburg.• The Title of ISBN 0152038655 is Arithmetic.• The Author of the web page is Ora• The Subject of www.library.cornell.edu/mayantislavery

is “Slavery”.

• <rdf:Description rdf:about="uri:isbn:0152038655"

• mods:title="Arithmetic"• mods:creator="Sandburg,Carl" />

Page 10: RDF, RSS  and all that

Silterra, April 2004

RDF Assertions, Cont'd

• <rdf:Description rdf:about="http://example.com">

• <mods:creator> Ora</mods:creator>

• </rdf:Description>

Page 11: RDF, RSS  and all that

Silterra, April 2004

Underlying model

• Graph based so this is the representation that is always referred to.

Page 12: RDF, RSS  and all that

Silterra, April 2004

RDF representations

• RDF assertions, and models can be represented in different ways.

• 1 Way is N3.– This is a compact representation.– Simple to understand.– Easy to parse.– Not widely understood though.

Page 13: RDF, RSS  and all that

Silterra, April 2004

N3 Representation of RDF

• <http://www.library.cornell.edu/mayantislavery> <http://purl.org/dc/elements/1.1/subject> "Slavery" .

• <uri:isbn:0152038655> <http://mods.org/title> "Arithmetic" . <uri:isbn:0152038655> <http://mods.org/creator> "Sandburg,Carl" .

• <http://example.com/> <http://mods.org/creator> "Ora" .

Page 14: RDF, RSS  and all that

Silterra, April 2004

Simple MODS Document• <mods xmlns:xlink="http://www.w3.org/TR/xlink"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.loc.gov/mods/" xsi:schemaLocation=" http://www.loc.gov/mods http://www.loc.gov/standards/mods/mods.xsd">

<identifier type=”isbn”>0152038655</identifier>

<title>Arithmetic /</title>

<creator>Sandburg,Carl</creator>

</mods>

Page 15: RDF, RSS  and all that

Silterra, April 2004

RDF XML Representation

• <?xml version="1.0"?>• <rdf:RDF>• <rdf:Description

rdf:about="uri:isbn:0152038655">• <mods:title>Arithmetic</mods:title>• <mods:creator>Sandburg,Carl</mods:creator>• </rdf:Description></rdf:RDF>

Page 16: RDF, RSS  and all that

Silterra, April 2004

XML RDF representation

• The RDF Description Element.• Specifies the resource about which we are talking.• Can use the “about” attribute.• Could be unamed, in which case the subject will

be assigned a dummy name.• XML that are immediate children elements are

predicates, and their content is the object, or value of the predicate.

Page 17: RDF, RSS  and all that

Silterra, April 2004

XML RDF Representation

• This is a shorthand notation.

• Elements that are immediate children are predicates, like title, and creator in the example.

• There are other ways to represent this.

• If the value is only a simple string, you can use attributes on the Description Element.

Page 18: RDF, RSS  and all that

Silterra, April 2004

Alternate RDF XML Shorthand

• <rdf:Description rdf:about="uri:isbn:0152038655"

• mods:title="Arithmetic"

• mods:creator="Sandburg,Carl" />

Page 19: RDF, RSS  and all that

Silterra, April 2004

Types of Containers

• RDF has data types for Containers,• Bag: a group of resources or literals, possibly

including duplicate members, where there is no significance in the order of the members.

• Seq : represents a group, possibly including duplicate members, where the order of the members is significant.

• Alt: resources that are alternatives (typically for a single value of a property.

Page 20: RDF, RSS  and all that

Silterra, April 2004

RDF Bag Syntax

• rdf:Description …

• <dc:subject>• <rdf:Bag>• <rdf:li>library use studies</rdf:li>• <rdf:li>magazines and

newspapers</rdf:li>• </rdf:Bag>• </dc:subject>

Page 21: RDF, RSS  and all that

Silterra, April 2004

RDF Bags

Page 22: RDF, RSS  and all that

Silterra, April 2004

RDF Sequence - Example• <rdf:Seq>• <rdf:li rdf:resource="00001.TIF"/>• <rdf:li rdf:resource="00002.TIF"/>• </rdf:Seq>• …. </rdf:Description>• <rdf:Description rdf:about="00001.TIF"><page

seq="1" img="00001.TIF" ocr="00001.TXT" ftr="TPG" n="1"/></rdf:Description>

• <rdf:Description rdf:about="00002.TIF"><page seq="2" img="00002.TIF" ocr="00002.TXT" ftr="PRF" n="2"/></rdf:Description>

Page 23: RDF, RSS  and all that

Silterra, April 2004

RDF Values – Not only literals

• <rdf:Description rdf:about="uri:isbn:0152038655">

• <titleinfo>

• <rdf:Description>

• <dc:title>Arithmetic</dc:title>

• </rdf:Description>

• </titleinfo>

• <dc:creator>Sandburg,Carl</dc:creator>

• <dc:date>1993</dc:date>

• </rdf:Description>

Page 24: RDF, RSS  and all that

Silterra, April 2004

RDF node values.

Page 25: RDF, RSS  and all that

Silterra, April 2004

Another way to achieve Nodehood.

• <rdf:Description rdf:about="uri:isbn:0152038655"> <titleinfo rdf:parseType="Resource"> <dc:title>Arithmetic</dc:title>

• </titleinfo> <dc:creator>Sandburg,Carl</dc:creator> <dc:date>1993</dc:date> </rdf:Description>

Page 26: RDF, RSS  and all that

Silterra, April 2004

Further Examples of Nodehood.<rdf:Description rdf:about="uri:isbn:0152038655"> <titleinfo rdf:parseType="Resource"> <rdf:Alt rdf:parseType="Resource"> <rdf:li rdf:parseType="Resource"> <dc:title>Arithmetic</dc:title></rdf:li> <rdf:li rdf:parseType="Resource">

<dc:title>l'Arithmetique</dc:title></rdf:li> </rdf:Alt> </titleinfo> <dc:creator>Sandburg,Carl</dc:creator>

<dc:date>1993</dc:date> </rdf:Description>

Page 27: RDF, RSS  and all that

Silterra, April 2004

Further Examples of Nodehood,contd.

Page 28: RDF, RSS  and all that

Silterra, April 2004

RDF Sequence: Graph

Page 29: RDF, RSS  and all that

Silterra, April 2004

RDF Schema and XML Schemas

• The RDF Syntax so far does not have any rules for what vocabulary is acceptable.

• RDF schema is different from XML Schema.• XML Schema describe the structure of a

document.• RDF Schema describe classes of resources and

their properties, no matter how they may appear in a document.

Page 30: RDF, RSS  and all that

Silterra, April 2004

RDF Schemas

• Define Classes.

• Define Properties.

• Define relationship between Classes

• Define relationships between Properties.

• Define possible what a property can be applied to and what values it can take on.

Page 31: RDF, RSS  and all that

Silterra, April 2004

RDF Schema – Example Elements

• Rdfs:Class defines a kind of resource.• Rdf:Property defines that the resource being

talked about is a “property”• Notice in the attached dublin core RDF

Schema that only properties are defined, no classes. The only Rdf:Description only describes the dublin core vocabulary itself.

• Attached schemas for RSS and Dublin Core

Page 32: RDF, RSS  and all that

Silterra, April 2004

An Example Schema: Dublin Core

• The Dublin Core Vocabulary in RDF Schema.• Define for each Dublin property what RDF needs

to know about it.• All the Dublin Core terms are properties that can

be applied to any Resource.• <rdf:Property

rdf:about="http://purl.org/dc/elements/1.1/title">

Page 33: RDF, RSS  and all that

Silterra, April 2004

Dublin Core: - RDF Schema cont’d

• Each property is given an rdfs label, for using to display the property.

• Each property is given a comment, to describe it

• Each property is given a rsfs:isDefinedby “to indicate an RDF vocabulary in which a resource is described.”

Page 34: RDF, RSS  and all that

Silterra, April 2004

Another Example Schema: RSS

• What is RSS

• Rich Site Summary

• Encoded Description of web site using RDF

• Used for News, blogging.

• Here is an example file:

• http://encompass-test.library.cornell.edu:20068/may.rss

Page 35: RDF, RSS  and all that

Silterra, April 2004

RSS sample

• One Resource class is "channel"• Defined with rdfs:Class.• <rdfs:Class

rdf:about="http://purl.org/rss/1.0/channel" rdfs:label="Channel" rdfs:comment="An RSS information channel.">

• <rdfs:isDefinedBy rdf:resource="http://purl.org/rss/1.0/"/

• </rdfs:Class>

Page 36: RDF, RSS  and all that

Silterra, April 2004

RSS – RDF Schema Discussion

• Another resource is item, which defines a nugget of information, also defined with rdfs:Class.

• <rdfs:Class rdf:about="http://purl.org/rss/1.0/item" rdfs:label="Item" rdfs:comment="An RSS item.">

<rdfs:isDefinedBy rdf:resource="http://purl.org/rss/1.0/"/>

</rdfs:Class>

Page 37: RDF, RSS  and all that

Silterra, April 2004

RSS Validation

• http://www.redland.opensource.ac.uk/rss/ will validate your RSS and display it.

• UK sources of RSS “feeds” - http://rssxpress.ukoln.ac.uk/

• D-Lib Magazine – for instance. - http://dois.mimas.ac.uk/rss/dlib.xml

Page 38: RDF, RSS  and all that

Silterra, April 2004

RDF Query Languages

RDFDB query language(?--??)

RDF Inkling Squish

RDQL

Page 39: RDF, RSS  and all that

Silterra, April 2004

Querying An RDF database using RDFdb

• Each triple is a fact asserted into the database.

• One such data base demo is:

• http://www.redland.opensource.ac.uk/demo

• Query the whole database like this:

• ?--?-->?

Page 40: RDF, RSS  and all that

Silterra, April 2004

?--[http://purl.org/dc/elements/1.1/subject]-->"Abolitionism"

Page 41: RDF, RSS  and all that

Silterra, April 2004

Query and Result

Page 42: RDF, RSS  and all that

Silterra, April 2004

Inking/Squish Queries

• http://swordfish.rdfweb.org:8085/rdfquery/index.html

Page 43: RDF, RSS  and all that

Silterra, April 2004

Inkling/Squish – Sample Query

• SELECT ?about, ?title FROM http://encompass-test.library.cornell.edu:20068/may.rdf WHERE (dc::title ?about ?title) USING dc for http://purl.org/dc/elements/1.1/

Page 44: RDF, RSS  and all that

Silterra, April 2004

Inkling Squish Results

Page 45: RDF, RSS  and all that

Silterra, April 2004

Multi RDF database query.

Page 46: RDF, RSS  and all that

Silterra, April 2004

Squish Query with Qualifiers

Page 47: RDF, RSS  and all that

Silterra, April 2004

Using RDF with FRBR

• Danish Library Center 2002 – Visual Cat FRBR

• A module to handle FRBR as RDF has been implemented

• The FRBR display formats are based on Library of Congress suggestions.

• Interrelated FRBR RDF entities can be located, fetched and edited directly

Page 48: RDF, RSS  and all that

Silterra, April 2004

RDF Schema for FRBR

Page 49: RDF, RSS  and all that

Silterra, April 2004

RDQL – Query Language for RDF

• Similar to the RDF/Squish language.

• Similar to SQL –

• Variables in the SELECT clause

• WHERE describes a "path" in the graph.

• USING allows abbreviation of name spaces.

• FROM specifies a datasource(s)

Page 50: RDF, RSS  and all that

Silterra, April 2004

RDQL Inference

• RDFS – data

• <Teenager rdf:about="http://example.com/colin">

• <mum rdf:resource="http://example.com/rosy" />

• <age>13</age>

• </Teenager>

Page 51: RDF, RSS  and all that

Silterra, April 2004

RDQL Schema supporting Inference

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<rdf:Description rdf:about="http://example.com/mum"> <rdfs:subPropertyOf rdf:resource="http://example.com/parent"/> </rdf:Description> <rdf:Description rdf:about="http://example.com/parent"> <rdfs:range rdf:resource="http://example.com/Person"/> <rdfs:domain rdf:resource="http://example.com/Person"/> </rdf:Description></rdf:RDF>

Page 52: RDF, RSS  and all that

Silterra, April 2004

RDQL data explanation

• Colin is a teenager whose mum is rose,

• And whose age is 13.

• Being a mum is a subProperty of being a parent.

• Being a parent means x is parent of y, and both x and w are Persons,

Page 53: RDF, RSS  and all that

Silterra, April 2004

RDQL

• Example Query with sub property inferences:

• select ?x where

• ( ?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> http://example.com/Person> )

• Find all the Persons

Page 54: RDF, RSS  and all that

Silterra, April 2004

RDQL query results

• : java jena.rdfquery --vocab pschema.rdf --rdfs --data pdata.xml --query pquery2.txt

• ==========================• <http://example.com/colin>• http://example.com/rosy• Both colin and rosy are Persons, because being a mum,

means being a parent, and that means being a person.• Likewise having a mum means being a person, so the

Teenager is also a person.

Page 55: RDF, RSS  and all that

Silterra, April 2004

RDQL Data

• <rdf:RDF xmlns:mods=" http://www.loc.gov/mods/” xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#

• xmlns:dc="http://purl.org/dc/elements/1.1/">

• <rdf:Description rdf:about="uri:isbn:0152038655">

• <mods:title>Arithmetic</mods:title>

• <dc:creator>Sandburg,Carl</dc:creator>

• <dc:date>1993</dc:date>

• </rdf:Description>

• </rdf:RDF>

Page 56: RDF, RSS  and all that

Silterra, April 2004

RDQL – Schema

<rdf:Description rdf:about="http://www.loc.gov/mods/title">

<rdfs:subPropertyOf rdf:resource="http://purl.org/dc/elements/1.1/title" />

</rdf:Description>

Page 57: RDF, RSS  and all that

Silterra, April 2004

RDQL Query

• java jena.rdfquery --vocab moschema.rdf --rdfs --data http://encompass-test.library.cornell.edu:20068/sandburg.rdf --query moquery1.txt

• select ?x ?y ?date where• ( ?x <http://purl.org/dc/elements/1.1/title> ?y )• ( ?x <http://purl.org/dc/elements/1.1/date> ?date)

Page 58: RDF, RSS  and all that

Silterra, April 2004

Results of RDQL – with inference query

• : java jena.rdfquery --vocab moschema.rdf --rdfs --data http://encompass-test.li

• brary.cornell.edu:20068/sandburg.rdf --query moquery3.txt

• ---------------------------------------results -------• <uri:isbn:0152038655> | "Arithmetic" | "1993"• SELECT ?x ?y ?da WHERE ( ?x <dc:title> ?y )• ( ?x <dc:date> ?da )• AND ?da > 1847• USING dc FOR <http://purl.org/dc/elements/1.1/>

Page 59: RDF, RSS  and all that

Silterra, April 2004

RDQL – inf cont'd

• <uri:isbn:0152038655> | "Arithmetic" | "1993"• : type moquery3.txt• SELECT ?x ?y ?da WHERE ( ?x <dc:title> ?y )• ( ?x <dc:date> ?da )• AND ?da > 1847• USING dc FOR <http://purl.org/dc/elements/1.1/>

Page 60: RDF, RSS  and all that

Silterra, April 2004

RDFS A Part of Interoperability

• Some of the mechanisms of RDFS can be used to help with interoperability.

• Performance

• Adequacy of RDFS by itself, or even in combination with other tools.

Page 61: RDF, RSS  and all that

Silterra, April 2004

Interoperability – Just some samples

• Combining RDF and XML Schemas to Enhance Interoperability Between Metadata, Hunter and Lagoze 2000

• Advocate using both XML Schemas and RDF Schemas, the one for encoding structural information about documents, data type constraints, content models – the other for class hierarchy, semantic modeling

• A Metadata Registry for the Semantic Web Heery and Wagner DLIB Magazine 2002 –

• Describe using RDF Schemas to describe and navigate the DCM Registry

Page 62: RDF, RSS  and all that

Silterra, April 2004

Interoperability Cont'd• The OCLC metaswitch project• http://www.oclc.org/research/projects/mswitch/ • Godby, Smith, and Childress.

http://www.oclc.org/research/projects/mswitch/godby-dc2003.pdf

• The long path: translation to a common core and use of Xlink and Xpointer to document translations. "We believe that the interoperable core could be … RDF, but our experience has led us to conclude that RDF representations introduce .. processing bottlenecks, .. also reported by Heery and Wagner ...

Page 63: RDF, RSS  and all that

Silterra, April 2004

Where we are