+ All Categories
Home > Documents > RDF Beyond -...

RDF Beyond -...

Date post: 03-Aug-2020
Category:
Upload: others
View: 4 times
Download: 0 times
Share this document with a friend
37
RDF Beyond RDF Beyond
Transcript
Page 1: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

RDF BeyondRDF Beyond

Page 2: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

OutlineOutline

• RDFaRDFa

• Microformat

S h• Schema.org

Page 3: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

RDFaRDFa

Page 4: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

RDFaRDFa

• RDFa: A collection of attributes and processing p grules for extending XHTML to support RDF.

• HTML contains structured data, but not accessible to tools and applicationsaccessible to tools and applications

• RDFa is a specification for attributes to express structured datastructured data 

• RDFa allows terms from multiple independently‐developed vocabularies to be freely intermixed

• RDFa brings some part of XHTML machine processable

Page 5: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

RDFa examplesRDFa examples<html

xmlns="http://www.w3.org/1999/xhtml"xmlns:foaf="http://xmlns com/foaf/0 1/"xmlns:foaf="http://xmlns.com/foaf/0.1/"xmlns:dc="http://purl.org/dc/elements/1.1/"><head>

<title>My home-page</title><meta property="dc:creator" content="Mark Birbeck" /><meta property dc:creator content Mark Birbeck /><link rel="foaf:topic" href="http://www.formsPlayer.com/#us" />

</head><body>...</body>

</html>

Page 6: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

RDFa examplesRDFa examples<html

xmlns="http://www.w3.org/1999/xhtml"xmlns:cal="http://www w3 org/2002/12/cal/ical#"xmlns:cal="http://www.w3.org/2002/12/cal/ical#"xmlns:xsd="http://www.w3.org/2001/XMLSchema"><head><title>Jo's Friends and Family Blog</title></head><body>

<p><p>I'm holding<span property="cal:summary">

one last summer Barbecue</span>,onon<span property="cal:dtstart" content="2007-09-16T16:00:00-05:00"

datatype="xsd:dateTime">September 16th at 4pm

</span>.</p>p

</body></html>

Adding datatypeAdding datatype

Page 7: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

RDFa examplesRDFa examples<html

xmlns="http://www.w3.org/1999/xhtml"xmlns:cal="http://www w3 org/2002/12/cal/ical#"xmlns:cal="http://www.w3.org/2002/12/cal/ical#"xmlns:xsd="http://www.w3.org/2001/XMLSchema"><head><title>Jo's Friends and Family Blog</title></head><body>

<p typeof="cal:Vevent"><p typeof cal:Vevent >I'm holding<span property="cal:summary">

one last summer Barbecue</span>,onon<span property="cal:dtstart" content="2007-09-16T16:00:00-05:00"

datatype="xsd:dateTime">September 16th at 4pm

</span>.</p>p

</body></html>

Adding typeofAdding typeof

Page 8: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

RDFa examplesRDFa examples<html

xmlns="http://www.w3.org/1999/xhtml"xmlns:biblio="http://example org/"xmlns:biblio="http://example.org/"xmlns:dc="http://purl.org/dc/elements/1.1/"><head>

<title>Books by Marco Pierre White</title></head></head><body>

I think White's book'<span about="urn:ISBN:0091808189" typeof="biblio:book"

property="dc:title">Canteen CuisineCanteen Cuisine

</span>'is well worth getting since although it's quite advanced stuff, hemakes it pretty easy to follow. You might also like<span about="urn:ISBN:1596913614" typeof="biblio:book"

property="dc:description">p p y pWhite's autobiography

</span>.</body>

</html>

Page 9: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

RDFaRDFa

• RDFa allows authors to mark up human‐RDFa allows authors to mark up humanreadable data with machine‐readable information for browsers and otherinformation for browsers and other applications to interpret by using a few simple XHTML attributesXHTML attributes

Page 10: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

Use caseUse case

• Alice: a blogger who publishes a mix of professionalAlice: a blogger who publishes a mix of professional and personal articles a http://example.com/alice

All content on this site is licensed under<a href="http://creativecommons.org/licenses/by/3.0/">

a Creative Commons License</a>.

All content on this site is licensed under<a rel=“kicense” href="http://creativecommons.org/licenses/by/3.0/">

a Creative Commons License</a>.

Page 11: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

