introduction to-the-semantic-web

55
>oai mp>2004-05-1 c>Picture</setSpec> r> ata> c:dc xmlns:oai_dc="http://www.openarchives.org/OA rg/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLS chemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http:// w.openarchives.org/OAI/2.0/oai_dc.xsd"> :title>Sydney Harbour Bridge, [ca. 1932, 3] [picture]</dc:title> c:publisher>[ca. 1932]</dc:publisher> dc:format>1 photograph : b&amp;w ; 6.6 x 8.9 cm.</dc:format> dc:coverage>New South Wales</dc:coverage> <dc:coverage>1932</dc:coverage> <dc:date>1932</dc:date> <dc:description>Part of collection: Album of photographs of the Sydney Harbour Bridge during construction.; Also available in an electronic version via the Internet at: http://nla.gov.au/nla.pic- vn3078298.</dc:description> <dc:subject>Bridges -- New South Wales -- Sydney -- Photographs.</dc:subject> <dc:subject>Sydney Harbour Bridge (Sydney, N.S.W.) -- Photographs.</dc:subject> <dc:type>Image</dc:type>< dc:relation>Part of: Album of photographs of the Sydney Harbour Bridge during construction [picture].</dc:relation> <dc:identifier>nla.pic-vn3078298</dc:identifier> <dc:source>Item held by National Library of Australia</dc:source> <dc:rights>You may save or print this image for research and study. If you wish to use it for any other purposes, you must contact the &lt;a href=&quot;http://www.nla.gov.au/digicoll/ copyright.html&quot;&gt;National Library of Australia&lt;/a&gt; to request permission.</ dc:rights> fier>http://nla.gov.au/nla.pic-vn3078298</dc:identifier> Web 3.0, an introduction to the semantic web @paulhagon

Upload: hugueins-yanez-rueda

Post on 10-Jun-2015

440 views

Category:

Education


2 download

DESCRIPTION

El presente archivo contiene informacion de la Web Semántica

TRANSCRIPT

Page 1: Introduction to-the-semantic-web

<record>

<header>

<identifier>oai:nla.gov.au:nla.pic-vn3078298</identifier>

<datestamp>2004-05-13T00:16:10Z</datestamp>

<setSpec>Picture</setSpec>

</header>

<metadata>

<oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/

purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance

xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://

www.openarchives.org/OAI/2.0/oai_dc.xsd">

<dc:title>Sydney Harbour Bridge, [ca. 1932, 3] [picture]</dc:title>

<dc:publisher>[ca. 1932]</dc:publisher>

<dc:format>1 photograph : b&amp;w ; 6.6 x 8.9 cm.</dc:format>

<dc:coverage>New South Wales</dc:coverage>

<dc:coverage>1932</dc:coverage>

<dc:date>1932</dc:date>

<dc:description>Part of collection: Album of photographs of the Sydney Harbour Bridge during

construction.; Also available in an electronic version via the Internet at: http://nla.gov.au/nla.pic-

vn3078298.</dc:description>

<dc:subject>Bridges -- New South Wales -- Sydney -- Photographs.</dc:subject>

<dc:subject>Sydney Harbour Bridge (Sydney, N.S.W.) -- Photographs.</dc:subject>

<dc:type>Image</dc:type><

dc:relation>Part of: Album of photographs of the Sydney Harbour Bridge during construction

[picture].</dc:relation>

<dc:identifier>nla.pic-vn3078298</dc:identifier>

<dc:source>Item held by National Library of Australia</dc:source>

<dc:rights>You may save or print this image for research and study. If you wish to use it for

any other purposes, you must contact the &lt;a href=&quot;http://www.nla.gov.au/digicoll/

copyright.html&quot;&gt;National Library of Australia&lt;/a&gt; to request permission.</

dc:rights>

<dc:identifier>http://nla.gov.au/nla.pic-vn3078298</dc:identifier>

Web 3.0, an introduction to the semantic web

@paulhagon

Page 2: Introduction to-the-semantic-web

http://www4.wiwiss.fu-berlin.de/bizer/pub/lod-datasets_2009-03-05_colored.pngSemantic web, you probably see diagrams that make no sense like this.

Page 3: Introduction to-the-semantic-web

OWL

SPARQLRDF

TRIPLES

PREDICATES

CURIE

Lots & lots of confusing scary acronyms

Page 4: Introduction to-the-semantic-web

Web 1.01993

Hyperlinks, static, consumption

It’s worth going back in history. Web 1.0 was static. Publishers built things & people came & read them.

Page 5: Introduction to-the-semantic-web

Web 2.02004

2 way, interactive, producing, social

