Social web & linked data

61
10/09/09 Semantic Web in Action: Web 3.0, Social Web Linked Data, Be Aware! S. Garlatti

description

ISITC Hammam SousseApril 2011

Transcript of Social web & linked data

Page 1: Social web & linked data

10/09/09

Semantic Web in Action:

Web 3.0, Social Web

Linked Data, Be Aware!

S. Garlatti

Page 2: Social web & linked data

Semantic Web in Action page 2

Outline

¢ Semantic Web ¢ Linked Data ¢ SPARQL

Page 3: Social web & linked data

Technological Issues an Informal learning case

•  I plan to ride in Europe for vacation, on a motorcycle.

–  I need to learn more about travelling on motorcycle across Europe

•  Rider’s apparel: boots, jackets, pants, gloves, armor, etc.

•  Motorcycle accessories: luggages, side cases, topcases, tank bags, GPS, etc.

•  Riding issues, skills, etc.

–  According to my social networks, I know there is a teacher at Telecom Bretagne who used to ride across Europe

page 3 Semantic Web in Action

Page 4: Social web & linked data

Who is teaching at Telecom Bretagne and riding a motorcycle across Europe?

page 4 Semantic Web in Action

Page 5: Social web & linked data

page 5

Technological Issues

•  Google Information retrieval

–  Query : « teacher » « riding » « Europe » « Motorbike »

•  613 000 results

•  How to find out relevant resources?

•  Polysemy

•  Huge number of results!

Semantic Web in Action

Page 6: Social web & linked data

Search in Telecom Bretagne Web Site

page 6 Semantic Web in Action

Page 7: Social web & linked data

Search in Motorcycle Web Sites

page 7 Semantic Web in Action

Page 8: Social web & linked data

Search in Picture Web Sites with Geolocalization

page 8 Semantic Web in Action

Page 9: Social web & linked data

page 9

Technological Issues

•  Relevance of resources?

–  Human interpretation

•  Reuse, exchange and sharing of resources

– Computer would have the ability to get content meaning!

–  impossible?

Semantic Web in Action

Page 10: Social web & linked data

Semantic Web in Action

Semantic Web

¢  The Semantic Web is a web of data.

•  There is lots of data we all use every day, and it is not part of the web.

•  I can see my bank statements on the web, and my photographs, and I can see my appointments in a calendar.

•  But can I see my photos in a calendar to see what I was doing when I took them?

•  Can I see bank statement lines in a calendar?

¢  Why not?

•  Because we don't have a web of data.

•  Because data is controlled by applications, and each application keeps it to itself.

Page 11: Social web & linked data

Semantic Web in Action page 11

Semantic Web

¢ The Semantic Web is about two things.

-  It is about common formats for integration and combination of data drawn from diverse sources

-  On the contrary, the original Web is mainly concentrated on the interchange of documents.

-  It is also about language for recording how the data relates to real world objects (meaning).

Page 12: Social web & linked data

Semantic Web in Action page 12

Semantic Web

¢ The Semantic Web

•  That allows a person, or a machine, to start off in one database, and then move through an unending set of databases which are connected not by wires but by being about the same thing.

•  Provides a common framework that allows data to be shared and reused across application, enterprise, and community boundaries

Page 13: Social web & linked data

page 13

The Semantic Web

¢ The Semantic Web is about two things.

-  It is about common formats for integration and combination of data drawn from diverse sources

-  On the contrary, the original Web is mainly concentrated on the interchange of documents.

-  It is also about language for recording how the data relates to real world objects (meaning).

Semantic Web in Action

Page 14: Social web & linked data

page 14

The Semantic Web

¢ That allows a person, or a machine, to start off in one database, and then move through an unending set of databases which are connected not by wires but by being about the same thing.

¢ Provides a common framework that allows data to be shared and reused across application, enterprise, and community boundaries

¢ The Semantic Web will enable machines to COMPREHEND semantic documents and data, not human speech and writings.

Semantic Web in Action

Page 15: Social web & linked data

Semantic Web in Action page 15

Linked Data

¢ Classic Web

•  Data exposed to the web via HTML

•  Web Pages Found via search engines

¢ What do we actually want?

•  Use the web like a Single Global Database