Use CaseUse Case

<div xmlns:dc="http://purl org/dc/elements/1 1/"><div xmlns:dc="http://purl.org/dc/elements/1.1/"><h2 property="dc:title">The trouble with Bob</h2><h3 property="dc:creator">Alice</h3>...

</div>

Page 12: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

Use CaseUse Case<div xmlns:dc="http://purl.org/dc/elements/1.1/">

<div about="/alice/posts/trouble_with_bob"><h2 property="dc:title">The trouble with Bob</h2><h3 property="dc:creator">Alice</h3>...

</div>

<div about="/alice/posts/jos_barbecue"><h2 property="dc:title">Jo's Barbecue</h2><h3 property="dc:creator">Eve</h3>...

</div>

...

</div>

Page 13: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

Use CaseUse Case<div typeof="foaf:Person" xmlns:foaf="http://xmlns.com/foaf/0.1/">

<p property="foaf:name">Alice Birpemswick

</p>

<p>Email: <a rel="foaf:mbox"

href="mailto:[email protected]">[email protected]</a></p>

<p>Phone: <a rel="foaf:phone" href="tel:+1-617-555-7332">+1

617.555.7332</a></p>

</di ></div>

Page 14: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

Use Case<div xmlns:foaf="http://xmlns.com/foaf/0.1/" about="#me" rel="foaf:knows">

<ul><li typeof="foaf:Person">

<a property="foaf:name" rel="foaf:homepage" href="http://example.com/bob/">Bob</a></li>

i<li typeof="foaf:Person"><a property="foaf:name" rel="foaf:homepage" href="http://example.com/eve/">Eve</a>

</li><li typeof="foaf:Person">

<a property="foaf:name" rel="foaf:homepage" href="http://example.com/manu/">Manu</a></li></li>

</ul></div>

Page 15: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

MICROFORMATMICROFORMAT

Page 16: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

MicroformatsMicroformats

• A way of thinking about dataA way of thinking about data• Design principles for formats• Adapted to current behaviors and usage• Adapted to current behaviors and usage patterns

• Highly correlated with semantic XHTML• Highly correlated with semantic XHTML• A set of simple open data format standards that are actively developing and implementingthat are actively developing and implementing for more/better structured blogging and web microcontent publishing in generalmicrocontent publishing in general

Page 17: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

Microformats are NOTMicroformats are NOT

• A new languageg g• Infinitely extensible and open‐ended• An attempt to get everyone to change their behavior and rewrite their tools

• A whole new approach that throws away what already works todayalready works today

• A panacea for all taxonomies, ontologies, and other such abstractions

• Defining the whole world, or even boiling the ocean

Page 18: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

Microformat principlesMicroformat principles

• Solve a specific problemSolve a specific problem

• Start as simple as possible

i f h fi hi d• Design for humans first, machines second

• Reuse building blocks from widely adopted standards

• Modularity/embeddabilityy/ y

• Enable and encourage decentralized development content servicesdevelopment, content, services

Page 19: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

MicroformatMicroformat

• They use ‘span’ element because this is aThey use  span  element because this is a basic, versatile, element that works almost everywhere on the web

• Provide their own vocabularies<p class="vcard">Hi, my name is <span class="fn">Jamie Jones</span> and I dig microformats!</p>

Provide their own vocabularies– hCard (your information)– XFN (your networks about friends and contacts)(y )– hCalendar (events)– hReview (review movies, books, and more)( )

Page 20: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

ExamplesExamples

<div id="hcard-Ying-Ding" class="vcard">//i i i i / i i / i i /<a class="url fn" href="http://info.slis.indiana.edu/~dingying/">Ying Ding</a>

<div class="org">Indiana University</div><a class="email" href="mailto:[email protected]">[email protected]</a><div class="adr"><div class="street-address">1320 E 10th</div>< l "l lit ">Bl i t </ ><span class="locality">Bloomington</span>

, <span class="region">Indiana</span>

, <span class="postal-code">47405</span>

<span class="country-name">USA</span>

</div><div class="tel">8128555388</div>

<p style="font-size:smaller;">This <a<p style font size:smaller; >This <a href="http://microformats.org/wiki/hcard">hCard</a> created with the <a href="http://microformats.org/code/hcard/creator">hCard creator</a>.</p></div>

