multi-agent semantic web systems: rdfa · perspective 1:this is a regular web page,but hey,we can...

22
. . . . . . . . . Multi-agent Semantic Web Systems: RDFa Michael Rovatsos School of Informatics 21 February 2011 Michael Rovatsos (School of Informatics) Multi-agent Semantic Web Systems:RDFa 21 February 2011 1 / 22

Upload: others

Post on 14-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Multi-agent Semantic Web Systems: RDFa · Perspective 1:This is a regular web page,but hey,we can get semantics out of it. Perspective 2:This is machine-readable data,but hey,humans

. . . . . .

.

.

. ..

.

.

Multi-agent Semantic Web Systems:RDFa

Michael Rovatsos

School of Informatics

21 February 2011

Michael Rovatsos (School of Informatics) Multi-agent Semantic Web Systems:RDFa 21 February 2011 1 / 22

Page 2: Multi-agent Semantic Web Systems: RDFa · Perspective 1:This is a regular web page,but hey,we can get semantics out of it. Perspective 2:This is machine-readable data,but hey,humans

. . . . . .

.. .1 Intro to Microformats

.. .2 RDFa

Michael Rovatsos (School of Informatics) Multi-agent Semantic Web Systems:RDFa 21 February 2011 2 / 22

Page 3: Multi-agent Semantic Web Systems: RDFa · Perspective 1:This is a regular web page,but hey,we can get semantics out of it. Perspective 2:This is machine-readable data,but hey,humans

. . . . . .

Review

RDF(S) implements part of the vision of the SemWeb:

Obtaining network effect for SemWeb requires overcoming the ’Semanticmarkup bottleneck’.Promising approaches:

I Using NLP to convert unstructured information into RDF(S)I Microformats / RDFa for embedding RDF into web documentsI Exporting from RDBs to RDF stores.

Michael Rovatsos (School of Informatics) Multi-agent Semantic Web Systems:RDFa 21 February 2011 3 / 22

Page 4: Multi-agent Semantic Web Systems: RDFa · Perspective 1:This is a regular web page,but hey,we can get semantics out of it. Perspective 2:This is machine-readable data,but hey,humans

. . . . . .

Semantic Markup Embedded in HTML, 1

Existing document web is firmly established — can we use this base tosupport semantic applications?

General idea: embed semantic markup into existing (X)HTML tags.

.Example: hCard.... ..

.

.<span class="tel">0131 650-1234</span>

.Example: RDFa.... ..

.

.<span property="foaf:phone">0131 650-1234</span>

Perspective 1: This is a regular web page, but hey, we can get semantics outof it.

Perspective 2: This is machine-readable data, but hey, humans can browseit just like the Good Old Document Web.

Michael Rovatsos (School of Informatics) Multi-agent Semantic Web Systems:RDFa 21 February 2011 4 / 22

Page 5: Multi-agent Semantic Web Systems: RDFa · Perspective 1:This is a regular web page,but hey,we can get semantics out of it. Perspective 2:This is machine-readable data,but hey,humans

. . . . . .

Semantic Markup Embedded in HTML, 2

Approach is best-suited to information which fits into familiar andfrequently used categories, e.g., contact information, calendar events,geo-location information, product reviews, social network information.Why do we need more than existing HTML tags?

I In fact, has been explored: cf. “screen scraping”, “wrapper induction”I But traditional HTML tags primarily oriented towards visual rendering.

Michael Rovatsos (School of Informatics) Multi-agent Semantic Web Systems:RDFa 21 February 2011 5 / 22

Page 6: Multi-agent Semantic Web Systems: RDFa · Perspective 1:This is a regular web page,but hey,we can get semantics out of it. Perspective 2:This is machine-readable data,but hey,humans

. . . . . .

Semantic Markup Embedded in HTML, 3

What about HTML’s META tag?.META in Informatics Web Page..

.

. ..

.

.

