skos, rdfa, microformats, microdata

70
SKOS, RDFa & Co, Linked Data Related Examples INFO 4302 - April 20, 2011 Bernhard Haslhofer - Cornell University

Upload: bernhard-haslhofer

Post on 11-May-2015

3.804 views

Category:

Documents


3 download

DESCRIPTION

Lecture slides presented in Web Information Systems course.

TRANSCRIPT

Page 1: SKOS, RDFa, Microformats, Microdata

SKOS, RDFa & Co, Linked Data Related Examples

INFO 4302 - April 20, 2011Bernhard Haslhofer - Cornell University

Page 2: SKOS, RDFa, Microformats, Microdata

Today we talk about...

• Simple Knowledge Organization System (SKOS)

• Machine-readable data in (X)HTML(5)(RDFa, Microformats, Microdata)

• Search Engines and machine-readable data

• Facebook Graph API & Open Graph Protocol

Page 3: SKOS, RDFa, Microformats, Microdata

Linked Data Recap

Page 4: SKOS, RDFa, Microformats, Microdata

Why Linked Data?

• There is lots of information on the Web

• ... valuable information that can be (re-)used

• Problem• information is usually expressed in the form of

HTML documents

• the underlying raw data are locked in closed data silos (mostly DBMS)

Page 5: SKOS, RDFa, Microformats, Microdata

Why Linked Data?

• The Web is successful because it provides• Uniform encoding (HTML)

• Uniform addressing (URI)

• Uniform transportation (HTTP)

for the exchange of documents.

• Why not apply the same mechanism to the underlying data?

Page 6: SKOS, RDFa, Microformats, Microdata

What is Linked Data?

• A method to build a Web of Data

• Architectural style, set of standards

Web

Page 7: SKOS, RDFa, Microformats, Microdata

Publishing Data

• Distinguish between non-information and information resource

• Sample non-information resource• http://dbpedia.org/resource/The_Shining_(film)

• Sample information resource• http://dbpedia.org/page/The_Shining_(film) - HTML

• http://dbpedia.org/data/The_Shining_(film) - RDF

Page 8: SKOS, RDFa, Microformats, Microdata

Publishing Data

GET http://dbpedia.org/resource/The_Shining_(film)Accept: application/rdf+xml

303 See OtherLocation: http://dbpedia.org/data/The_Shining_(film)

GET http://dbpedia.org/data/The_Shining_(film)Accept: application/rdf+xml

200 OK...<?xml version="1.0" encoding="utf-8"?><rdf:RDF ...

Page 9: SKOS, RDFa, Microformats, Microdata

Simple Knowledge Organization System (SKOS)

• A language for describing controlled vocabularies (taxonomies, thesauri, classification schemes)

http://dbpedia.org/resource/The_Shining_(film)

http://dbpedia.org/resource/Category:1980s_horror_films

http://dbpedia.org/resource/Category:1980s_films

http://www.w3.org/2004/02/skos/core#Concept

skos:subject rdf:type

skos:broader

rdf:type

Page 10: SKOS, RDFa, Microformats, Microdata
Page 11: SKOS, RDFa, Microformats, Microdata
Page 12: SKOS, RDFa, Microformats, Microdata

Excursus: The Semantic Spectrum

Page 13: SKOS, RDFa, Microformats, Microdata

semanticexpressiveness

complexity

Glossary

Taxonomy

Thesaurus

Data Model

Ontology

Term/Tag list

SKOSXML/S

Folksonomy

UMLER

OWLDL, FOL, etc

Knowledge Organization Systems (KOS)

Page 14: SKOS, RDFa, Microformats, Microdata

Glossary

• A simple (alphabetical) list of terms and their definitions for a particular domain of knowledge

• Useful for creating clear and unambiguous term definitions

Page 15: SKOS, RDFa, Microformats, Microdata

Folksonomy

• Collaborative tagging systems

• Web 2.0., social-media, etc...

Page 16: SKOS, RDFa, Microformats, Microdata

Controlled Vocabulary

• A simple list of terms, definitions and naming conventions

• Some process “controls” adding and removing term definitions to ensure consistency

• Terms are often defined in relationship to each other

• Taxonomies, Thesauri, and Ontologies are special forms of controlled vocabularies

Page 17: SKOS, RDFa, Microformats, Microdata

Taxonomy

• Classification of entities in a hierarchy

• A taxonomy node stands for a real-world entity

animate object

agent

organizationperson

manager employee

subclass of

Page 19: SKOS, RDFa, Microformats, Microdata
Page 20: SKOS, RDFa, Microformats, Microdata

