191
1

Slides chi2011

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Slides chi2011

1

Page 2: Slides chi2011

Semantic Web benefits

2

Page 3: Slides chi2011

Semantic Web benefits

Programs and sites can exchange information

2

Page 4: Slides chi2011

Semantic Web benefits

Programs and sites can exchange information

my-site.net your-site.org

2

Page 5: Slides chi2011

Semantic Web benefits

Programs and sites can exchange information

my-site.net your-site.orgcompany.com

2

Page 6: Slides chi2011

Semantic Web benefits

Programs and sites can exchange information

my-site.net your-site.orgcompany.com

2

Page 7: Slides chi2011

Semantic Web benefits

Programs and sites can exchange information

my-site.net your-site.orgcompany.com

2

Page 8: Slides chi2011

Semantic Web benefits

Programs and sites can exchange information

my-site.net your-site.orgcompany.com

2

Page 9: Slides chi2011

Semantic Web benefits

Programs and sites can exchange information

my-site.net your-site.orgcompany.com

Search engines can display more relevant information in results

2

Page 10: Slides chi2011

Semantic Web benefits

Programs and sites can exchange information

my-site.net your-site.orgcompany.com

Search engines can display more relevant information in results

2

Page 11: Slides chi2011

Semantic Web benefits

Programs and sites can exchange information

my-site.net your-site.orgcompany.com

Search engines can display more relevant information in results

Data mashers can combine data from different datasets to find new and astounding things

2

Page 12: Slides chi2011

Semantic Web benefits

Programs and sites can exchange information

my-site.net your-site.orgcompany.com

Search engines can display more relevant information in results

Data mashers can combine data from different datasets to find new and astounding things

2

Page 13: Slides chi2011

Semantic Web benefits

Programs and sites can exchange information

my-site.net your-site.orgcompany.com

+

Search engines can display more relevant information in results

Data mashers can combine data from different datasets to find new and astounding things

2

Page 14: Slides chi2011

Semantic Web benefits

Programs and sites can exchange information

my-site.net your-site.orgcompany.com

+

Search engines can display more relevant information in results

Data mashers can combine data from different datasets to find new and astounding things

2

Page 15: Slides chi2011

Key (confusing) terms

3

Page 16: Slides chi2011

Key (confusing) terms

Machine Understandable

3

Page 17: Slides chi2011

Key (confusing) terms

RDF

Machine Understandable

3

Page 18: Slides chi2011

Key (confusing) terms

RDF

Machine UnderstandableLinked Data

3

Page 19: Slides chi2011

Key (confusing) terms

RDF

Machine UnderstandableLinked Data

SPARQL

3

Page 20: Slides chi2011

Key (confusing) terms

RDF

Machine UnderstandableLinked Data

SPARQLFederated Dataset

3

Page 21: Slides chi2011

Key (confusing) terms

RDF

Machine UnderstandableLinked Data

SPARQLFederated DatasetGiant

GlobalGraph

3

Page 22: Slides chi2011

Machine Understandable

4

Page 23: Slides chi2011

Machine Understandable

4

Page 24: Slides chi2011

Machine Understandable

4

Page 25: Slides chi2011

Machine Understandable

4

Page 26: Slides chi2011

Machine Understandable

4

Page 27: Slides chi2011

Machine Understandable

4

Page 28: Slides chi2011

Machine Understandable

4

Page 29: Slides chi2011

Machine Understandable

The Semantic Web helps machines understand what the information on a Web page is...

4

Page 30: Slides chi2011

Machine Understandable

The Semantic Web helps machines understand what the information on a Web page is...

4

Page 31: Slides chi2011

Machine Understandable

The Semantic Web helps machines understand what the information on a Web page is...

Lin Clarkis a name

4

Page 32: Slides chi2011

Machine Understandable

Lin Clarkis a name

4

Page 33: Slides chi2011

Machine Understandable

and the relationships between different pieces of information.

Lin Clarkis a name

4

Page 34: Slides chi2011

Machine Understandable

and the relationships between different pieces of information.

4

Page 35: Slides chi2011

Machine Understandable