Web 2.0 - social web. People became the publishers, websites became the mechanism to allow people to connect (Flickr, Twitter, Facebook, Wikipedia).

Page 6: Introduction to-the-semantic-web

Web 3.0~2010

Semantic, machine driven

Web 3.0 - semantic, machine to machine, putting meaning behind the structure/content of websites.

Page 7: Introduction to-the-semantic-web

What does semantic web mean. Lets say you do a search for a recipe on Google. Notice the search results, there’s reviews with star ratings, there is ingredient facets, cooking time facets, kilojoule facets. How does this work?

Page 8: Introduction to-the-semantic-web

Microdata, Microformats and RDFa. All methods of describing content and the relationships between content.

Page 9: Introduction to-the-semantic-web

<a href=”http://creativecommons.org/licenses/by/3.0/”> <img src=”http://i.creativecommons.org/l/by/3.0/88x31.png”></a>

Let’s look at the basic HTML structure behind these mechanisms. Something every page has - license information. This is typically marked up like this as a link. There’s no meaning to the link, it could be a link to anywhere.

Page 10: Introduction to-the-semantic-web

<a rel=”license” href=”http://creativecommons.org/licenses/by/3.0/”> <img src=”http://i.creativecommons.org/l/by/3.0/88x31.png”></a>

By adding in an attribute describing what the link is, suddenly we have turned the link from a normal link into something with some semantic meaning. This is what all of these formats do, they add in extra descriptive markup.

Page 11: Introduction to-the-semantic-web

schema.org A place that describes all the markup you can add for search engines (Google, Bing, Yahoo).

Page 12: Introduction to-the-semantic-web

At this page you can see schemas for all sorts of common things - books, maps, music, photographs, recipies, reviews, scultpure, organisations, places and more.

Page 13: Introduction to-the-semantic-web

<div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Recipe"> <h1 property="v:name">Grandma's Holiday Apple Pie</h1> <img src="apple-pie.jpg" rel="v:photo"/> By <span property="v:author">Carol Smith</span> Published: <span property="v:published" content="2009-11-05">November 5, 2009</span> <span property="v:summary">This is my grandmother's apple pie recipe. I like to add a dash of nutmeg.</span> <span rel="v:Review"> <span typeof="v:Review-aggregate"> <span rel="v:rating"> <span typeof="v:Rating"> <span property="v:average">4.0</span> stars based on <span property="v:count">35</span> reviews </span> </span> </span> </span> Prep time: <span property="v:prepTime" content="PT30M">30 min</span> Cook time: <span property="v:cookTime" content="PT1H">1 hour</span> Total time: <span property="v:totalTime" content="PT1H30M">1 hour 30 min</span> Yield: <span property="v:yield">1 9" pie (8 servings)</span> <span rel="v:nutrition"> <span typeof="v:Nutrition"> Serving size: <span property="v:servingSize">1 medium slice</span> Calories per serving: <span property="v:calories">250</span> Fat per serving: <span property="v:fat">12g</span> </span> </span> Ingredients: <span rel="v:ingredient"> <span typeof="v:Ingredient"> Thinly-sliced <span property="v:name">apples</span>: <span property="v:amount">6 cups</span> </span> </span> <span rel="v:ingredient"> <span typeof="v:Ingredient"> <span property="v:name">White sugar</span>: <span property="v:amount">3/4 cup</span> </span> </span>   ... Directions: <div property="v:instructions"> 1. Cut and peel apples 2. Mix sugar and cinnamon. Use additional sugar for tart apples. ... </div></div>

Let’s look at the HTML of the Google recipe example. This is marked up with RDFa. Don’t worry too much about the meanings yet as I’ll try to describe them all later.

Page 14: Introduction to-the-semantic-web

<div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Recipe"> <h1 property="v:name">Grandma's Holiday Apple Pie</h1> <img src="apple-pie.jpg" rel="v:photo"/> By <span property="v:author">Carol Smith</span> Published: <span property="v:published" content="2009-11-05">November 5, 2009</span> <span property="v:summary">This is my grandmother's apple pie recipe. I like to add a dash of nutmeg.</span> <span rel="v:Review"> <span typeof="v:Review-aggregate"> <span rel="v:rating"> <span typeof="v:Rating"> <span property="v:average">4.0</span> stars based on <span property="v:count">35</span> reviews </span> </span> </span> </span> Prep time: <span property="v:prepTime" content="PT30M">30 min</span> Cook time: <span property="v:cookTime" content="PT1H">1 hour</span> Total time: <span property="v:totalTime" content="PT1H30M">1 hour 30 min</span> Yield: <span property="v:yield">1 9" pie (8 servings)</span> <span rel="v:nutrition"> <span typeof="v:Nutrition"> Serving size: <span property="v:servingSize">1 medium slice</span> Calories per serving: <span property="v:calories">250</span> Fat per serving: <span property="v:fat">12g</span> </span> </span> Ingredients: <span rel="v:ingredient"> <span typeof="v:Ingredient"> Thinly-sliced <span property="v:name">apples</span>: <span property="v:amount">6 cups</span> </span> </span> <span rel="v:ingredient"> <span typeof="v:Ingredient"> <span property="v:name">White sugar</span>: <span property="v:amount">3/4 cup</span> </span> </span>   ... Directions: <div property="v:instructions"> 1. Cut and peel apples 2. Mix sugar and cinnamon. Use additional sugar for tart apples. ... </div></div>