•  Ask Complex Queries over multiples pages / web sites / data sources

Page 16: Social web & linked data

page 16

The Semantic Web

•  Resource Description

–  Similar to simple sentence

•  Subject Verb Complement

–  Examples

•  Telecom Bretagne has a president called XXX

•  Telecom Bretagne is a French grande ecole

•  Telecom Bretagne has a web site http://www.tele...

Semantic Web in Action

Page 17: Social web & linked data

page 17

The Semantic Web

•  Sentence meaning

–  Different contexts à Different terms

•  « director », « president », « Dean », …

–  Meaning linked to communities of practices

•  Use of common vocabularies!

•  Named: Ontologies

•  An ontology determine a unique meaning to verbs and categories of subject and complement

Semantic Web in Action

Page 18: Social web & linked data

page 18

The Semantic Web

•  A little bit more formal

–  Telecom Bretagne dbpprop:president XXX (en)

–  Telecom Bretagne dbpprop:type French Grande Ecole (en)

–  Telecom Bretagne dbpprop:website http://www.tele...

•  Queries

–  French Grande Ecole in which XXX is president?

•  ?Grande_Ecole dbpprop:president XXX (en)

•  ?Grande_Ecole dbpprop:type French Grande Ecole (en)

Semantic Web in Action

Page 19: Social web & linked data

Semantic Web in Action page 19

Linked Data Who is teaching at Telecom Bretagne and riding a motorcycle across Europe?

Page 20: Social web & linked data

page 20

Linked Data

¢ Trouver Tous les films

-  Du genre « Thriller »

-  ET classés au moins quatre par

-  ET appréciés au moins par quatre de mes amis

–  OU ceux qui me suivent sur

-  ET dont Leonardo Di Caprio n’est pas un des acteurs ?

Page 21: Social web & linked data

page 21

Page 22: Social web & linked data

Computer Science Department Semantic Web in Action page 22

Web 1.0 Web 2.0 Web 3.0 Many  Web  sites  containing  unstructured,  textual  content  

Few  large  Web  sites  are  specialized  on  specific  content  types  

Many  Web  sites  containing  &  seman<cally  syndica<ng  arbitrarily  structured  content  

Pictures  Video  

Encyclopedic  ar3cles  +   +  

Source  :  Dr. Sören Auer AKSW, Institut für Informatik

Linked Data

Page 23: Social web & linked data

Semantic Web in Action page 23

Linked Data

¢ Linked Data •  Is a term used to describe a method of exposing, sharing, and

connecting data on the Web via dereferenceable URIs.

¢ Principles (Tim Berners-Lee) •  The Semantic Web isn't just about putting data on the web. It is about making

links, so that a person or machine can explore the web of data. With linked data, when you have some of it, you can find other, related, data.

•  Like the web of hypertext, the web of data is constructed with documents on the web. However, unlike the web of hypertext, where links are relationships anchors in hypertext documents written in HTML, for data they links between arbitrary things described by RDF. The URIs identify any kind of object or concept.

Source : Wikipedia, Tim Berners Lee

Page 24: Social web & linked data

Semantic Web in Action page 24

Linked Data

¢  Tim Berners-Lee outlined four principles of Linked Data in his Design Issues: Linked Data note, paraphrased along the following lines:

•  Use URIs to identify things that you expose to the Web as resources.

•  Use HTTP URIs so that people can locate and look up (dereference) these things.

•  Provide useful information about the resource when its URI is dereferenced.

•  Include links to other, related URIs in the exposed data as a means of improving information discovery on the Web.

Page 25: Social web & linked data

Semantic Web in Action page 25

Linked Data

¢ Linking Open Data Community Project

•  The goal of the W3C Semantic Web Education and Outreach group's Linking Open Data community project is to extend the Web with a data commons by publishing various open datasets as RDF on the Web and by setting RDF links between data items from different data sources. As of October 2007, datasets consist of over two billion RDF triples, which are interlinked by over two million RDF links. (Wikipedia)

Page 26: Social web & linked data

page 26

Le Google Intelligent : Comment ?

Page 27: Social web & linked data

page 27

Linked Data

¢  Resources