and the relationships between different pieces of information.

linclark.jpgis a pictureof a person

named Lin Clark

4

Page 36: Slides chi2011

RDF

RDF

esource

escription

ramework

5

Page 37: Slides chi2011

RDF

Everything is a resource

6

Page 38: Slides chi2011

RDF

Everything is a resourceA resource is a named thing

6

Page 39: Slides chi2011

RDF

Everything is a resourceA resource is a named thing

this

6

Page 40: Slides chi2011

RDF

Everything is a resource

this

6

Page 41: Slides chi2011

RDF

Everything is a resource

6

Page 42: Slides chi2011

RDF

Everything is a resource

http://lin-clark.com/page.html#this

6

Page 43: Slides chi2011

RDF

Everything is a resource

http://lin-clark.com/page.html#this

URI

6

Page 44: Slides chi2011

RDF

Everything is a resource

http://lin-clark.com/page.html#this

6

Page 45: Slides chi2011

RDF

Everything is a resource

6

Page 46: Slides chi2011

RDF

Everything is a resource

lin:this

6

Page 47: Slides chi2011

RDF

Everything is a resource

lin:this

Namespacexmlns:lin=”http://lin-clark.com/page.html#

6

Page 48: Slides chi2011

RDF

Everything is a resource

lin:this

CURIENamespacexmlns:lin=”http://lin-clark.com/page.html#

6

Page 49: Slides chi2011

RDF

A resource can be a document

dblp:this

7

Page 50: Slides chi2011

RDF

A resource can be a document

dblp:this

foaf:Document

7

Page 51: Slides chi2011

RDF

A resource can be a company

deri:this

8

Page 52: Slides chi2011

RDF

A resource can be a company

deri:this

foaf:Organization

8

Page 53: Slides chi2011

RDF

A resource can even be a person

lin:me

9

Page 54: Slides chi2011

RDF

A resource can even be a person

lin:me

foaf:Person

9

Page 55: Slides chi2011

RDF

You can describe properties of that person...

lin:me

10

Page 56: Slides chi2011

RDF

You can describe properties of that person...

lin:me

foaf:name Lin Clark

10

Page 57: Slides chi2011

RDF

You can describe properties of that person...

lin:me

foaf:name Lin Clark

foaf:mbox [email protected]

10

Page 58: Slides chi2011

RDF

You can describe properties of that person...

lin:me

foaf:name Lin Clark

foaf:mbox [email protected]

foaf:birthday 07-01

10

Page 59: Slides chi2011

RDF

and describe how that person is related to other resources

lin:me

deri:thisdblp:this

swrc:employsfoaf:made

11

Page 60: Slides chi2011

SVO

12

Page 61: Slides chi2011

SVO

12

Page 62: Slides chi2011

SVO

Subject

12

Page 63: Slides chi2011

SVO

Subject Verb

12

Page 64: Slides chi2011

SVO

Subject Verb Object

12

Page 65: Slides chi2011

SVO

13

Page 66: Slides chi2011

SVO

SVO

13

Page 67: Slides chi2011

SVO

SVO

My

13

Page 68: Slides chi2011

SVO

SVO

My name is

13

Page 69: Slides chi2011

SVO

SVO

My name is Lin Clark

13

Page 70: Slides chi2011

SVO

SVO

<http://lin-clark.com/#me>

My name is Lin Clark

13

Page 71: Slides chi2011

SVO

SVO

<http://lin-clark.com/#me>

<http://xmlns.com/foaf/0.1/name>

My name is Lin Clark

13

Page 72: Slides chi2011

SVO

SVO

<http://lin-clark.com/#me>

<http://xmlns.com/foaf/0.1/name>

“Lin Clark”

My name is Lin Clark

13

Page 73: Slides chi2011

SVO

SVO

My name is Lin Clark

<http://lin-clark.com/#me>

<http://xmlns.com/foaf/0.1/name>

“Lin Clark”

14

Page 74: Slides chi2011

SVO

SVO

My name is Lin Clark

<http://lin-clark.com/#me>

<http://xmlns.com/foaf/0.1/name>