<META NAME="DC.Creator" CONTENT="Manuel Pita"><META NAME="DC.Creator.Address" CONTENT="[email protected]"><META NAME="DC.Publisher" CONTENT="School of Informatics, ...">

But:

META information is invisible to humans

Tends to fall out of synchronization with visible content

Has been abused by people concerned with SEO

(and therefore can actually harm your Google rank).

Michael Rovatsos (School of Informatics) Multi-agent Semantic Web Systems:RDFa 21 February 2011 6 / 22

Page 7: Multi-agent Semantic Web Systems: RDFa · Perspective 1:This is a regular web page,but hey,we can get semantics out of it. Perspective 2:This is machine-readable data,but hey,humans

. . . . . .

Microformats, 3

Microformats = Semantic Web for the Impatient ?

But so far, efforts to infuse the Web with meaning have gained little traction.These initiatives have been bogged down by complexity and over-ambitiousgoals, or have simply been too much trouble to implement at a large scale.

Proponents of microformats subscribe to general idea of “web of data”,but unconvinced by RDF, OWL, etc.

Microformats intended to lower “barrier to entry” — no need to learn anew language.

Try to use visible data rather than invisible metadata.

Try to re-use existing standards / vocabularies for data modelling; e.g.,vCard, iCalendar ⇒ hCard, hCalendar.

Michael Rovatsos (School of Informatics) Multi-agent Semantic Web Systems:RDFa 21 February 2011 7 / 22

Page 8: Multi-agent Semantic Web Systems: RDFa · Perspective 1:This is a regular web page,but hey,we can get semantics out of it. Perspective 2:This is machine-readable data,but hey,humans

. . . . . .

RDFa

RDFa can be seen as a new way of serializing RDF.

RDFa = RDF_in_attributes

Integrates into XHTML, but simpler than RDF/XML.Motivation is similar to microformats, but

I more generic;I can benefit from many existing tools for processing RDF.

Two basic cases, corresponding to whether object is literal or resource.

subject predicate objectliteral as object about property PCDATA or contentURI as object about rel href

Michael Rovatsos (School of Informatics) Multi-agent Semantic Web Systems:RDFa 21 February 2011 8 / 22

Page 9: Multi-agent Semantic Web Systems: RDFa · Perspective 1:This is a regular web page,but hey,we can get semantics out of it. Perspective 2:This is machine-readable data,but hey,humans

. . . . . .

RDFa = RDF + XHTML, Case 1

element: divtext: NLP with Python

attribute: classtitle

isbn:51649-9NLP with Pythondc:title

element: divtext: NLP with Python

attribute: classtitle

attribute: aboutisbn:51649-9

attribute: propertydc:title

RDF triple

XML node tree

XML node tree+ RDFa

Michael Rovatsos (School of Informatics) Multi-agent Semantic Web Systems:RDFa 21 February 2011 9 / 22

Page 10: Multi-agent Semantic Web Systems: RDFa · Perspective 1:This is a regular web page,but hey,we can get semantics out of it. Perspective 2:This is machine-readable data,but hey,humans

. . . . . .

RDFa = RDF + XHTML, Case 1

subject

object (literal)

predicate

element: divtext: NLP with Python

attribute:classtitle

attribute:aboutisbn:51649-9

attribute:propertydc:title

Michael Rovatsos (School of Informatics) Multi-agent Semantic Web Systems:RDFa 21 February 2011 10 / 22

Page 11: Multi-agent Semantic Web Systems: RDFa · Perspective 1:This is a regular web page,but hey,we can get semantics out of it. Perspective 2:This is machine-readable data,but hey,humans

. . . . . .

RDFa, Case 1

.RDF triple.... ..

.

.isbn:51649-9 dc:title "NLP with Python" .

.XHTML..

.

. ..

.

.

<div class="title">NLP with Python</div>

.XHTML with RDFa..

.

. ..

.