•  http://esw.w3.org/topic/SweoIG/TaskForces/CommunityProjects/LinkingOpenData/

•  http://esw.w3.org/topic/TaskForces/CommunityProjects/LinkingOpenData/DataSets

•  http://esw.w3.org/topic/TaskForces/CommunityProjects/LinkingOpenData/CommonVocabularies

•  http://en.wikipedia.org/wiki/Linked_Data

•  http://www.w3.org/DesignIssues/LinkedData.html

•  http://events.linkeddata.org/iswc2008tutorial/

•  http://www4.wiwiss.fu-berlin.de/bizer/pub/LinkedDataTutorial/

Page 28: Social web & linked data

Semantic Web in Action page 28

Linked Data ¢ DBpedia

•  Is a community effort to extract structured information from Wikipedia and to make this information available on the Web. DBpedia allows you to ask sophisticated queries against Wikipedia, and to link other data sets on the Web to Wikipedia data.

¢  Resources

•  http://wiki.dbpedia.org/About

•  http://blog.dbpedia.org/

•  http://www4.wiwiss.fu-berlin.de/dbpedia/dev/ontology.htm

Page 29: Social web & linked data

Semantic Web in Action page 29

Linked Data

¢ Examples

•  THING à http://dbpedia.org/page/Brest%2C_France

•  HTML à http://dbpedia.org/resource/Brest%2C_France

•  RDF à http://dbpedia.org/data/Brest%2C_France

•  http://dbpedia.org/page/%C3%89cole_nationale_sup%C3%A9rieure_des_t%C3%A9l%C3%A9communications_de_Bretagne

•  http://dbpedia.org/page/Amy_Winehouse

•  http://dbpedia.org/page/Berlin

Page 30: Social web & linked data

Semantic Web in Action page 30

Linked Data

¢ Dbpedia Sparql Endpoint

•  Langage de requêtes SPARQL

•  http://dbpedia.org/snorql/ *

•  http://dbpedia.org/sparql

•  Twinkle : a sparql query tool

-  http://www.ldodds.com/projects/twinkle/

Page 31: Social web & linked data

Linked Data ¢  FREEBASE Website http://www.freebase.com/

http://www.freebase.com/docs/data

•  View data about New York -  http://www.freebase.com/view/en/new_york

•  RDF metadata about New York -  http://rdf.freebase.com/rdf/en.new_york

•  Edit New York Topic -  http://www.freebase.com/edit/topic/en/new_york

•  Explore New York Metadata -  http://www.freebase.com/tools/explore/en/new_york

Semantic Web in Action page 31

Page 32: Social web & linked data

Linked Data

¢ Semantic CrunchBase •  The free directory of technology companies,

people, and investors. •  http://cb.semsol.org/ •  http://cb.semsol.org/sparql •  http://cb.semsol.org/company/techcrunch •  http://cb.semsol.org/product/facebook-platform •  http://cb.semsol.org/explore

Semantic Web in Action

Page 33: Social web & linked data

Linked Data

¢ Les Smob : les Twitter version Web sémantique •  http://www.lespetitescases.net/smob-twitter-version-web-

semantique/ •  http://smob.websemantique.org/sparql.php •  http://microplanet.sioc-project.org/sparql.php

Semantic Web in Action

Page 34: Social web & linked data

Linked Data

¢  IMDB, Linked Movie Database http://www.linkedmdb.org/ •  LinkedMDB publishes linked open data using the D2R Server.

The project aims at publishing the first open semantic web database for movies, including a large number of interlinks to several datasets on the open data cloud and references to related webpages

¢ Data can be accessed using •  Web browsers: http://www.linkedmdb.org/

•  Semantic Web browsers - entry point: http://data.linkedmdb.org/all

•  SPARQL clients - SPARQL endpoint: http://data.linkedmdb.org/sparql

Semantic Web in Action page 34

Page 35: Social web & linked data

Linked Data

¢ Musicbrainz •  This is a database published with D2R Server. It can

be accessed using -  Your web browser http://dbtune.org/musicbrainz/

-  Semantic Web browsers at URL http://dbtune.org/musicbrainz/all

-  SPARQL clients at URL http://dbtune.org/musicbrainz/sparql or In a web browser http://dbtune.org/musicbrainz/snorql/