prefix=”lin: http://lin-clark.com/#”

“Lin Clark”

14

Page 75: Slides chi2011

SVO

SVO

My name is Lin Clark

<http://xmlns.com/foaf/0.1/name>

prefix=”lin: http://lin-clark.com/#”

“Lin Clark”

14

Page 76: Slides chi2011

SVO

SVO

My name is Lin Clark

<http://xmlns.com/foaf/0.1/name>

prefix=”lin: http://lin-clark.com/#”

lin:me

“Lin Clark”

14

Page 77: Slides chi2011

SVO

SVO

My name is Lin Clark

<http://xmlns.com/foaf/0.1/name>

prefix=”lin: http://lin-clark.com/#”

lin:me

prefix=”foaf : http://xmlns.com/foaf/

“Lin Clark”

14

Page 78: Slides chi2011

SVO

SVO

My name is Lin Clark

prefix=”lin: http://lin-clark.com/#”

lin:me

prefix=”foaf : http://xmlns.com/foaf/

“Lin Clark”

14

Page 79: Slides chi2011

SVO

SVO

My name is Lin Clark

prefix=”lin: http://lin-clark.com/#”

lin:me foaf:name

prefix=”foaf : http://xmlns.com/foaf/

“Lin Clark”

14

Page 80: Slides chi2011

SVO

SVO

My name is Lin Clark

prefix=”lin: http://lin-clark.com/#”

lin:me foaf:name

prefix=”foaf : http://xmlns.com/foaf/

14

Page 81: Slides chi2011

SVO

SVO

My name is Lin Clark

“Lin Clark”

prefix=”lin: http://lin-clark.com/#”

lin:me foaf:name

prefix=”foaf : http://xmlns.com/foaf/

14

Page 82: Slides chi2011

SVO

SVO

My name is Lin Clark

“Lin Clark”

prefix=”lin: http://lin-clark.com/#”

lin:me foaf:name

prefix=”foaf : http://xmlns.com/foaf/

I know Stéphane

15

Page 83: Slides chi2011

SVO

SVO

My name is Lin Clark

“Lin Clark”

prefix=”lin: http://lin-clark.com/#”

lin:me foaf:name

prefix=”foaf : http://xmlns.com/foaf/

I know Stéphane

lin:me

15

Page 84: Slides chi2011

SVO

SVO

My name is Lin Clark

“Lin Clark”

prefix=”lin: http://lin-clark.com/#”

lin:me foaf:name

prefix=”foaf : http://xmlns.com/foaf/

I know Stéphane

lin:me foaf:knows

15

Page 85: Slides chi2011

SVO

SVO

My name is Lin Clark

“Lin Clark”

prefix=”lin: http://lin-clark.com/#”

lin:me foaf:name

prefix=”foaf : http://xmlns.com/foaf/

I know Stéphane

lin:me foaf:knows scor:me

15

Page 86: Slides chi2011

SVO

SVO

My name is Lin Clark

“Lin Clark”

prefix=”lin: http://lin-clark.com/#”

lin:me foaf:name

prefix=”foaf : http://xmlns.com/foaf/

I know Stéphane

} Literal

lin:me foaf:knows scor:me

15

Page 87: Slides chi2011

SVO

SVO

My name is Lin Clark

“Lin Clark”

prefix=”lin: http://lin-clark.com/#”

lin:me foaf:name

prefix=”foaf : http://xmlns.com/foaf/

I know Stéphane

} Literal

} Resourcelin:me foaf:knows scor:me

15

Page 88: Slides chi2011

Federated Dataset

lin:me

deri:thisdblp:this

swrc:employsfoaf:made

16

Page 89: Slides chi2011

Federated Dataset

Because we are using http URIs,these resources don’t need to be in the same database

lin:me

deri:thisdblp:this

swrc:employsfoaf:made

16

Page 90: Slides chi2011

Federated Dataset

the resources can be distributed across the Webin a federated way

17

Page 91: Slides chi2011

Giant Global Graph

And when all resources are described this way,the Web becomes one giant database...

18

Page 92: Slides chi2011

Giant Global Graph