Thesaurus

• Associates the meaning of a term with the meaning of another term

• hypernym, hyponym, synonym, antonym

Imagery

Aerial imagery Infrared imagery

Radar imagery

Moving target

indicators

Radar

photography

narrower than

Combat support

equipment

Intelligence and electronic

warfare equipment

Imaging systems

Imaging radarInfrared imaging

systemsrelated to

Page 21: SKOS, RDFa, Microformats, Microdata
Page 22: SKOS, RDFa, Microformats, Microdata
Page 23: SKOS, RDFa, Microformats, Microdata

Ontology

• Defines concepts that represent an area of knowledge

• Machine-read and -interpretable representation

• Classes, instances, relationships, properties, functions, constraints, etc.

Page 25: SKOS, RDFa, Microformats, Microdata

Simple Knowledge Organization System (SKOS)

Page 26: SKOS, RDFa, Microformats, Microdata

What is SKOS?

• A model for expressing the basic structure and content of concept schemes such as thesauri, classification schemes, taxonomies, folksonomies, and other similar types of controlled vocabularies

• Allows concepts to be composed and published as Linked Data on the Web

• Hides the complexity of OWL - easy to use

Page 27: SKOS, RDFa, Microformats, Microdata

semanticexpressiveness

complexity

Glossary

Taxonomy

Thesaurus

Data Model

Ontology

Term/Tag list

SKOSXML/S

Folksonomy

UMLER

OWLDL, FOL, etc

Page 28: SKOS, RDFa, Microformats, Microdata

SKOS Concepts are...

• ... identified with URIs

• ... labeled with 1..* natural language strings

• ... documented with various types of notes

• ... semantically linked to each other

• ... aggregated into concept schemes

Page 29: SKOS, RDFa, Microformats, Microdata

Example SKOS Concept

Page 30: SKOS, RDFa, Microformats, Microdata

skos:Concept

• Concepts are• the units of thought: ideas, meanings, categories of

objects, etc.

• abstract entities which are independent of the terms used to label them

lcsh:sh2007025344#concept

skos:Concept

rdf:type

@prefix skos: <http://www.w3.org/2004/02/skos/core#> .@prefix lcsh: <http://id.loc.gov/authorities/> .

Page 31: SKOS, RDFa, Microformats, Microdata

skos:(pref|alt|hidden)Label

• Labels refer to concepts’ natural language(s)• skos:prefLabel: the preferred lexical label

• skos:altLabel: alternative lexical labels (e.g., synonyms)

• skos:hiddenLabel: labels useful for indexing

"Parody films"@en

skos:prefLabel

lcsh:sh2007025344#concept "Movie parodies"@enskos:altLabel

"Send-up films"@en

skos:altLabel

Page 32: SKOS, RDFa, Microformats, Microdata

SKOS Semantic Relationships

• The meaning of a concept is also defined by its links to other concepts• skos:broader: hierarchical link to a more general concept

• skos:narrower: hierarchical link to a more specific concept

• skos:related: associative (non-hierarchical) link

"Parody films"@enskos:prefLabellcsh:sh2007025344#concept

"Comedy films"@enskos:prefLabellcsh:sh2007025038#concept

skos:broader

skos:broader

skos:narrower

skos:narrower

Page 33: SKOS, RDFa, Microformats, Microdata

SKOS Documentary Notes

• Add further human-readable documentation• skos:scopeNote: info about intended meaning

• skos:definition: complete explanation of meaning

• skos:example: example concept use

“This heading is used as a genre/form heading for films that comically imitate another work or group of works of a more serious nature.”@en

skos:scopeNotelcsh:sh2007025038#concept

"Comedy films"@en

skos:prefLabel

Page 34: SKOS, RDFa, Microformats, Microdata

skos:ConceptScheme

• Allow the organization of skos:Concepts in some Knowledge Organization Scheme (KOS)

skos:inScheme

skos:Conceptlcsh:sh2007025038#concept

skos:ConceptSchemelcsh:#genreFormTerms

skos:Concept...

skos:inScheme

Page 35: SKOS, RDFa, Microformats, Microdata

Example

• Dereference and analyze“Jack Nicholson” @ New York Times

• http://data.nytimes.com

• http://data.nytimes.com/N5761411277431266513

Page 36: SKOS, RDFa, Microformats, Microdata
Page 37: SKOS, RDFa, Microformats, Microdata

RDFa, Microformats & Microdata

Page 38: SKOS, RDFa, Microformats, Microdata

Why RDFa?

GET http://dbpedia.org/resource/The_Shining_(film)Accept: application/rdf+xml