.

<div class="title" about="isbn:51649-9" property="dc:title" >NLP with Python</div>

Michael Rovatsos (School of Informatics) Multi-agent Semantic Web Systems:RDFa 21 February 2011 11 / 22

Page 12: Multi-agent Semantic Web Systems: RDFa · Perspective 1:This is a regular web page,but hey,we can get semantics out of it. Perspective 2:This is machine-readable data,but hey,humans

. . . . . .

RDFa = RDF + XHTML, Case 2

element: divtext: Ewan Klein

attribute: classauthor

isbn:51649-9dc:creator

element: divtext: Ewan Klein

attribute: classauthor

attribute: aboutisbn:51649-9

attribute:reldc:creator

RDF triple

XML node tree

XML node tree+ RDFa

orm:ewan_klein

attribute: hreform:ewan_klein

Michael Rovatsos (School of Informatics) Multi-agent Semantic Web Systems:RDFa 21 February 2011 12 / 22

Page 13: Multi-agent Semantic Web Systems: RDFa · Perspective 1:This is a regular web page,but hey,we can get semantics out of it. Perspective 2:This is machine-readable data,but hey,humans

. . . . . .

RDFa = RDF + XHTML, Case 2

isbn:51649-9

dc:creator

element: divtext: Ewan Klein

attribute: classauthor

attribute: aboutisbn:51649-9

attribute:reldc:creator

orm:ewan_kleinattribute: hreform:ewan_klein

Michael Rovatsos (School of Informatics) Multi-agent Semantic Web Systems:RDFa 21 February 2011 13 / 22

Page 14: Multi-agent Semantic Web Systems: RDFa · Perspective 1:This is a regular web page,but hey,we can get semantics out of it. Perspective 2:This is machine-readable data,but hey,humans

. . . . . .

RDFa, Case 2

.RDF triple.... ..

.

.isbn:51649-9 dc:author orm:ewan_klein .

.XHTML..

.

. ..

.

.

<div class="author">Ewan Klein</div>

.XHTML with RDFa..

.

. ..

.

.

<div class="title" about="isbn:51649-9"rel="dc:creator"href="orm:ewan_klein">

Ewan Klein</div>

Michael Rovatsos (School of Informatics) Multi-agent Semantic Web Systems:RDFa 21 February 2011 14 / 22

Page 15: Multi-agent Semantic Web Systems: RDFa · Perspective 1:This is a regular web page,but hey,we can get semantics out of it. Perspective 2:This is machine-readable data,but hey,humans

. . . . . .

Cafe Web Page

Michael Rovatsos (School of Informatics) Multi-agent Semantic Web Systems:RDFa 21 February 2011 15 / 22

Page 16: Multi-agent Semantic Web Systems: RDFa · Perspective 1:This is a regular web page,but hey,we can get semantics out of it. Perspective 2:This is machine-readable data,but hey,humans

. . . . . .

Cafe Web Page, 1

.File Metadata, 1..

.

. ..

.

.

<div about=""rel="dc:creator"resource="ihp:ehk" />

Invisible in this case, so vulnerable to previous criticism.

Empty value of about refers to current document by default.

Michael Rovatsos (School of Informatics) Multi-agent Semantic Web Systems:RDFa 21 February 2011 16 / 22

Page 17: Multi-agent Semantic Web Systems: RDFa · Perspective 1:This is a regular web page,but hey,we can get semantics out of it. Perspective 2:This is machine-readable data,but hey,humans

. . . . . .

Cafe Web Page, 2

.File Metadata, 2..

.

. ..

.

.

<div class="license">All content on this site is licensed under<a rel="license"

href="http://creativecommons.org/licenses/by/3.0/">a Creative Commons License

</a>.</div>

RDFa slots easily into an a element;

other examples of SPO with URI object extrapolate from this.

Michael Rovatsos (School of Informatics) Multi-agent Semantic Web Systems:RDFa 21 February 2011 17 / 22