And when all resources are described this way,the Web becomes one giant database...

18

Page 93: Slides chi2011

Giant Global Graph

And when all resources are described this way,the Web becomes one giant database...

18

Page 94: Slides chi2011

Giant Global Graph

And when all resources are described this way,the Web becomes one giant database...

18

Page 95: Slides chi2011

Giant Global Graph

And when all resources are described this way,the Web becomes one giant database...

18

Page 96: Slides chi2011

Giant Global Graph

And when all resources are described this way,the Web becomes one giant database...

18

Page 97: Slides chi2011

Giant Global Graph

And when all resources are described this way,the Web becomes one giant database...

18

Page 98: Slides chi2011

Giant Global Graph

And when all resources are described this way,the Web becomes one giant database...

18

Page 99: Slides chi2011

Giant Global Graph

And when all resources are described this way,the Web becomes one giant database...

18

Page 100: Slides chi2011

Giant Global Graph

And when all resources are described this way,the Web becomes one giant database...

18

Page 101: Slides chi2011

Giant Global Graph

And when all resources are described this way,the Web becomes one giant database...

18

Page 102: Slides chi2011

Giant Global Graph

18

Page 103: Slides chi2011

SPARQL

Find and retrieve information from the graph

19

Page 104: Slides chi2011

SPARQL

Find and retrieve information from the graph

19

Page 105: Slides chi2011

SPARQL

Find and retrieve information from the graph

19

Page 106: Slides chi2011

SPARQL

Find and retrieve information from the graph

19

Page 107: Slides chi2011

SPARQL

Find and retrieve information from the graph

19

Page 108: Slides chi2011

SPARQL

Find and retrieve information from the graph

19

Page 109: Slides chi2011

SPARQL

Find and retrieve information from the graph

19

Page 110: Slides chi2011

SPARQL

Find and retrieve information from the graphusing SQL?

19

Page 111: Slides chi2011

SPARQL

Find and retrieve information from the graph

19

Page 112: Slides chi2011

SPARQL

Find and retrieve information from the graphusing SPARQL

19

Page 113: Slides chi2011

The Semantic Web

20

Page 114: Slides chi2011

The Semantic Web

Machine Understandable

20

Page 115: Slides chi2011

The Semantic Web

RDF

Machine Understandable

20

Page 116: Slides chi2011

The Semantic Web

RDF

Machine UnderstandableLinked Data

20

Page 117: Slides chi2011

The Semantic Web

RDF

Machine UnderstandableLinked Data

SPARQL

20

Page 118: Slides chi2011

The Semantic Web

RDF

Machine UnderstandableLinked Data

SPARQLFederated Dataset

20

Page 119: Slides chi2011

The Semantic Web

RDF

Machine UnderstandableLinked Data

SPARQLFederated DatasetGiant

GlobalGraph

20

Page 120: Slides chi2011

Why Drupal?

21

Page 121: Slides chi2011

Why Drupal?

Similarities

21

Page 122: Slides chi2011

Why Drupal?

Similarities

•Both have structured data

21

Page 123: Slides chi2011

Why Drupal?

Similarities

•Both have structured data

•Data is structured in a similar way—instances of types with properties and relationships

21

Page 124: Slides chi2011

Why Drupal?

22

Page 125: Slides chi2011

Why Drupal?

Differences

22

Page 126: Slides chi2011

Why Drupal?

Differences

•Drupal’s structure stays hidden in the database, RDF structure is exposed on the page

22

Page 127: Slides chi2011

Why Drupal?

Differences

•Drupal’s structure stays hidden in the database, RDF structure is exposed on the page

•Drupal’s field names are unique to the site and not explicitly defined,RDF terms are universally dereferencable and explicitly defined

22

Page 128: Slides chi2011

RDF in Drupal 7 core

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="XHTML+RDFa 1.0" xml:lang="en">