303 See OtherLocation: http://dbpedia.org/data/The_Shining_(film)

GET http://dbpedia.org/data/The_Shining_(film)Accept: application/rdf+xml

200 OK...<?xml version="1.0" encoding="utf-8"?><rdf:RDF ...

Oh dear!

Page 39: SKOS, RDFa, Microformats, Microdata

What is RDFa?

• A mechanism for embedding RDF metadata within XHTML 1.1 Web documents

• Defines a set of attributes to augment visual data with machine-readable hints

• User agents can extract triples from RDFa-enables Web pages

Page 40: SKOS, RDFa, Microformats, Microdata

What is RDFa?

• Markup human-readable data (HTML) with machine-readable indicators

Page 41: SKOS, RDFa, Microformats, Microdata

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

RDFa Example

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

XHTML

XHTML + RDFa

Page 42: SKOS, RDFa, Microformats, Microdata

RDFa Attributes

• about and src: the resource the metadata is about

• rel and rev: (reverse) relationship between resources

• href and resource: the partner resource

• property: a property for the content of an element

• content: override content of an element

• datatype: specify the datatype of text

• typeof: specifies the RDF type(s) or a subject

Page 43: SKOS, RDFa, Microformats, Microdata

<div> <h2>The trouble with Bob</h2> <h3>Alice</h3> ...</div>

RDFa Example

<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>

XHTML

XHTML + RDFa

Page 44: SKOS, RDFa, Microformats, Microdata

<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>

RDFa Example

XHTML + RDFa

Page 45: SKOS, RDFa, Microformats, Microdata

<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></div>

RDFa Example

XHTML + RDFa

Page 47: SKOS, RDFa, Microformats, Microdata
Page 48: SKOS, RDFa, Microformats, Microdata

Microformats

• A Microformat extends conventional HTML tags with semantic information

• Started by Technorati, Inc.; now community-driven (IRC, mailing list, blogs)

• Make use of the following (X)HTML attributes• class

• rel

Page 49: SKOS, RDFa, Microformats, Microdata

<div> <div>Joe Doe</div> <div>Jo</div> <div>The Example Company</div> <div>604-555-1234</div> <a href="http://example.com/">http://example.com/</a> </div>

Microformats Example

<head profile="http://www.w3.org/2006/03/hcard"> ... </head> ... <div class="vcard"> <div class="fn">Joe Doe</div> <div class="nickname">Jo</div> <div class="org">The Example Company</div> <div class="tel">604-555-1234</div> <a class="url" href="http://example.com/">http://example.com/</a> </div>

HTML

XHTML + Microformats

Page 50: SKOS, RDFa, Microformats, Microdata

Microformats Example

Page 51: SKOS, RDFa, Microformats, Microdata

Available Microformats

Page 52: SKOS, RDFa, Microformats, Microdata

Microformats vs. RDFa

<div xmlns="http://www.w3.org/1999/xhtml" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:v="http://www.w3.org/2006/vcard/ns#"> <div about="http://example.com/me/behas" typeof="v:VCard"> <span property="v:fn">Bernhard Haslhofer</span> <span property="v:nickname">behas</span> <div rel="v:adr"> <div typeof="v:Address v:Work"> <span property="v:street-address">301 College Avenue</span> <span property="v:locality">Ithaca</span>, <span property="v:postal-code">14850</span>, <span property="v:country-name">United States</span>. </div> </div> <a rel="v:email" href="mailto:[email protected]">[email protected]</a>. </div></div>