Semantic Web in Action page 35

Page 36: Social web & linked data

Linked Data

¢ GovTrack.us •  A civic project to track congress

•  The 2000 U.S. Census: 1 Billion RDF Triples

•  http://www.rdfabout.com/demo/census/

•  http://www.govtrack.us/developers/rdf.xpd

•  The SPARQL endpoint is a combined endpoint for various RDF data I play with. It answers queries about 1 billion triples, mostly about U.S. Census data (see rdfabout.com), but also the GovTrack data.

Semantic Web in Action page 36

Page 37: Social web & linked data

Linked Data

¢ GovTrack.us

•  The SPARQL engine's base URL is http://www.rdfabout.com/sparql , following (or trying to follow) the SPARQL Protocol spec.

•  The SPARQL engine is Ryan Levering's engine for SESAME, plus my SemWeb library for C#.

•  The data store is persisted in MySQL. Responses are limited to 1000 rows in the hopes that having this public won't break anything.

Semantic Web in Action page 37

Page 38: Social web & linked data

Linked Data

¢ Revyu.com •  Revyu.com is a web site where you can review and rate things.

Unlike many other reviewing sites on the web, Revyu.com lets you review and rate absolutely anything you can name

•  Web access: http://revyu.com/

•  SPARQL Endpoint http://revyu.com/sparql/

Semantic Web in Action page 38

Page 39: Social web & linked data

Semantic Web in Action page 39

SPARQL: SPARQL Protocol and RDF Query Language

¢  SPARQL

•  pronounced "sparkle" [1]) is an RDF query language; its name is a recursive acronym that stands for SPARQL Protocol and RDF Query Language. It is standardized by the RDF Data Access Working Group (DAWG) of the World Wide Web Consortium, and is considered a component of the semantic web.

•  Initially released as a Candidate Recommendation in April 2006, but returned to Working Draft status in October 2006, due to two open issues. [2] In June 2007, SPARQL advanced to Candidate Recommendation once again. [3] On 12th November 2007 the status of SPARQL changed into Proposed Recommendation. [4] On 15th January 2008, SPARQL became an official W3C Recommendation. [5]

Page 40: Social web & linked data

SPARQL: SPARQL Protocol and RDF Query Language

¢ SPARQL =

•  A Query Language

•  A Result Form

•  An Access Protocol

Semantic Web in Action page 40

Page 41: Social web & linked data

SPARQL: SPARQL Protocol and RDF Query Language

¢ The Query Language: query forms

•  « Select » clause returns all or subset of the variables bound in a query pattern match

•  « Construct » returns an RDF graph constructed by substituting variables in a set of triple templates

•  « Ask » returns a boolean indicating whether a query pattern matches

•  « Describe » returns an RDF graph that describe the resources found

Semantic Web in Action page 41

Page 42: Social web & linked data

SPARQL: SPARQL Protocol and RDF Query Language

¢ « Select » equivalent to « SQL Select » returns a regular table Select … From … Identify data sources to query Where { … } The triple/graph pattern to be matched against the triple/graphs of RDF A conjunction of triples

¢ PREFIX to declare the schema used in the query

Semantic Web in Action page 42

Page 43: Social web & linked data

SPARQL: SPARQL Protocol and RDF Query Language

¢  PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?name FROM <http://example.org/foaf/aliceFoaf> WHERE { ?x foaf:name ?name } Result:

Semantic Web in Action page 43

name « Alice »

Page 44: Social web & linked data

Semantic Web in Action page 44

SPARQL: SPARQL Protocol and RDF Query Language

¢  PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX : <http://dbpedia.org/resource/> PREFIX dbpedia2: <http://dbpedia.org/property/> PREFIX dbpedia: <http://dbpedia.org/> SELECT distinct ?name ?birth ?person FROM http://dbpedia.org/ WHERE

¢  { ?person dbpedia2:birthPlace <http://dbpedia.org/resource/Berlin>.

?person dbpedia2:birth ?birth . ?person foaf:name ?name .

}

Page 45: Social web & linked data

Semantic Web in Action page 45

SPARQL: SPARQL Protocol and RDF Query Language