<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Lin-Clark | Pittsburgh-based Web developer</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/admin_menu/admin_menu.css?8" /><link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/views/css/views.css?8" /><link type="text/css" rel="stylesheet" media="all" href="/sites/default/files/css/css_92e513ffd2110f82d787173e8b07d9c7.css" /><link type="text/css" rel="stylesheet" media="print" href="/sites/default/files/css/css_9c70a5072a56f4bc83a718ec42481c1a.css" /><!--[if IE]><link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/zen/zen/ie.css?8" /><![endif]--> <script type="text/javascript" src="/sites/default/files/js/js_f68bf536b867998e80bb0bd586727a4a.js"></script><script type="text/javascript"><!--//--><![CDATA[//><!--jQuery.extend(Drupal.settings, { "basePath": "/", "admin_menu": { "margin_top": 1, "position_fixed": 1 }, "cobalt": { "state": "1", "path": "node/33", "bindings": [ "Alt+space", "Ctrl+space" ], "nodes_current": "33" }, "googleanalytics": { "trackOutgoing": 1, "trackMailto": 1, "trackDownload": 1, "trackDownloadExtensions": "7z|aac|avi|csv|doc|exe|flv|gif|gz|jpe?g|js|mp(3|4|e?g)|mov|pdf|phps|png|ppt|rar|sit|tar|torrent|txt|wma|wmv|xls|xml|zip" }, "jcarousel": { "#viewscarousel-Site-Screenshots-block-1": { "scroll": 1, "visible": 1, "animation": "slow", "auto": 6, "wrap": "both", "skin": "ie7" } } });//--><!]]></script></head><body class="front logged-in node-type-page one-sidebar sidebar-right">

<div id="page"><div id="page-inner"><a id="navigation-top"></a> <div id="header"><div id="header-inner" class="clear-block">

23

Page 129: Slides chi2011

RDF in Drupal 7 core

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="XHTML+RDFa 1.0" xml:lang="en">

<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Lin-Clark | Pittsburgh-based Web developer</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/admin_menu/admin_menu.css?8" /><link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/views/css/views.css?8" /><link type="text/css" rel="stylesheet" media="all" href="/sites/default/files/css/css_92e513ffd2110f82d787173e8b07d9c7.css" /><link type="text/css" rel="stylesheet" media="print" href="/sites/default/files/css/css_9c70a5072a56f4bc83a718ec42481c1a.css" /><!--[if IE]><link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/zen/zen/ie.css?8" /><![endif]--> <script type="text/javascript" src="/sites/default/files/js/js_f68bf536b867998e80bb0bd586727a4a.js"></script><script type="text/javascript"><!--//--><![CDATA[//><!--jQuery.extend(Drupal.settings, { "basePath": "/", "admin_menu": { "margin_top": 1, "position_fixed": 1 }, "cobalt": { "state": "1", "path": "node/33", "bindings": [ "Alt+space", "Ctrl+space" ], "nodes_current": "33" }, "googleanalytics": { "trackOutgoing": 1, "trackMailto": 1, "trackDownload": 1, "trackDownloadExtensions": "7z|aac|avi|csv|doc|exe|flv|gif|gz|jpe?g|js|mp(3|4|e?g)|mov|pdf|phps|png|ppt|rar|sit|tar|torrent|txt|wma|wmv|xls|xml|zip" }, "jcarousel": { "#viewscarousel-Site-Screenshots-block-1": { "scroll": 1, "visible": 1, "animation": "slow", "auto": 6, "wrap": "both", "skin": "ie7" } } });//--><!]]></script></head><body class="front logged-in node-type-page one-sidebar sidebar-right">

<div id="page"><div id="page-inner"><a id="navigation-top"></a> <div id="header"><div id="header-inner" class="clear-block">

23

Page 130: Slides chi2011

Universities in RDFRDF in Drupal 7 core

Submitted by Lin on Sat, 2009-05-02 10:28

24

Page 131: Slides chi2011

Universities in RDFRDF in Drupal 7 core

Submitted by Lin on Sat, 2009-05-02 10:28

<div class="submitted"> Submitted by <a href="/user/1">Lin</a> on Sat, 2009-05-02 10:28</div>

24

Page 132: Slides chi2011

Universities in RDFRDF in Drupal 7 core

Submitted by Lin on Sat, 2009-05-02 10:28

