469 talk

29
RDF/XML A brief introduction Alison Hunt March 26, 2011 for LIS469 XML

Upload: alisonnoel

Post on 15-Jun-2015

437 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 469 talk

RDF/XMLA brief introduction

Alison Hunt March 26, 2011for LIS469 XML

Page 2: 469 talk

RDF/XML is a data format

It represents information for a data model

called RDF

Page 3: 469 talk

RDFResource Description Framework

is a data model

It structures metadata

for

the Semantic Web and

the RDA content standard(resource description and access)

Page 4: 469 talk

RDFdescribes a resource

LIS469 Class Blog

Page 5: 469 talk

A resource has properties

LIS469 Class Blog

creator

language

format

subject

Page 6: 469 talk

Properties have valuesAaron

Rubinstein

English

Text/HTML

XML

LIS469 Class Blog

creator

language

format

subject

Page 7: 469 talk

RDFdescriptions make

statements

The LIS469 class blog was created by Aaron Rubinstein.

The LIS469 class blog is written in English.

The LIS469 class blog is formatted as text/HTML.

The LIS469 class blog is about the subject of XML.

Page 8: 469 talk

RDFstatements are triples

ResourceSubject

LIS469 class blog

LIS469 class blog

LIS469 class blog

LIS469 class

blog

PropertyPredicate

Creator

Language

Format

Subject

ValueObject

Aaron Rubinstein

English

Text/HTML

XML

Page 9: 469 talk

RDF statements link two things in one direction.

Node

LIS469 class blog

LIS469 class blog

LIS469 class blog

LIS469 class blog

Arc

Creator

Language

Format

Subject

Node

Aaron Rubinstein

English

Text/HTML

XML

Page 10: 469 talk

RDF statements link two things in one direction.

Properties may have multiple values.

RDF has several ways to model this:

blank nodes, bags, collections, etc.

However, the end result will be a set of triples

which link the subject with each value.

Page 11: 469 talk

ResourceMust be a URI

<http://lis469.wordpress.com/>

<http://lis469.wordpress.com/>

<http://lis469.wordpress.com/>

<http://lis469.wordpress.com/>

RDF statements require URIs that have meaning

for computer applications

Here, the blog URL replaces its name

Page 12: 469 talk

RDF ShinesBy using URIs,

RDF can describe things that cannot be located or retrieved on the

web.

People, institutions, cars, concepts…anything.

FRBR works, expressions or manifestations

Tiger Lily collective amnesia

Page 13: 469 talk

RDF statements require URIs for properties

ResourceMust be a URI

<http://lis469.wordpress.com/>

<http://lis469.wordpress.com/>

<http://lis469.wordpress.com/>

<http://lis469.wordpress.com/>

PropertyMust be a URI

<http://purl.org/dc/elements/1.1/creator>

<http://purl.org/dc/elements/1.1/language>

<http://purl.org/dc/elements/1.1/format>

<http://purl.org/dc/elements/1.1/subject>

Here, Dublin Core URIs are used for the property

Page 14: 469 talk

Values can be URIs or literal strings of characters

ResourceMust be a URI

<http://lis469.wordpress.com/>

<http://lis469.wordpress.com/>

<http://lis469.wordpress.com/>

<http://lis469.wordpress.com/>

PropertyMust be a URI

<http://purl.org/dc/elements/1.1/creator>

<http://purl.org/dc/elements/1.1/language>

<http://purl.org/dc/elements/1.1/format>

<http://purl.org/dc/elements/1.1/subject>

ValueCan be URI or literal

Aaron Rubinstein

English

Text/html

<http://id.loc.gov/authorities/sh97007825#concept>

Here, XML is identified by a URI

from Library of Congress Subject Headings

Page 15: 469 talk

RDF graph with URIs

AaronRubinstein

English

<http://id.loc.gov/

authorities/

sh97007825#concept>

Text/HTM

L

<http://lis469.wordpress.com/>

<http://purl.org/dc/elements/1.1/creator>

<http://purl.org/dc/elements/1.1/language>

<http://purl.org/dc/elements/1.1/format>

<http://purl.org/dc/elements/1.1/subject>

Note:RDF graphs showliterals in a boxURIs in an oval

We are using a URI as the value of the subject property.

So the graph changes from box to oval.

This actually indicates a really significant change…

Page 16: 469 talk

A value with a URI can be the subject of other statements

<http://id.loc.gov/

authorities/

sh97007825#concept>

<http://purl.org/dc/elements/1.1/creator>

<http://purl.org/dc/elements/1.1/language>