Sample vCard Object in RDFa (see http://www.w3.org/Submission/vcard-rdf/)

Page 53: SKOS, RDFa, Microformats, Microdata

Microformats vs. RDFa

<div class="vcard">

<span class="fn">Bernhard Haslhofer</span>

<div class="adr"><div class="street-address">301 College Avenue</div><span class="locality">Ithaca</span><span class="postal-code">14850</span><span class="country-name">United States</span>

</div>

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

</div>

hCard sample created with http://microformats.org/code/hcard/creator

Page 54: SKOS, RDFa, Microformats, Microdata

Also see: http://evan.prodromou.name/RDFa_vs_microformats

Microformats RDFa

flat namespace XML namespaces

support HTML4, XHTML 1.1, and HTML 5 support for XHTML 1.1

use latent HTML attributes introduces new metadata attributes

vocabulary defined by one organization/community open to any RDF-based vocabulary

Page 55: SKOS, RDFa, Microformats, Microdata

Microdata (HTML5)

• A very young HTML 5 proposition that extends Microformats and addresses its shortcomings

• Items are created within an itemscope

• Ever item is assigned an arbitrary number of properties (itemprop)

• Uses global identifiers for typing and naming items

Page 56: SKOS, RDFa, Microformats, Microdata

Microdata Example

<div itemscope itemtype="http://data-vocabulary.org/Person">

<span itemprop="name">Bernhard Haslhofer</span>, <span itemprop="nickname">behas</span>.

<div itemprop="address" itemscope itemtype="http://data-vocabulary.org/Address"><span itemprop="street-address">301 College Avenue</span><span itemprop="locality">Ithaca</span><span itemprop="country-name">United States</span>

</div>

</div>

Page 57: SKOS, RDFa, Microformats, Microdata

Search engines and machine-readable data

Page 58: SKOS, RDFa, Microformats, Microdata
Page 59: SKOS, RDFa, Microformats, Microdata

Google Rich Snippets

• Reviews

• People

• Products

• Businesses and organizations

• Recipes

• Events

Page 60: SKOS, RDFa, Microformats, Microdata

Google Rich Snippets

<div>L’Amourita PizzaReviewed by Ulysses Grant on Jan 6.Delicious, tasty pizza on Eastlake!L'Amourita serves up traditional wood-fired Neapolitan-style pizza, brought to your table promptly and without fuss. An ideal neighborhood pizza joint.Rating: 4.5</div>

HTML

Page 61: SKOS, RDFa, Microformats, Microdata

Google Rich Snippets

<div> <div itemscope itemtype="http://data-vocabulary.org/Review"> <span itemprop="itemreviewed">L’Amourita Pizza</span> Reviewed by <span itemprop="reviewer">Ulysses Grant</span> on <time itemprop="dtreviewed" datetime="2009-01-06">Jan 6</time>. <span itemprop="summary">Delicious, tasty pizza in Eastlake!</span> <span itemprop="description">L'Amourita serves up traditional wood-fired Neapolitan-style pizza, brought to your table promptly and without fuss. An ideal neighborhood pizza joint.</span> Rating: <span itemprop="rating">4.5</span> </div></div>

Microdata

Page 62: SKOS, RDFa, Microformats, Microdata

Google Rich Snippets

<div class="hreview"> <span class="item"> <span class="fn">L’Amourita Pizza</span> </span> Reviewed by <span class="reviewer">Ulysses Grant</span> on <span class="dtreviewed"> Jan 6<span class="value-title" title="2009-01-06"></span> </span>. <span class="summary">Delicious, tasty pizza on Eastlake!</span> <span class="description">L'Amourita serves up traditional wood-fired Neapolitan-style pizza, brought to your table promptly and without fuss. An ideal neighborhood pizza joint.</span> Rating: <span class="rating">4.5</span></div>

Microformats

Page 63: SKOS, RDFa, Microformats, Microdata

Google Rich Snippets

<div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Review"> <span property="v:itemreviewed">L’Amourita Pizza</span> Reviewed by <span property="v:reviewer">Ulysses Grant</span> on <span property="v:dtreviewed" content="2009-01-06">Jan 6</span>. <span property="v:summary">Delicious, tasty pizza on Eastlake!</span> <span property="v:description">L'Amourita serves up traditional wood-fired Neapolitan-style pizza, brought to your table promptly and without fuss. An ideal neighborhood pizza joint.</span> Rating: <span property="v:rating">4.5</span></div>

RDFa

Page 64: SKOS, RDFa, Microformats, Microdata

Facebook Graph API & Open Graph Protocol

Page 65: SKOS, RDFa, Microformats, Microdata
Page 66: SKOS, RDFa, Microformats, Microdata
Page 67: SKOS, RDFa, Microformats, Microdata

Readings

Page 68: SKOS, RDFa, Microformats, Microdata

Required Reading

• SKOS Primer: http://www.w3.org/TR/skos-primer/

• RDFa Primer: Bridging the Human and Data Webs.http://www.w3.org/TR/xhtml-rdfa-primer/

• HTML Microdata: http://www.w3.org/TR/microdata/

• Microformats: http://microformats.org/

Page 69: SKOS, RDFa, Microformats, Microdata

Recommended Readings

• SKOS Vocabularies Overview:

• RDFa.info: http://rdfa.info/wiki/RDFa_Wiki

• CC REL: Creative Commons Rights Expression Language (CC REL)

Page 70: SKOS, RDFa, Microformats, Microdata

source: http://upload.wikimedia.org/wikipedia/commons/a/a7/Wollmilchsau.png

~2000 2011

Reality

Dream

HTML 5Microdata

RDFa