This defines some basic information about the content of the page.

Page 15: Introduction to-the-semantic-web

<div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Recipe"> <h1 property="v:name">Grandma's Holiday Apple Pie</h1> <img src="apple-pie.jpg" rel="v:photo"/> By <span property="v:author">Carol Smith</span> Published: <span property="v:published" content="2009-11-05">November 5, 2009</span> <span property="v:summary">This is my grandmother's apple pie recipe. I like to add a dash of nutmeg.</span> <span rel="v:Review"> <span typeof="v:Review-aggregate"> <span rel="v:rating"> <span typeof="v:Rating"> <span property="v:average">4.0</span> stars based on <span property="v:count">35</span> reviews </span> </span> </span> </span> Prep time: <span property="v:prepTime" content="PT30M">30 min</span> Cook time: <span property="v:cookTime" content="PT1H">1 hour</span> Total time: <span property="v:totalTime" content="PT1H30M">1 hour 30 min</span> Yield: <span property="v:yield">1 9" pie (8 servings)</span> <span rel="v:nutrition"> <span typeof="v:Nutrition"> Serving size: <span property="v:servingSize">1 medium slice</span> Calories per serving: <span property="v:calories">250</span> Fat per serving: <span property="v:fat">12g</span> </span> </span> Ingredients: <span rel="v:ingredient"> <span typeof="v:Ingredient"> Thinly-sliced <span property="v:name">apples</span>: <span property="v:amount">6 cups</span> </span> </span> <span rel="v:ingredient"> <span typeof="v:Ingredient"> <span property="v:name">White sugar</span>: <span property="v:amount">3/4 cup</span> </span> </span>   ... Directions: <div property="v:instructions"> 1. Cut and peel apples 2. Mix sugar and cinnamon. Use additional sugar for tart apples. ... </div></div>

This describes the star ratings

Page 16: Introduction to-the-semantic-web

<div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Recipe"> <h1 property="v:name">Grandma's Holiday Apple Pie</h1> <img src="apple-pie.jpg" rel="v:photo"/> By <span property="v:author">Carol Smith</span> Published: <span property="v:published" content="2009-11-05">November 5, 2009</span> <span property="v:summary">This is my grandmother's apple pie recipe. I like to add a dash of nutmeg.</span> <span rel="v:Review"> <span typeof="v:Review-aggregate"> <span rel="v:rating"> <span typeof="v:Rating"> <span property="v:average">4.0</span> stars based on <span property="v:count">35</span> reviews </span> </span> </span> </span> Prep time: <span property="v:prepTime" content="PT30M">30 min</span> Cook time: <span property="v:cookTime" content="PT1H">1 hour</span> Total time: <span property="v:totalTime" content="PT1H30M">1 hour 30 min</span> Yield: <span property="v:yield">1 9" pie (8 servings)</span> <span rel="v:nutrition"> <span typeof="v:Nutrition"> Serving size: <span property="v:servingSize">1 medium slice</span> Calories per serving: <span property="v:calories">250</span> Fat per serving: <span property="v:fat">12g</span> </span> </span> Ingredients: <span rel="v:ingredient"> <span typeof="v:Ingredient"> Thinly-sliced <span property="v:name">apples</span>: <span property="v:amount">6 cups</span> </span> </span> <span rel="v:ingredient"> <span typeof="v:Ingredient"> <span property="v:name">White sugar</span>: <span property="v:amount">3/4 cup</span> </span> </span>   ... Directions: <div property="v:instructions"> 1. Cut and peel apples 2. Mix sugar and cinnamon. Use additional sugar for tart apples. ... </div></div>

Further down it’s marked up with times, nutritional values, ingredients, etc.

Page 17: Introduction to-the-semantic-web