24

Page 133: Slides chi2011

Universities in RDFRDF in Drupal 7 core

Submitted by Lin on Sat, 2009-05-02 10:28

<div class="submitted"> Submitted by <span rel="sioc:has_creator"><a href="/user/1">Lin</a></span> on Sat, 2009-05-02 10:28</div>

24

Page 134: Slides chi2011

Universities in RDFRDF in Drupal 7 core

Submitted by Lin on Sat, 2009-05-02 10:28

24

Page 135: Slides chi2011

Universities in RDFRDF in Drupal 7 core

Submitted by Lin on Sat, 2009-05-02 10:28

<div class="submitted"> Submitted by <span rel="sioc:has_creator"><a href="/user/1" typeof="sioc:User" property="foaf:name">Lin</a></span> on Sat, 2009-05-02 10:28</div>

24

Page 136: Slides chi2011

?25

Page 137: Slides chi2011

25

Page 138: Slides chi2011

25

Page 139: Slides chi2011

Microformats

26

Page 140: Slides chi2011

Microformats

Bring structured data to HTML

26

Page 141: Slides chi2011

Microformats

Bring structured data to HTML

26

Page 142: Slides chi2011

Microformats

Bring structured data to HTML

Limitations

26

Page 143: Slides chi2011

Microformats

Bring structured data to HTML

Limitations

•Not extensible — if your use case doesn’t match the existing formats, you can’t make your own

26

Page 144: Slides chi2011

Microformats

Bring structured data to HTML

Limitations

•Not extensible — if your use case doesn’t match the existing formats, you can’t make your own

•Not scopable — properties set on child elements get misinterpreted as properties of parents

26

Page 145: Slides chi2011

RDFa and Microdata

27

Page 146: Slides chi2011

RDFa and Microdata

RDFa

27

Page 147: Slides chi2011

RDFa and Microdata

RDFa

•about

27

Page 148: Slides chi2011

RDFa and Microdata

RDFa

•about

•property, rel

27

Page 149: Slides chi2011

RDFa and Microdata

RDFa

•about

•property, rel

•typeof

27

Page 150: Slides chi2011

RDFa and Microdata

RDFa

•about

•property, rel

•typeof

Microdata

27

Page 151: Slides chi2011

RDFa and Microdata

RDFa

•about

•property, rel

•typeof

Microdata

• itemid

27

Page 152: Slides chi2011

RDFa and Microdata

RDFa

•about

•property, rel

•typeof

Microdata

• itemid

• itemprop

27

Page 153: Slides chi2011

RDFa and Microdata

RDFa

•about

•property, rel

•typeof

Microdata

• itemid

• itemprop

• itemtype

27

Page 154: Slides chi2011

RDFa and Microdata

RDFa

•about

•property, rel

•typeof

Microdata

• itemid

• itemprop

• itemtype

27

Page 155: Slides chi2011

A closer look at the RDF that Drupal 7 includes out of the box

28

Page 156: Slides chi2011

RDF for free in Drupal 7•All entity types:

node comment

user file

term vocabulary

29

Page 157: Slides chi2011

RDF for free in Drupal 7•Attributes:

title date (created, updated)

all fields* comment count

reply of (comment) creator

* provided a mapping has been defined for it

30

Page 158: Slides chi2011

Drupal 7 entities “cool URIs”•All entities have their own URI

•node/3

•comment/6#comment-6

•user/2

•taxonomy/term/5

http://www.w3.org/TR/cooluris/31

Page 159: Slides chi2011

Drupal 7 RDFa goodness•FOAF, SIOC, SKOS, DC “out of the box”

•All users have a WebID URI

user/3#me => foaf:Person

32

Page 160: Slides chi2011

Drupal 7 default mappings

nodesioc:Item,

foaf:Document

titledc:title

creation datedc:created, dc:date

bodycontent:encoded

usersioc:UserAccount

sioc:has_creator

user name

termskos:Concept

dc:subject

descriptionskos:definition

nameskos:prefLabel,rdfs:label

foaf:name

commentsioc:Post,

sioct:Comment