¢ SPARQL results: ¢  namebirthperson« ":Dru_Berrymore/birth/birth_date_and_age :Dru_Berrymore

"Dru Berrymore"@de:Dru_Berrymore/birth/birth_date_and_age :Dru_Berrymore "Walter Benjamin"@de:Berlin :Walter_Benjamin "Walter Benjamin"@de:Germany :Walter_Benjamin

Name Birth Person « Dru Berrymore »

Page 46: Social web & linked data

Semantic Web in Action page 46

SPARQL: SPARQL Protocol and RDF Query Language

¢  SELECT distinct ?name ?person FROM <http://dbpedia.org/> WHERE { ?person dbpedia2:birthPlace <http://dbpedia.org/resource/Berlin> . ?person foaf:name ?name . }

¢  SELECT distinct ?name ?birth ?death ?person FROM <http://dbpedia.org/> WHERE { ?person dbpedia2:birthPlace <http://dbpedia.org/resource/Berlin> . ?person dbpedia2:birth ?birth . ?person foaf:name ?name . ?person dbpedia2:death ?death. }

Page 47: Social web & linked data

SPARQL: SPARQL Protocol and RDF Query Language

¢ A constraint, expressed by the keyword “FILTER”, is a restriction on solutions over the whole group in which the filter appears

¢  PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX ns: <http://example.org/ns#> SELECT ?title ?price WHERE { ?x ns:price ?price . FILTER (?price < 30.5) ?x dc:title ?title . }

Semantic Web in Action page 47

Page 48: Social web & linked data

SPARQL: SPARQL Protocol and RDF Query Language

¢ “regex” matches only plain literals with no language tag

¢  { ?x foaf:name ?name . ?x foaf:mbox ?mbox . FILTER regex(?name, "Smith") }

¢  PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT ?title WHERE { ?x dc:title ?title FILTER regex(?title, "web", "i" ) }

Semantic Web in Action page 48

Page 49: Social web & linked data

SPARQL: SPARQL Protocol and RDF Query Language

¢ Optional parts of the graph pattern may be specified syntactically with the “OPTIONAL” keyword applied to a graph pattern

¢  SELECT distinct ?name ?birth ?death ?person FROM <http://dbpedia.org/> WHERE { ?person dbpedia2:birthPlace <http://dbpedia.org/resource/Berlin> . ?person dbpedia2:birth ?birth . ?person foaf:name ?name . OPTIONAL {?person dbpedia2:death ?death} }

Semantic Web in Action page 49

Page 50: Social web & linked data

SPARQL: SPARQL Protocol and RDF Query Language

¢ Matching alternative

•  Pattern alternatives are syntactically specified with the UNION keyword