Page 18: Multi-agent Semantic Web Systems: RDFa · Perspective 1:This is a regular web page,but hey,we can get semantics out of it. Perspective 2:This is machine-readable data,but hey,humans

. . . . . .

Cafe Web Page, 3

.Image Metadata..

.

. ..

.

.

<img src="mmwalk.jpg" about="mmwalk.jpg"><span rel="dc:creator" href="ihp:ehk" /><span property="dc:subject"

content="View of Middle Meadow Walk" /><span rel="foaf:depicts" href="db:Edinburgh" />

</img>

Object of the Dublin Core subject relation expressed via a literal.

But no suitable PCDATA (i.e., text) daughter, so use value of contentattribute instead.

All spans that are subordinate to the img element share their parent’sspecification for about.

Michael Rovatsos (School of Informatics) Multi-agent Semantic Web Systems:RDFa 21 February 2011 18 / 22

Page 19: Multi-agent Semantic Web Systems: RDFa · Perspective 1:This is a regular web page,but hey,we can get semantics out of it. Perspective 2:This is machine-readable data,but hey,humans

. . . . . .

Cafe Web Page, 4

.Table Row, 1..

.

. ..

.

.

<tr><td>

<a about=":aroast"typeof="gr:BusinessEntity"rel="rdfs:seeAlso"href="http://www.artisanroast.co.uk/">

Artisan Roast</a>

</td>...

</tr>

Uses GoodRelations (gr prefix) ontology

Special syntax for rdf:type.

Michael Rovatsos (School of Informatics) Multi-agent Semantic Web Systems:RDFa 21 February 2011 19 / 22

Page 20: Multi-agent Semantic Web Systems: RDFa · Perspective 1:This is a regular web page,but hey,we can get semantics out of it. Perspective 2:This is machine-readable data,but hey,humans

. . . . . .

Cafe Web Page, 4

.Table Row, 2..

.

. ..

.

.

<tr typeof="v:Review"><td rel="v:itemreviewed"

href=":aroast">...

</td>...

</tr>

Makes the whole row map to a blank node subject of type v:Review.

This is a vocabulary promoted by Google (cf. link on MASWS Wiki pagefor RDFa)

We have to repeat the URI of Artisan Roast to provide object forv:itemreviewed.

Michael Rovatsos (School of Informatics) Multi-agent Semantic Web Systems:RDFa 21 February 2011 20 / 22

Page 21: Multi-agent Semantic Web Systems: RDFa · Perspective 1:This is a regular web page,but hey,we can get semantics out of it. Perspective 2:This is machine-readable data,but hey,humans

. . . . . .

Cafe Web Page, 5

.Table Row, 2..

.

. ..

.

.

<tr typeof="v:Review">...<td about=":aroast" property="v:address">

Broughton Street</td><td property="v:rating" content="5">*****</td>...

</tr>

Hierarchical structure of the table row doesn’t mesh nicely with the factthat we have two subjects:

I the reviewI the business

We use content attribute to normalize the rating literal.

Michael Rovatsos (School of Informatics) Multi-agent Semantic Web Systems:RDFa 21 February 2011 21 / 22

Page 22: Multi-agent Semantic Web Systems: RDFa · Perspective 1:This is a regular web page,but hey,we can get semantics out of it. Perspective 2:This is machine-readable data,but hey,humans

. . . . . .

Cafe Web Page, 6

.Extracted RDF..

.

. ..

.

.

<:aroast> a gr:BusinessEntity ;v:address "Broughton Street" ;rdfs:seeAlso <http://www.artisanroast.co.uk/> .

[ a v:Review ;v:itemreviewed <:aroast> ;v:rating "5" ;v:summary "Best coffee ..."].

Michael Rovatsos (School of Informatics) Multi-agent Semantic Web Systems:RDFa 21 February 2011 22 / 22