introduction to-the-semantic-web

Post on 10-Jun-2015

442 Views

Category:

Education

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

El presente archivo contiene informacion de la Web Semántica

TRANSCRIPT

<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

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.

OWL

SPARQLRDF

TRIPLES

PREDICATES

CURIE

Lots & lots of confusing scary acronyms

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.

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

Web 3.0~2010

Semantic, machine driven

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

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?

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

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

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

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

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

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

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

<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

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

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.

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.

ResourceDescriptionFrameworkattributes

RDFa

RDFa - RDF in attributes.

Frank Hurley

Lets start with a subject

Frank Hurley

takes

a predicate

Frank Hurley

takes

photographs

and an object.

Frank Hurley

takes

photographs

Subject

Predicate

Object

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

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

Subject

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

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

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

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

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

foaf:personfoaf:knowsfoaf:isPrimaryTopicOf

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

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.

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.

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.

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.

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.

H1

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

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.

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.

<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

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

<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

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

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.

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

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.

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.

SPARQL

Sparql. SQL for RDF.

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.

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.

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.

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

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

Thanks!

Thank you.

phagon@nla.gov.au@paulhagon

Thanks!

Thank you.

top related