Generate your own one: http://microformats.org/code/hcard/creator, for more tools: http://microformats.org/code‐tools

Page 21: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

SCHEMA.ORGSCHEMA.ORG

Page 22: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

Schema.orgSchema.org

• This is a joint effort from Microsoft GoogleThis is a joint effort from Microsoft, Google and Yahoo! to provide a collection of schemas (i e HTML tags) to better represent the(i.e. HTML tags) to better represent the structured data on the Web.

• It started May 2011• It started May 2011.

• Website: http://schema.org/

• Blog: http://blog.schema.org/

Page 23: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

Schema for personSchema for person

http://schema.org/Person

Page 24: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

Overview of whole SchemaOverview of whole Schema

http://schema.org/docs/full.html

Page 25: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

DatatypeDatatype

• Have their own datatypesHave their own datatypes

Page 26: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

Data Model of Schema.orgData Model of Schema.org

• It is similar a data model of RDF tripleIt is similar a data model of RDF triple– A set of types in a hierarchy with multiple inheritanceinheritance

– A set of properties with multiple domains and ranges.ranges.

Page 27: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

Mapping to RDFa1.1Mapping to RDFa1.1Buyers:

<div vocab="http://schema.org/" typeof="Product"><img rel="image" src="dell-30in-lcd.jpg" /><span property="name">Dell UltraSharp 30" LCD Monitor</span>

<div rel="hasAggregateRating" ><div typeof="http://schema.org/AggregateRating">

<span property="ratingValue">87</span>out of <span property="bestRating">100</span>based on <span property="ratingCount">24</span> user ratings

</div></di ></div>

<div rel="offers" ><div typeof="http://schema.org/AggregateOffer">

<span property="lowPrice">$1250</span>to <span property="highPrice">$1495</span>to <span property= highPrice >$1495</span>from <span property="offerCount">8</span> sellers

</div></div>

Page 28: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

Mapping to RDFa1.1Mapping to RDFa1.1

Sellers:<div rel="offers" >

<div typeof="http://schema.org/Offer"><a property="url" href="save-a-lot-monitors.com/dell-30.html">Save A Lot Monitors - $1250</a>

</div></div>

<div rel="offer" ><div typeof="http://schema.org/Offer">< t " l" h f "j d d t /d ll 30 ht l"><a property="url" href="jondoe-gadgets.com/dell-30.html">Jon Doe's Gadgets - $1350</a>

</div></div>...

</div></div>

Page 29: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

Schema.org using MicrodataSchema.org using Microdata