sioc:reply_of

sioc:reply_of

modification datedc:modified

number repliessioc:num_replies

vocabularyskos:Concept

Scheme

skos:inScheme

skos:broader

term descriptionrdfs:comment

namedc:title

homepage

foaf:page

titledc:title

creation datedc:created, dc:date

bodycontent:encoded

modification datedc:modified

sioc:has_creator

33

Page 161: Slides chi2011

RDFa demo: how machines see Drupal pages

•Ubiquity RDFa

•Sig.ma - Semantic Information Mashup

http://ubiquity-rdfa.googlecode.com/svn/trunk/ubiquity-loader.js

34

Page 162: Slides chi2011

35

Page 163: Slides chi2011

History of Semantics in Drupal•rdf.php (2000, Dries)

•FOAF, vCard (2004, walkah)

•Relationship (2005, dman)

•Semantic Search (2006, hendler)

36

Page 164: Slides chi2011

History of Semantics in Drupal•RDF (2007, Arto)

•OpenCalais (febbraro, 2008)

•RDF CCK (2008, scor)

•and more...

37

Page 165: Slides chi2011

RDF in Drupal 7 - the story so far

38

Page 166: Slides chi2011

May 2009DERI, Galway

RDF in Drupal 7 - the story so far

39

Page 167: Slides chi2011

RDF in Drupal 7 - the story so far•61 issues in total

•11 months of coding

•401 lines of code

•372 lines of documentation

•537 lines of tests

40

Page 168: Slides chi2011

RDFa growth

•fastest growing data format on the Web

•3.6% of the pages in the Web

•510% growth in the last year

http://tripletalk.wordpress.com/2011/01/25/rdfa-deployment-across-the-web/41

Page 169: Slides chi2011

http://rdfa.info/2009/12/11/best-buy-and-rdfa/

RDFa and e-Commerce: BestBuy•GoodRelations

•30 % percent increase in traffic

•Yahoo observes a 15% increase in the Click-through-Rate

42

Page 170: Slides chi2011

Why RDF and RDFa?•W3C standards

•BBC, New York Times, Reuters, Facebook

•Google, Yahoo!

43

Page 171: Slides chi2011

RDF in contrib

44

Page 172: Slides chi2011

RDF in contribRDF Mapping User Interface for site administrators to customize mappings

44

Page 173: Slides chi2011

RDF in contrib

45

Page 174: Slides chi2011

SPARQL Endpoint: anyone can query your site data with SPARQL queries

RDF in contrib

45

Page 175: Slides chi2011

SPARQL Endpoint: anyone can query your site data with SPARQL queries

Figure 3.6: A list of SPARQL results (left) and an RDF SPARQL Proxy profile form(right).

a vocabulary page containing some general information about the vocabulary, followedby the descriptions of all its classes and properties.

Editor. After a vocabulary maintainer logs in, additional links become visible onthe vocabulary page and allow adding new terms, as well as editing of existing terms.Terms are created and edited through a web form (Figure 3.8). The form allows entryof an ID (to become part of the term’s URI), label, comment, subclasses, subproperties,domain, range, disjoint classes, inverse properties, and marking a property as functionalor inverse functional. Authenticated users can also create new vocabularies and modifythe vocabulary metadata.

RDFS output, URIs and content negotiation. The URIs identifying classes andproperties are always generated by appending the hash character and the term’s ID tothe URI of the vocabulary page. This makes sure that the vocabulary page is returnedwhen these URIs are resolved. HTTP requests to the vocabulary page are subject tocontent negotiation. Web browsers will see the HTML variant shown in Figure 3.7.RDF-aware clients will receive the RDFS/OWL specification, either in RDF/XML orN3 syntax. In a nutshell, Neologism publishes standards-compliant vocabularies on theWeb without requiring any additional effort on the part of vocabulary maintainers.