So you can see from the markup, how Google can use this information to build the results page with the reviews, the facets for time, ingredients and nutritional value. If those added bits of information weren’t added into the markup this couldn’t be built. Pages that have this extra markup in them tend to rank higher in Google that pages that don’t have this specific markup in them.

Page 18: Introduction to-the-semantic-web

Let’s enter into the world of the semantic web. Now there’s lots of scary terms when you start heading down this path - Triples, predicates, SPARQL. The basics really aren’t that scary, but immensely powerful. So let’s dive into the basics of RDFa.

Page 19: Introduction to-the-semantic-web

ResourceDescriptionFrameworkattributes

RDFa

RDFa - RDF in attributes.

Page 20: Introduction to-the-semantic-web

Frank Hurley

Lets start with a subject

Page 21: Introduction to-the-semantic-web

Frank Hurley

takes

a predicate

Page 22: Introduction to-the-semantic-web

Frank Hurley

takes

photographs

and an object.

Page 23: Introduction to-the-semantic-web

Frank Hurley

takes

photographs

Subject

Predicate

Object

These three things make up a triple. with a subject, predicate & object.

Page 24: Introduction to-the-semantic-web

http://nla.gov.au/nla.pic-an25043941

Subject

You have a subject - in this case the URL of the photo

Page 25: Introduction to-the-semantic-web

http://nla.gov.au/nla.pic-an25043941

Exterior of.... -37.816068

144.961201

Museum

Objects

1961 1 negative : b&w ; 12.5 x 10.0 cm.

You have objects that are related to the subject, but they are meaningless without...

Page 27: Introduction to-the-semantic-web

Finding namespaces

One of the beauties of this system is it’s supposed to be extensible, if there isn’t an existing namespace you can write your own (yuk). You can guarantee that 15 different organisations will write 15 different versions. We’ve seen this already in the examples from schema.org, Dublin Core

Page 30: Introduction to-the-semantic-web

dc:titledc:creatordc:subjectdc:coveragedc:relationdc:identifierdc:rightsdc:type...

So we can fill in the blanks for all of these bits of information

Page 31: Introduction to-the-semantic-web

foaf:personfoaf:knowsfoaf:isPrimaryTopicOf

In addition, we can also mark it up using other schemes, so people can be marked up with their relationships.

Page 32: Introduction to-the-semantic-web

Let’s have a look at Flickr. With Flickr you can add tags, to help describe the image. If you add in tags in a special format they are known as machine tags.

Page 33: Introduction to-the-semantic-web

Now “machine tags” are a special type of tag. They actually start to describe the image & provide extra information. In this case geo:lat= something geo:lon= something. However, they don’t actually link to a description, so although they copy, there isn’t quite the same degree of semantic structure to them.

Page 34: Introduction to-the-semantic-web

In the library world we typically have a MARC record as our master record. Very ugly, but very structured. Fields with all their arcane subfields, each is defined and has a distinct meaning.

Page 35: Introduction to-the-semantic-web

We sometimes transpose that data into other formats. This is an export of our data from our OAI-PMH interface & you can see that it’s in XML & it’s rich, everything has a value, it conforms to a standard structure - Dublin Core. Compared to MARC it’s a bit more human readable.

Page 36: Introduction to-the-semantic-web

We then take this information and present it on the web in HTML. But if we look at a web page, this rich markup is lost. In our HTML we have basic markup that Gives a bit of weight to various parts of the page.

Page 37: Introduction to-the-semantic-web

H1

We have an H1 tag that gives some weight to the most important thing on the page - the title.

Page 38: Introduction to-the-semantic-web

H1

TH TD

We mark up the rest of the information in a table. There’s an implied relationship between the table headings and the table data, but we’re not saying what that relationship is. It could be anything.

Page 39: Introduction to-the-semantic-web

At a basic machine level, there really isn’t a lot that is describing these elements and there isn’t anything that makes these specific.

Page 40: Introduction to-the-semantic-web

<div><h1>[Sydney Harbour scene with naval vessels in foreground, and Harbour Bridge in distance] [picture] /</h1><table> <tr> <th>Date</th> <td>[between 1910 and 1962]</td> </tr> <tr> <th>Format</th> <td>1 negative : acetate, b&w ; 8.7 x 12.1 cm.</td> </tr> <tr> <th>Online Versions</th> <td>http://nla.gov.au/nla.pic-an23417397</td> </tr></table></div>

In this case it’s a table. there is an implicit relationship between the table header & the table data

Page 41: Introduction to-the-semantic-web