<http://purl.org/dc/elements/1.1/format>

<http://purl.org/dc/elements/1.1/subject>

<http://purl.org/dc/elements/1.1/creator>

Library ofCongress

Page 17: 469 talk

LCSH

Subject Heading for

XML

RDF links stuff!

Page 18: 469 talk

RDF shinesIt is easy

to work across different data sources, types and formats.

RDF can link things by tapping massive databases of RDF

statements called "triplestores."

There are more than 27 billion triples stored now.

Page 19: 469 talk

RDF/XML is a data format

XML document serializes the RDF graph so it can beprocessed by computersfor storage and transmission

001111000010100010000100010010001111000000000011110000000111111111100000000000111111111110000000000011

Page 20: 469 talk

RDF expressed as XMLRDF XML

Class BlogCreator

Aaron Rubinstein

LanguageEnglish

FormatText-HTML

SubjectXML URI

The XML format is closed; it will not link like the RDF graph does.

Page 21: 469 talk

Starting the RDF/XML fileRDF

RDF is the root elementThe rdf: prefix is from the rdf namespace

We are also using Dublin Core elements

XML<?xml version="1.0"?>

<rdf:RDFxmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#xmlns:dc=http://purl.org/dc/elements/1.1/>

Page 22: 469 talk

Where is the resource named?RDF

Each resource being described is tagged with the RDF element <description>

The about attribute spells out the URIOf the resource that is the subject of the RDF statement

XML

<?xml version="1.0"?>

<rdf:RDFxmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#xmlns:dc=http://purl.org/dc/elements/1.1/>

<rdf:Description

Rdf:about="http://lis469.wordpress.com/">

Page 23: 469 talk

Properties and values?RDF

Properties become child elements of Description.They appear as tags.

Literal RDF values become the value of those child elements, between opening and closing tags.

When RDF values are expressed as URIs, they become an attribute, called "resource," of the child element.

XML

<?xml version="1.0"?>

<rdf:RDFxmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#xmlns:dc=http://purl.org/dc/elements/1.1/>

<rdf:DescriptionRdf:about="http://lis469.wordpress.com/">

<dc:creator>Aaron Rubinstein</dc:creator>

<dc:language>English</dc:language>

<dc:format>text/HTML</dc:format>

<dc:subject rdf:resource=" http://id.loc.gov/authorities/sh97007825#concept "/>

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

Page 24: 469 talk

But properties should be URIs!

Namespace declarations generate full URIs for each property

dc: is equivalent to http://purl.org/dc/elements/1.1/

<dc:format>text/HTML</dc:format>

is processed as

< http://purl.org/dc/elements/1.1/ format> text/HTML </ <http://purl.org/dc/elements/1.1/ format>

Page 25: 469 talk

RDF expressed as XMLRDF XML

<?xml version="1.0"?>

<rdf:RDFxmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#xmlns:dc=http://purl.org/dc/elements/1.1/>

<rdf:DescriptionRdf:about="http://lis469.wordpress.com/">

<dc:creator>Aaron Rubinstein</dc:creator><dc:language>English</dc:language><dc:format>text/HTML</dc:format><dc:subject rdf:resource=" http://id.loc.gov/authorities/sh97007825#concept "/>

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

Page 26: 469 talk

RDF/XML is not the only choice

PROS

RDF/XML is the syntax primarily used by the W3C from the start

It plays well with the family of XML technologies.

XML uses namespaces and can tag (i.e. express RDF properties) with ultimate flexibility.

CONS

RDF/XML files are hard for people to read.

Namespaces don't always behave the way we expect

Most of the developers who have to actually generate linked data find RDF/XML clunky

RDF/XML obscures triples

Page 27: 469 talk

Other RDF data formats are

RDFaEmbeds RDF metadata in html. Part of Drupal7.

TURTLEVery easy for people to read. Preserves RDF triples.

JSONSupported by major web applications like JavaScript,so easy to process and familiar to developer community.

Page 28: 469 talk

You should knowW3C is overhauling its RDF recommendationshttp://www.w3.org/2011/01/rdf-wg-charter

You can create your own personal URIhttp://www.foaf-project.org/

For a great overview, skim the new e-bookLinked Data: Evolving the Web into a Global Data Spacehttp://linkeddatabook.com/editions/1.0

DBPedia is the hub of RDF-linked datahttp://dbpedia.org/About

Page 29: 469 talk

The Linked World

Linking Open Data cloud diagram, by Richard Cyganiak and Anja Jentzsch. http://lod-cloud.net/