¢  SELECT distinct ?name ?birth ?death ?person WHERE { {?person dbpedia2:birthPlace <http://dbpedia.org/resource/Berlin> } UNION {?person dbpedia2:death ?death} ?person foaf:name ?name . ?person dbpedia2:birth ?birth . }

Semantic Web in Action page 50

Page 51: Social web & linked data

SPARQL: SPARQL Protocol and RDF Query Language

¢ Sequence & Modify •  « Order By » to sort,

•  « LIMIT » result number,

•  « OFFSET » rank of first result

¢  SELECT distinct ?name ?person WHERE { ?person dbpedia2:birthPlace <http://dbpedia.org/resource/Berlin>. ?person foaf:name ?name. } ORDER BY ?name LIMIT 20 OFFSET 20

Semantic Web in Action page 51

Page 52: Social web & linked data

SPARQL: SPARQL Protocol and RDF Query Language

¢ « Construct » •  The CONSTRUCT query form returns a single RDF

graph specified by a graph template. -  The result is an RDF graph formed by taking each query

solution in the solution sequence, substituting for the variables in the graph template, and combining the triples into a single RDF graph by set union.

•  Useful for aggregating data from multiple sources and merging it into a local store (from Ingenta)

Semantic Web in Action page 52

Page 53: Social web & linked data

SPARQL: SPARQL Protocol and RDF Query Language

¢  PREFIX foaf: <http://xmlns.com/foaf/0.1/> FROM <http://molene.enstb.org/mlearning09/wp-content/plugins/wp-rdfa/foaf.php CONSTRUCT { ?friend a foaf:Person; foaf:name ?name; foaf:homepage ?home.} WHERE { ?person foaf:mbox <mailto:[email protected]>; foaf:knows ?friend. ?friend foaf:name ?name; foaf:homepage ?home.}

Semantic Web in Action page 53

Page 54: Social web & linked data

SPARQL: SPARQL Protocol and RDF Query Language

¢ ASK •  Returns a true/false value: test whether or not a query pattern

has a solution.

•  No information is returned about the possible query solutions, just whether or not a solution exists

•  Is there data that looks like this? Do you have any information about that? (from Ingenta)

¢  PREFIX foaf: <http://xmlns.com/foaf/0.1/> ASK WHERE { ?person a foaf:Person; foaf:mbox <mailto:ab@telecom-bretagne>. }

Semantic Web in Action page 54

Page 55: Social web & linked data

SPARQL: SPARQL Protocol and RDF Query Language

¢ DESCRIBE •  The DESCRIBE form returns a single result RDF

graph containing RDF data about resources.

•  CONSTRUCT but with less control -  Tell me about this or things that look like this … but you

decide what’s relevant (from Ingenta)

¢  PREFIX foaf: <http://xmlns.com/foaf/0.1/> DESCRIBE ?friend WHERE { ?person foaf:mbox “mailto:ab@telecom-bretagne”; foaf:knows ?friend.}

Semantic Web in Action page 55

Page 56: Social web & linked data

SPARQL: SPARQL Protocol and RDF Query Language

¢ Applied uses (from Ingenta) •  DESCRIBE for Prototyping

-  DESCRIBE <http://example.org/someResource>

-  Quickly assembling Uis, Web APIs

•  SELECT for Indexing -  Building an ordering over some data ORDER BY, LIMIT

Semantic Web in Action page 56

Page 57: Social web & linked data

SPARQL: SPARQL Protocol and RDF Query Language

¢ Applied uses (from Ingenta) •  CONSTRUCT for transformation and also simple

inferencing -  CONSTRUCT could be the XSLT of RDF

-  Currently limited by lack of expressions in CONSTRUCT triple templates

•  ASK for validation

•  ASK – DESCRIBE – CONSTRUCT Pattern:

-  Probe endpoint, Grab default view of data, Refine data extraction and/or apply transformation

Semantic Web in Action page 57

Page 58: Social web & linked data

SPARQL: SPARQL Protocol and RDF Query Language

¢ SPARQL Protocol (from F. Gandon, INRIA)

•  Sending queries and their results accross the web

¢ Example with HTTP binding

•  GET /sparql/?query=<encoded query> HTTP/1.1 Host: www.inria.fr User-agent: my-sparql-client/0.1

Semantic Web in Action page 58

Page 59: Social web & linked data

SPARQL: SPARQL Protocol and RDF Query Language

¢ Example with SOAP binding (from F. Gandon) ¢  <?xml version="1.0" encoding="UTF-8"?>

<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <query-request xmlns="http://www.w3.org/2005/09/sparql-protocol-types/#"> <query> SELECT ?x ?p ?y WHERE {?x ?p ?y} </query> </query-request> </soapenv:Body> </soapenv:Envelope>

Semantic Web in Action page 59

Page 60: Social web & linked data

SPARQL: SPARQL Protocol and RDF Query Language

¢ Access to Data on the web •  http://dbpedia.org/snorql/

•  http://dbpedia.org/sparql

•  http://demo.openlinksw.com/rdfbrowser2/

•  http://dataviewer.zitgist.com/

•  Etc.

¢  Twinkle : a sparql query tool

•  http://www.ldodds.com/projects/twinkle

Semantic Web in Action page 60

Page 61: Social web & linked data

Semantic Web in Action page 61

SPARQL: SPARQL Protocol and RDF Query Language

¢ Resources

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

•  http://www.w3.org/TR/rdf-sparql-query/

•  http://jena.sourceforge.net/ARQ/Tutorial/

•  http://esw.w3.org/topic/SparqlImplementations

•  http://arc.semsol.org/home

•  http://virtuoso.openlinksw.com/wiki/main/Main/