<div about="http://nla.gov.au/nla.pic-an23417397"><h1>[Sydney Harbour scene with naval vessels in foreground, and Harbour Bridge in distance] [picture] /</h1><table> <tr> <th>Date</th> <td>[between 1910 and 1962]</td> </tr> <tr> <th>Format</th> <td>1 negative : acetate, b&w ; 8.7 x 12.1 cm.</td> </tr> <tr> <th>Online Versions</th> <td>http://nla.gov.au/nla.pic-an23417397</td> </tr></table></div>

<!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:dc="http://purl.org/dc/elements/1.1/" xmlns:foaf="http://xmlns.com/foaf/0.1/">

Let’s start to use RDFa to start to build specific relationships on the page. Let’s start with our subject.

Page 42: Introduction to-the-semantic-web

<div about="http://nla.gov.au/nla.pic-an23417397"><h1 property="dc:title">[Sydney Harbour scene with naval vessels in foreground, and Harbour Bridge in distance] [picture] /</h1><table> <tr> <th>Date</th> <td property="dc:date">[between 1910 and 1962]</td> </tr> <tr> <th>Format</th> <td property="dc:format">1 negative : acetate, b&w ; 8.7 x 12.1 cm.</td> </tr> <tr> <th>Online Versions</th> <td property="dc:identifier">http://nla.gov.au/nla.pic-an23417397</td> </tr></table></div>

<!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:dc="http://purl.org/dc/elements/1.1/" xmlns:foaf="http://xmlns.com/foaf/0.1/">

Predicates as attributes

Page 43: Introduction to-the-semantic-web

<div about="http://nla.gov.au/nla.pic-an23417397"><h1 property="dc:title">[Sydney Harbour scene with naval vessels in foreground, and Harbour Bridge in distance] [picture] /</h1><table> <tr> <th>Date</th> <td property="dc:date">[between 1910 and 1962]</td> </tr> <tr> <th>Format</th> <td property="dc:format">1 negative : acetate, b&w ; 8.7 x 12.1 cm.</td> </tr> <tr> <th>Online Versions</th> <td property="dc:identifier">http://nla.gov.au/nla.pic-an23417397</td> </tr></table></div>

<!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:dc="http://purl.org/dc/elements/1.1/" xmlns:foaf="http://xmlns.com/foaf/0.1/">

And the objects are the values marked up within the tags.

Page 44: Introduction to-the-semantic-web

This is a little geo-explorer application I built. The underlying code has been built incorporating RDFa. As you can see visually, it looks just like any normal webpage, there is nothing special about it.

Page 45: Introduction to-the-semantic-web

By using a Firefox plugin (Fuzz) I can see the underlying semantic structure that exists beyond the visual - what a machine would see.

Page 46: Introduction to-the-semantic-web

http://nla.gov.au/nla.pic-an25043941

Exterior of.... -37.816068

144.961201

MuseumTitle

Latitude

Longitude

Coverage

RDF

Person

Creator

http://nla.gov.au/nla.party-558817

Sievers, Wolfgang TypeOf

isPrimaryTopicOf

It’s a bit easier to see the semantic relationships as a graph. You’ll often see this sort of representation of semantics. You’ll notice that there’s now semantic linkages between 2 different URL’s - neat.

Page 47: Introduction to-the-semantic-web

OWLWeb Ontology language

Used to describe the meanings of terms in vocabularies and the relationships between the terms. Used for applications rather than

human presentation.

OWL - complex rules defining the properties.

Page 48: Introduction to-the-semantic-web

SPARQL

Sparql. SQL for RDF.

Page 49: Introduction to-the-semantic-web

PREFIX abc: <http://example.com/exampleOntology#>SELECT ?capital ?countryWHERE { ?x abc:cityname ?capital ; abc:isCapitalOf ?y . ?y abc:countryname ?country ; abc:isInContinent abc:Africa .}

http://en.wikipedia.org/wiki/SPARQL

What are the capital cities in countries within Africa?

An example query that returns all the capital cities in countries within Africa. You might want to query all the books that were published by a company where the authors were born in Melbourne.

Page 50: Introduction to-the-semantic-web

Markup HTML using RDFa

Provide RDF output in API’s

What can libraries start to do? This leads to data reuse, mashups, applications. Increased Google rank.

Page 51: Introduction to-the-semantic-web

Use external resources such as dbpedia.org - Community effort to extract data from wikipedia & make it available. This is entering the world of linked data.

Page 52: Introduction to-the-semantic-web

See the different spellings of Canberra - we don’t need to know all of these, but can extract them from other resources - linked data.

Page 53: Introduction to-the-semantic-web

For further info, there’s a couple of really good presentations from Sir Tim Berners-Lee on TED

Page 54: Introduction to-the-semantic-web

Thanks!

Thank you.