Implementation. Neologism is implemented in PHP as a Drupal module. Drupalreduces development time by providing many features for free, such as account man-agement, database abstraction layer and content managemement. It also makes inte-gration with a larger Drupal-based site very easy, for example to provide a news blogand discussion forum for each vocabulary built with Neologism. All data is stored ina MySQL database. RAP13 is used to serialize RDF/XML and N3. The PHP ContentNegotiation library14 is used instead of the usual Apache rules to implement contentnegotiation, and Vapour15 was used to validate its correctness. The overview diagram

13http://www4.wiwiss.fu-berlin.de/bizer/rdfapi/14http://ptlis.net/source/php-content-negotiation/15http://vapour.sourceforge.net/

43

RDF in contrib

45

Page 176: Slides chi2011

What’s coming up

RDF in contrib

46

Page 177: Slides chi2011

What’s coming upSPARQL Views: A way of connecting to external RDF sources and displaying the results within the context of your site, using different styles as appropriate.

RDF in contrib

46

Page 178: Slides chi2011

What’s coming upSPARQL Views: A way of connecting to external RDF sources and displaying the results within the context of your site, using different styles as appropriate.

my-site.net your-site.orgcompany.com

RDF in contrib

46

Page 179: Slides chi2011

RDF in Drupal 7 for developershttp://api.drupal.org/api/group/rdf/7

47

Page 180: Slides chi2011

RDF namespaces declaration

48

Page 181: Slides chi2011

3 ways to set RDF mappings1. Entity type level defaults:

hook_rdf_mappings() 'bundle' => RDF_DEFAULT_BUNDLE,

2. Content type / bundle level override:

hook_rdf_mappings() 'bundle' => my_content_type,

3. Alter mappings for existing bundles:

rdf_mapping_save()

49

Page 182: Slides chi2011

Entity type level RDF mappings

50

Page 183: Slides chi2011

Entity type level RDF mappings

nodesioc:Item,

foaf:Document

titledc:title

creation datedc:created, dc:date

bodycontent:encoded

usersioc:UserAccount

sioc:has_creator

user name

termskos:Concept

dc:subject

descriptionskos:definition

nameskos:prefLabel,rdfs:label

foaf:name

commentsioc:Post,

sioct:Comment

sioc:reply_of

sioc:reply_of

modification datedc:modified

number repliessioc:num_replies

vocabularyskos:Concept

Scheme

skos:inScheme

skos:broader

term descriptionrdfs:comment

namedc:title

homepage

foaf:page

titledc:title

creation datedc:created, dc:date

bodycontent:encoded

modification datedc:modified

sioc:has_creator

51

Page 184: Slides chi2011

Content type / bundle level RDF mappings

52

Page 185: Slides chi2011

Content type / bundle level RDF mappings

53

Page 186: Slides chi2011

Custom mappings with rdf_mapping_save()

54

Page 187: Slides chi2011

Custom mappings with rdf_mapping_save()

55

Page 188: Slides chi2011

Drupal 7 RDFa internals•Mappings cached with entity info (fast)

•RDFa markup added via the theme layer. Impacts performance on pages with many comments: turn on page cache.

56

Page 189: Slides chi2011

CreditsMark Birbeck

Alex Bronstein

John Breslin

Benjamin Doherty

Stefan Freudenberg

Rolf Guescini

Daniel F. Kudwien

Florian Lorétan

Frédéric Marand

Benjamin Melançon

John Morahan

Dries Buytaert

Angie Byron

catch

chx

Peter Wolanin

Barry Jaspan

yched

Christopher Ruppel

Kanok Ausawawaranun

John Breslin

Scriptall

cocoate

Frank Febbraro

Dirk Ruediger

Lin Clark

Prometheus

William Hayes

Christopher Albrecht

Roundabout Publications

Aris Vidalis

Gerard Roos

Ludovico Fischer

Johannes Keizer

Hobury

Benjamin Doherty

Giorgos Kontopoulos

Thomas Speer

Łukasz Kowalski

Raul Pedro Fernandes Santos

Alexander Langer

Robert Douglass

Rob Loach

Andrew Kennedy

Knud Möller

Udo Gerhards

Kevin Bridges

Peter Galiba

57

Page 190: Slides chi2011

Sponsored by

58

Page 191: Slides chi2011

http://cph2010.drupal.org/node/14733

59