• Basic Vocabulary of MicrodataBasic Vocabulary of Microdata(http://dev.w3.org/html5/md‐LC/)

Page 30: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

Microdata modelMicrodata model

• Item: a group of name‐value pairsItem: a group of name value pairs– Each item can have item type, a global identifier, and a list of propertiesand a list of properties

• Property: name in the name‐value pairEach property has one or more values– Each property has one or more values

– Each value is a string or an item

Item Property Value

Page 31: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

ItemItem

• itemid itemscope itemprop itemref itemtypeitemid, itemscope, itemprop,itemref, itemtype<div itemscope><p>My name is <span itemprop="name">Neil</span>.</p><p>My band is called <span itemprop="band">Four Parts Water</span>.</p>

T d it

<p>I am <span itemprop="nationality">British</span>.</p></div>

• Typed items<section itemscope itemtype="http://example.org/animals#cat"><h1 itemprop="name">Hedral</h1>

i "d " d l i l i d i<p itemprop="desc">Hedral is a male american domesticshorthair, with a fluffy black fur with white paws and belly.</p><img itemprop="img" src="hedral.jpeg" alt="" title="Hedral, age 18 months">

</section>

Page 32: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

ItemItem

• Global identifier for itemsGlobal identifier for items<dl itemscope

itemtype="http://vocab.example.net/book"itemid="urn:isbn:0-330-34032-8">

<dt>Title<dt>Title<dd itemprop="title">The Reality Dysfunction<dt>Author<dd itemprop="author">Peter F. Hamilton<dt>Publication date<dd><time itemprop="pubdate" datetime="1996-01-26">26 January 1996</time>dd time itemprop pubdate datetime 1996 01 26 26 January 1996 /time

</dl>

Page 33: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

PropertyProperty

• Using itempropUsing itemprop– The value of the itemprop is the unordered set of unique space‐separated tokens and case‐sensitiveunique space separated tokens, and case sensitive

<section itemscope itemtype="http://example.org/animals#cat"><h1 itemprop="name http://example.com/fn">Hedral</h1><p itemprop="desc">Hedral is a male american domesticp itemprop desc Hedral is a male american domesticshorthair, with a fluffy <spanitemprop="http://example.com/color">black</span> fur with <spanitemprop="http://example.com/color">white</span> paws and belly.</p><img itemprop="img" src="hedral.jpeg" alt="" title="Hedral, age 18 months">

</section>

Page 34: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

ValueValue• The property value: the value of itemprop.<html><head><title>Photo gallery</title>

</head><body>y<h1>My photos</h1><figure itemscope itemtype="http://n.whatwg.org/work" itemref="licenses"><img itemprop="work" src="images/house.jpeg" alt="A white house, boarded up, sits

in a forest."><figcaption itemprop="title">The house I found.</figcaption></figure><figure itemscope itemtype="http://n.whatwg.org/work" itemref="licenses"><img itemprop="work" src="images/mailbox.jpeg" alt="Outside the house is a mailbox.

It has a leaflet inside."><figcaption itemprop="title">The mailbox.</figcaption>

</figure><footer><p id="licenses">All images licensed under the <a itemprop="license"href="http://www.opensource.org/licenses/mit-license.php">MITlicense</a>.</p>/</footer>

</body></html>

Page 35: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

Converting Microdata to RDFConverting Microdata to RDF<dl itemscope

itemtype="http://purl.org/vocab/frbr/core#Work"itemid="http://books.example.com/works/45U8QJGZSQKDH8N">p p

<dt>Title</dt><dd><cite itemprop="http://purl.org/dc/terms/title">Just a Geek</cite></dd><dt>By</dt><dd><span itemprop="http://purl.org/dc/elements/1.1/creator">Wil Wheaton</span></dd><dt>Format</dt><dd itemprop="http://purl.org/vocab/frbr/core#realization"

itemscopeitemtype="http://purl.org/vocab/frbr/core#Expression"itemid="http://books.example.com/products/9780596007683.BOOK">

<link itemprop="http://purl.org/dc/terms/type" href="http://books.example.com/product-types/BOOK">

Print</dd><dd itemprop="http://purl.org/vocab/frbr/core#realization"

itemscopeit t "htt // l / b/f b / #E i "itemtype="http://purl.org/vocab/frbr/core#Expression"itemid="http://books.example.com/products/9780596802189.EBOOK">

<link itemprop="http://purl.org/dc/terms/type" href="http://books.example.com/product-types/EBOOK">

Ebook</dd></dd>

</dl>

Page 36: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

Converting Microdata to RDFConverting Microdata to RDF@prefix dct: <http://purl.org/dc/terms/> .@prefix dce: <http://purl.org/dc/elements/1.1/> .@prefix frbr: <http://purl.org/vocab/frbr/core#> .p p p g

<http://books.example.com/works/45U8QJGZSQKDH8N> a frbr:Work ;dce:creator "Wil Wheaton"@en ;dct:title "Just a Geek"@en ;frbr:realization <http://books.example.com/products/9780596007683.BOOK>,

<http://books.example.com/products/9780596802189.EBOOK> .

<http://books.example.com/products/9780596007683.BOOK> a frbr:Expression ;dct:type <http://books.example.com/product-types/BOOK> .

<http://books.example.com/products/9780596802189.EBOOK> a frbr:Expression ;dct:type <http://books.example.com/product-types/EBOOK> .

Page 37: RDF Beyond - info.slis.indiana.eduinfo.slis.indiana.edu/~dingying/Teaching/S636/Slides/RDFBeyond.pdf · RDFa • RDFa: A collection of attributes and ppgrocessing rules for extending

ReferencesReferences

• RDFaa– RDFa at W3C: http://www.w3.org/TR/rdfa‐syntax/– RDFa Primer: http://www.w3.org/TR/xhtml‐rdfa‐primer/

– RDFa Wiki: http://rdfa.info/wiki/Tutorials

S h• Schema.org– www.schema.orgMicrodata: http://devw3 org/html5/md LC/– Microdata: http://dev.w3.org/html5/md‐LC/

• Microformat:– http://microformats org/http://microformats.org/


Recommended