Hello Open World - The Web of Data for the Pragmatic Developer

96
© Copyright 2008 Digital Enterprise Research Institute. All rights reserved. Digital Enterprise Research Institute www.deri.ie Hello Open World! The Web of Data for the Pragmatic Developer Alexandre Passant & Michael Hausenblas WWW09, Madrid, Spain 2009-04-20

description

WWW2009 Tutorial, Madrid 20th April 2009 - http://hellooopenworld.net

Transcript of Hello Open World - The Web of Data for the Pragmatic Developer

Page 1: Hello Open World - The Web of Data for the Pragmatic Developer

© Copyright 2008 Digital Enterprise Research Institute. All rights reserved.

Digital Enterprise Research Institute www.deri.ie

Hello Open World!

The Web of Data for the Pragmatic Developer

Alexandre Passant & Michael Hausenblas WWW09, Madrid, Spain 2009-04-20

Page 2: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Outline

  Content

  Motivation   What is the Web of Data?

  Creating Structured Data   Discovery, Accessing & Querying

  Mash-ups & Advanced Topics

2

Page 3: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Speakers introduction

  Alexandre Passant   Postdoctoral researcher, DERI Galway

  Social Software and Semantic Web

  http://apassant.net

  Michael Hausenblas   Postdoctoral researcher, DERI Galway

  Large-scale Data/Linked Data and Multimedia

  http://sw-app.org

3

Page 4: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

What is this tutorial about

  What you will learn   Web of Data principles

  Finding and creating structured data

  Ontologies and lightweight inference

  Storing and querying RDF data with SPARQL

  User interfaces and mash-ups for the Web of Data

  What you will not   Ontology mapping and alignment

  Advanced rules languages

  Complex SPARQL querying

4 4

Page 5: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

What you should be able to do after this tutorial

  Explain the Web of Data to your CTO / Students / Advisor / Grandmother   Spread the values of the Web of Data

  Publish Linked Data   And participate in the Linking Open Data community effort

to expand the network effort of the Web of Data

  Build applications for the Web of Data   Using open-source and xAMP technologies

  Creating, consuming and mashing-up RDF data

5 5

Page 6: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Outline

  Content

  Motivation   What is the Web of Data?

  Creating Structured Data   Discovery, Accessing & Querying

  Mash-ups & Advanced Topics

6

Page 7: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Motivation

7

2008

2007

Page 8: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Motivation

8

2009

2008

Page 9: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Motivation

  More and more data is available on the Web

  Structured data, in RDF, microformats, etc.   Up to now people would develop against

proprietary APIs (such as from Flickr, Google, etc.)   Loss of time for developers

  The Web of Data …   Provides a uniform data model (RDF)

  Provides a uniform API for accessing data (RDF/SPARQL)

  Provide common semantics for this data (RDFS/OWL)

  Is a scalable platform for data integration and mash-up

  Enables serendipitous usage of data

9

Page 10: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Outline

  Content

  Motivation   What is the Web of Data?

  Creating Structured Data   Discovery, Accessing & Querying

  Mash-ups & Advanced Topics

10

Page 11: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

What is the Web of Data?

In contrast to the full-fledged Semantic Web vision,

the Web of Data is about publishing structured

data in RDF using URIs rather than focusing on the

ontological level or inference.

This simplification (just as the Web simplified the

established academic approaches of Hypertext systems) lowers the entry barrier for data providers

and consumers, hence fosters a wide-spread adoption and real-world impact.

11

Page 12: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

What is the Web of Data?

12

Page 13: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

What is the Web of Data?

  Linked data principles, by Tim Berners-Lee, ca. 2006   Use URIs to identify things (anything, not just documents)

  Use HTTP URIs – globally unique names, distributed ownership – allows people to look up things

  Provide useful information in RDF – when someone looks up a URI

  Include RDF links to other URIs – to enable discovery of related information

13

Page 14: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

What is the Web of Data?

  Ongoing work   Description/discovery

–  semantic sitemaps, see http://sw.deri.org/2007/07/sitemapextension/

–  voiD, see http://semanticweb.org/wiki/VoiD

  Trust (SPOT09 at ESWC09 for example)

  Multimedia/Fragments, see http://www.interlinkingmultimedia.info/

  Foundational issues in TAG/AWWSW

  Transforming the read-only Web of Data into a read/write Web of Data, see for example http://esw.w3.org/topic/PushBackDataToLegacySources

14

Page 15: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

What is the Web of Data? - URIs

  Architecture of the World Wide Web, vol. 1   http://www.w3.org/TR/webarch/

  “To benefit from and increase the value of the World Wide Web, agents should provide URIs as identifiers for resources”

  URIs are used to identifying anything that can be represented on the Web: pages but also people, cities, interests …   But people are not documents !

15 15

Page 16: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

What is the Web of Data? - URIs

16

  A Uniform Resource Identifier (URI) is a compact sequence of characters that identifies an abstract or physical resource as of RFC3986

  Syntax URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]

  Example foo://example.com:8042/over/there?name=ferret#nose

\_/ \_________________/\_________/ \__________/ \__/

| | | | |

scheme authority path query fragment

Page 17: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

What is the Web of Data? - URIs

17

  Don’t confuse scheme with protocol   Scheme: defines URI layout and (certain) semantics; go and

register with IANA using RFC4395

  Protocol: defines communication means between endpoints (such as HTTP, FTP, etc.)

  URI resolution (as of RFC3986) STEP OUTPUT BUFFER INPUT BUFFER

1 : /a/b/c/./../../g

2E: /a /b/c/./../../g

2E: /a/b /c/./../../g

2E: /a/b/c /./../../g

2B: /a/b/c /../../g

2C: /a/b /../g

2C: /a /g

2E: /a/g

Page 18: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

What is the Web of Data? - URIs

18

  URIrefs, URI references An RDF URI reference is a Unicode string does not contain any control characters (#x00 - #x1F, #x7F-#x9F) and would produce a valid URI character sequence representing an absolute URI when subjected to an UTF-8 encoding along with %-escaping non-US-ASCII octets.

  QNames, Qualified Names (see XML Namespaces) XML’s way to allow namespaced elements/attributes as of QName = Prefix ‘:‘ LocalPart

  CURIEs, Compact URIs   Generic, abbreviated syntax for expressing URIs, currently

in SPARQL, RDFa, and XHTML2 deployed

Page 19: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

What is the Web of Data? - HTTP

19

  The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. It is a generic, stateless, protocol which can be used for many tasks beyond its use for hypertext, such as name servers and distributed object management systems, through extension of its request methods, error codes and headers. A feature of HTTP is the typing and negotiation of data representation, allowing systems to be built independently of the data being transferred. [RFC2616]

Page 20: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

What is the Web of Data? - HTTP

20

  HTTP messages consist of requests from client to server and responses from server to client

  Set of methods is predefined (such as GET, POST, etc.), but can be expanded

  Set of status codes is defined   Informational 1xx, provisional response, (100 Continue)

  Successful 2xx, request successfully received, understood, and accepted (201 Created)

  Redirection 3xx, further action needs to be taken by user agent to fulfill the request (301 Moved Permanently)

  Client Error 4xx, client erred (405 Method Not Allowed)

  Server Error 5xx, server encountered an unexpected condition (501 Not Implemented)

Page 21: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

What is the Web of Data? - HTTP

21

GET /html/rfc2616 HTTP/1.1

Host: tools.ietf.org

User-Agent: Mozilla/5.0

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

HTTP/1.x 200 OK

Date: Thu, 05 Mar 2009 08:17:33 GMT

Server: Apache/2.2.11

Content-Location: rfc2616.html

Last-Modified: Tue, 20 Jan 2009 09:16:04 GMT

Content-Type: text/html; charset=UTF-8

REQ

UEST

R

ESPO

NSE

Page 22: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

What is the Web of Data? - HTTP

22

  Content Negotiation (CN, conneg) is the process of selecting the best representation for a given response when there are multiple representations available

  Three types of CN: server-driven, agent-driven CN, transparent CN

  Example curl -I -H "Accept: application/rdf+xml" http://dbpedia.org/resource/Galway

HTTP/1.1 303 See Other Content-Type: application/rdf+xml Location: http://dbpedia.org/data/Galway.rdf

Page 23: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

What is the Web of Data? - HTTP

23

  Caching (see Cache–Control header field) is essential for scalability

  HTTPbis, IETF WG chaired by Mark Nottingham, mainly about: patches, clarifications, deprecate non-used features, documentation of security properties

Page 24: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

What is the Web of Data? - HTTP

24

  Representational State Transfer

resource the intended conceptual target of a hypertext reference

resource identifier URL, URN

representation HTML document, JPEG image

representation media type, last-modified time metadata

resource source link, alternates, vary metadata

control data if-modified-since, cache-control

Page 25: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

What is the Web of Data? - RDF

25

  As of RDF abstract syntax, a data model: a directed, labeled graph based on URIs   RDF is not XML !

  RDF/XML is only one of the multiple way to serialize RDF data (N3, RDFa …)

  Triple: (subject predicate object)   subject … URIref or bNode

  predicate … URIref

  object … URIref or bNode or literal <http://sw-app.org/#i> <http://xmlns.com/foaf/0.1/knows>

<http://apassant.net/alex>.

Page 26: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

What is the Web of Data? - RDF

26

Page 27: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

What is the Web of Data? - Ontologies

27

  Ontologies provide common semantics for the Web of Data   “An ontology is a specification of a conceptualization.”

  Main languages are RDFS and OWL   This tutorial will mainly focus on RDFS

  OWL allows advanced axioms (contraints, unions …)

  Classes and properties   :Person a rdfs:Class

  :father a rdfs:Property

  :father rdfs:domain :Person

  :father rdfs:range :Person

27 of XYZ

Page 28: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

What is the Web of Data? - Ontologies

28

  Hierarchies in ontologies   Are needed to define narrower / broader concepts

  :LivingThing > :Person

  Can be applied to both classes and properties   :Person rdfs:subClassOf :LivingThing

  :father rdfs:subPropertyOf :familyRelation

  Inference engines can take advantage of it to create new facts   Can be used when querying information

  Retrieve all :LivingThing instances with a :familyRelation –  Will get :Person and :father

28 of XYZ

Page 29: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

What is the Web of Data? – Open World

29

  The Open World Assumption   Might be complex to understand when coming from a

RDBMS or OOP background

  If a fact is not there, it does not means it is false   Bob’s father is Paul. Is Jim Paul’s father ?

–  Cannot be answered unless there are some cardinality constraints in the ontology (in OWL), e.g. a Person has only 1 father.

  Is John a speaker in this tutorial ? –  Cannot be answered

  Bob’s daughters are Alice and June. Has Bob 3 daughters ? –  Cannot be answered

29 of XYZ

Page 30: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

What is the Web of Data? – Open World

30

  Domain and range of properties are descriptive, not prescriptive   :father rdfs:domain :Person

  Does not mean that only pre-defined instances of :Person can be linked to other via a :father relationship, but that each instance linked to another via :father becomes instantaneously a foaf:Person

–  Based on RDF semantics (Rule rdfs2)

–  http://www.w3.org/TR/rdf-mt/

  Once again, constraints are needed to check integrity of a model and a knowledge base

–  E.g. to check that inferred statements are not contradictory with OWL axioms such as owl:disjoinwWith

30 of XYZ

Page 31: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

What is the Web of Data? - Overview

31

Web's Standard Retrieval Algorithm as of [SDD]:

1.  parse URI and find HTTP protocol 2.  look up DNS name to determine the

associated IP address 3.  open a TCP stream to port 80 at the IP

address determined above 4.  format an HTTP GET request for resource

and sends that to the server 5.  read response from the server 6.  from the status code (200) determine that a

representation of the resource is available 7.  inspect the returned Content-Type 8.  pass the entity-body to its HTML rendering

engine

Page 32: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

32

Page 33: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

33

What is the Web of Data? - Overview

Page 34: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

34

What is the Web of Data? - Overview

Page 35: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Applications for the Web of Data

35 of XYZ 35 of XYZ

Towards a reference architecture for Semantic Web applications. Heitmann et al. (WebSci09 – http://journal.webscience.org/199/)

Page 36: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Linking Open Data Project

  Community project with W3C support started in early 2007 [LOD]

  Idea: take existing (open) data sets and make them available on the Web in RDF

  Interlink them with other data sets

36

Kudos to Tom Heath and Richard Cyganiak; the material in this section is heavily based on their work.

Page 37: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Linking Open Data Project

37

May 2007

Page 38: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Linking Open Data Project

38

Feb 2009

Page 39: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Linking Open Data Project

39

DBpedia

Page 40: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Linking Open Data Project

40

Geonames

Page 41: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Tools and Applications

  Linking Open Data homepage [LOD] has   Browsing with Tabulator, VisiNav, DBpedia Mobile, iLOD,

etc.

  Searching with Sindice, SWSE, Falcons, etc.

  Mashups, e.g. Revyu, BBC Music, DERI Pipes

  See further http://esw.w3.org/topic/SweoIG/TaskForces/CommunityProjects/LinkingOpenData/Applications

41

Page 42: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Tools and Applications

42

DBpedia Mobile

Page 43: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Tools and Applications

43

BBC music beta

Page 44: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Outline

  Content

  Motivation   What is the Web of Data?

  Creating Structured Data   Discovery, Accessing & Querying

  Mash-ups & Advanced Topics

44 of XYZ

Page 45: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Creating Structured Data

  Overview of different methods:   Create RDF/XML manually (using your favourite text-editor

or Web-based interfaces)

  Create XHTML+RDFa documents and use GRDDL transformation

  Use exporters / wrappers for existing service

  Use applications that natively expose RDF data

  Provide mappings from RDBMS to RDF data

  Hands-on !   We will go through several of them to create interlinked

RDF data from various sources of structured data

45 of XYZ

Page 46: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Getting a FOAF profile

  Or how to give yourself a URI

  FOAF is the main vocabulary to describe people, their interests, their social networks   http://foaf-project.org

  http://xmlns.com/foaf/0.1

  Create your FOAF file   http://www.ldodds.com/foaf/foaf-a-matic (requires

hosting - provided during the tutorial)

  http://foafbuilder.qdos.com/builder/ (requires OpenID)

46 of XYZ 46 of XYZ

Page 47: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Extend your FOAF profile

  The foaf:knows property aims to represent social connections between people   :alex foaf:knows :michael

  Going further with the relationship vocabulary   http://vocab.org/relationship/: colleagueOf, hasMet …

  Add some people from the workshop, validate, and upload to the workshop repository   http://www.w3.org/RDF/Validator/

  http://helloopenworld.net/www2009/data

  You finally got a URI ! –  http://helloopenworld.net/www2009/data/apassant.rdf#me

47 of XYZ 47 of XYZ

Page 48: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Defining personal interests

  Instead of modeling interests as plain-text strings, use URIs to describe them !   Allows interlinking of various resources for advanced

query purposes: “find all people that like movies directed by Tarantino”

  And link them to you using foaf:topic_interest   :me foaf:topic_interest :movie

  But … where to get these URIs ?   The Linking Open Data cloud !

–  Provide URIs for million of concepts, esp. thanks to DBpedia

  Sindice can be used to find URIs for a given concept –  http://sindice.com

48 of XYZ 48 of XYZ

Page 49: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Defining personal interests

49 of XYZ 49 of XYZ

Page 50: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Defining personal interests

50 of XYZ 50 of XYZ

Page 51: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Extending a vocabulary

  The semantics of foaf:topic_interest can be too weak   How to explicitly create a relationship between someone

and his favorite(s) movie(s) and not any kind of interest ?

  Extending FOAF by creating your own property   And declare it as a subproperty of foaf:topic_interest

  Vocabularies hosting with OpenVocab   Collaborative ontology editing

  http://open.vocab.org

  http://open.vocab.org/forms/newprop

51 of XYZ 51 of XYZ

Page 52: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

RDFa and GRDDL

  GRDDL is a mechanism to transform any kind of XML to RDF

  XHTML+RDFa is an XML application, hence GRDDL can be used to glean the RDF graph from it

  INRIA/Fabien Gandon provided such an transformation based on XSLT, now available at http://www.w3.org/2008/07/rdfa-xslt

52 of XYZ 52 of XYZ

Page 53: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

RDFa and GRDDL

  The GRDDL Primer athttp://www.w3.org/TR/grddl-primer/#scheduling shows the overall processing of XHTML+RDFa:

53 of XYZ 53 of XYZ

Page 54: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

RDFa and GRDDL

  http://sdow2009.semanticweb.org

54 of XYZ 54 of XYZ

Page 55: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

RDFa and GRDDL

  http://sdow2009.semanticweb.org   Browse source to check RDFa annotations

55 of XYZ 55 of XYZ

Page 56: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

RDFa and GRDDL

  http://sdow2009.semanticweb.org   Header contains prefixes and links to the GRDDL

transformation

56 of XYZ 56 of XYZ

Page 57: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

RDFa and GRDDL

  http://sdow2009.semanticweb.org   Webpage can be translated to native RDF/XML using an

RDFa distiller - http://www.w3.org/2007/08/pyRdfa/

57 of XYZ 57 of XYZ

Page 58: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Wrappers for existing sources

  Creating and maintaining a FOAF file by hand can be a time-consuming task   How can we automatically get RDF data from existing

sources ?

  What about Web 2.0 services in which we already give lots of personal information ?   Most of them provide APIs to get structured information

(JSON, XML …) about the user profiles, content, etc.

  API to RDF wrappers can easily be implemented

58 of XYZ 58 of XYZ

Page 59: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Wrappers for Web 2.0 services

  Facebook wrapper   Generates a FOAF file from your Facebook profile

  http://www.dcs.shef.ac.uk/~mrowe/foafgenerator.html

  Flickr wrapper   Generates FOAF + SIOC + links to geographical information

(using geonames.org)

  http://apassant.net/home/2007/12/flickrdf

  OpenLink URIBurner   Translates many structured sources into RDF

  E.g. Twitter: –  http://linkeddata.uriburner.com/about/rdf/http://

twitter.com/terraces

59 of XYZ 59 of XYZ

Page 60: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Interlinking identities

  The previous exporters create different URIs   A need to unify your online identity on the Web of Data

  owl:sameAs and rdfs:seeAlso   http://www4.wiwiss.fu-berlin.de/bizer/pub/

LinkedDataTutorial/

  owl:sameAs: Used to identify two resources with different URIs as being the same resource

  rdfs:seeAlso: “More information about this resource can be found here”

  owl:InverseFunctionalProperty   foaf:mbox, foaf:openid, etc. can be used to identify

uniqueness for a foaf:Person

60 of XYZ 60 of XYZ

Page 61: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Interlinking identities and networks

61 of XYZ 61 of XYZ

Page 62: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Native export of RDF data

  CMS can expose RDF data natively using dedicated plug-ins   SIOC Export for Drupal: http://drupal.org/project/SIOC

  Provide RDF export of each blog post –  http://apassant.net/blog/2009/03/07/call-suggested-

features-sparql-working-group

–  http://apassant.net/sioc/node/235

  Using RDF autodiscovery feature in the HTML header –  So that RDF can be discovered when browsing HTML

–  Semantic Radar: http://sioc-project.org/firefox

  RDFa to be included in Drupal7 code ! –  http://groups.drupal.org/node/16597

–  100.000’s of RDFa-powered websites

62 of XYZ 62 of XYZ

Page 63: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Overview: SIOC for vBulletin

63 of XYZ 63 of XYZ

Page 64: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Translation services

  What about data already structured but not in RDF ?   JSON, RSS2.0, bibtex, etc …

  Translation services can be used   Triplr:

–  http://triplr.org

  Babel –  http://simile.mit.edu/babel/

  Bibtex (from Bibsonomy) to RDF   http://www.bibsonomy.org/bibtex/

286dc964427792faedb4df90056a6fe98/sirakov

  http://simile.mit.edu/babel/translator?reader=bibtex&writer=rdf-xml&mimetype=default

64 of XYZ 64 of XYZ

Page 65: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Relational to RDF Mapping

  Relational data (RDB) is structured data and can be mapped to RDF straight-forward

  Main issues:   Closed-world vs. open-world modeling

  Assigning URIs for entities (records)

  Mapping language expressivity

  For a state-of-the-art see http://www.w3.org/2005/Incubator/rdb2rdf/RDB2RDF_SurveyReport.pdf

65 of XYZ 65 of XYZ

Page 66: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Relational to RDF Mapping

  Standardization   W3C RDB2RDF Incubator Group 2008/2009

  Upcoming W3C RDB2RDF Working Group

  Current solutions (see state-of-the-art)   D2RQ

–  http://www4.wiwiss.fu-berlin.de/bizer/d2rq/

–  DBLP in RDF: http://dblp.l3s.de/d2r/

  OpenLink’s Virtuoso –  http://www.openlinksw.com/virtuoso/

  Triplify –  http://triplify.org

66 of XYZ 66 of XYZ

Page 67: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Outline

  Content

  Motivation   What is the Web of Data?

  Creating Structured Data   Discovery, Accessing & Querying

  Mash-ups & Advanced Topics

67 of XYZ

Page 68: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Discovery, Accessing & Querying

  Discovery is the process of starting with a URI and learn more about the resources that can be accessed or described through it

  In order to access and query data on the Web, one needs to know WHERE and HOW   WHERE: indexer, search engines, pings

  HOW: FYN, sitemaps, voiD (next slide)

68 of XYZ

Page 69: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Discovering RDF data

  Simple case: Follow-Your-Nose by dereferencing URIs (and hence stepwise browsing the RDF graph)

  Indexer or crawler may utilize the semantic sitemaps extension http://sw.deri.org/2007/07/sitemapextension/

  Applications using linked data should use voiD, the vocabulary of interlinked datasets http://semanticweb.org/wiki/VoiD   Allows to learn what a dataset is about

  Provides quantitative data on interlinking (statistics)

  Enables to deliver licensing, provenance and access information

69 of XYZ

Page 70: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Discovering RDF data

  Ping The Semantic Web   http://pingthesemanticweb.com

  A repository of RDF data, provides XML feeds of newly created information

  Can be used to build your application without having to crawl the Web for relevant data   A food-chain for applications on the Web of Data

–  http://sunsite.informatik.rwth-aachen.de/Publications/CEUR-WS//Vol-248/paper11.pdf

  E.g. doap:store –  http://doapstore.org

70 of XYZ

Page 71: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

PTSW food-chain

71 of XYZ

Page 72: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Storing and querying RDF data

  Distributed querying   Important to keep intact the decentralized architecture of

the WWW

  Still experimental, can be quite slow

  voiD can be used to identify relevant sources to be queried

  Storing data locally and querying   Better performances in terms of querying

  But need to deal with data replication

  PTSW can be used to find which data to store

72 of XYZ 72 of XYZ

Page 73: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Setup a SPARQL endpoint

  Lots of triple-store available on the market   Virtuoso, Sesame, Joseki …

  Based on various back-ups (MySQL, dedicated FS …)

  We will focus on xAMP solutions with ARC2   Lightweight RDF framework for PHP

  http://arc.semsol.org

  RDF Store based on MySQL

  Only a few lines of code to set-up a repository –  http://helloopenworld.net/www2009/store1/index.phps

  Using SPARQL+ to LOAD / UPDATE / DELETE RDF data –  SPARQL being read-only

73 of XYZ 73 of XYZ

Page 74: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Loading RDF data

  SPARQL is a read-only language

  SPARUL and SPARQL+ allow to add / modify / delete RDF data   LOAD <URI> [INTO <URI>]

  Will load the RDF data from <URI> into the store before going into SPARQL querying

  LOAD your FOAF files in the RDF store   http://helloopenworld.net/www2009/store1/

  E.g. LOAD <http://helloopenworld.net/www2009/data/apassant.rdf>

–  NB: To be done in POST mode

74 of XYZ 74 of XYZ

Page 75: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

SPARQL

  SPARQL Protocol and RDF Query Language   “The SQL of the Semantic Web”

  Both a protocol and a query language –  RDF data can be queried via REST

  Four different query forms   SELECT, CONSTRUCT, ASK, DESCRIBE

  We will mainly focus on the first one

  SPARQL is based on a graph-matching approach   Retrieve statements that match some patterns in one (or

more) RDF graph(s)

75 of XYZ 75 of XYZ

Page 76: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

SPARQL SELECT

  SELECT all people and their name   http://helloopenworld.net/www2009/files/select1.sparql

PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?person ?name WHERE { ?person a foaf:Person ; foaf:name ?name . }

76 of XYZ 76 of XYZ

Page 77: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

SPARQL CONSTRUCT

  Contruct an RDF graph from other ones

  Can be seen as the XSLT of the Semantic Web   http://helloopenworld.net/www2009/files/

construct1.sparql

PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX www2009: <http://ex.org/www2009/> CONSTRUCT { ?person a www2009:attendee .} WHERE { ?person a foaf:Person . }

77 of XYZ 77 of XYZ

Page 78: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

SPARQL DESCRIBE

  Get information about a given resource

  DESCRIBE is implementation specific   http://helloopenworld.net/www2009/files/desc1.sparql

DESCRIBE <http://helloopenworld.net/www2009/data/apassant.rdf#me>

78 of XYZ 78 of XYZ

Page 79: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

SPARQL ASK

  Check if a particular pattern matches the RDF graph

  Is Alex a foaf:Person ?   http://helloopenworld.net/www2009/files/ask1.sparql

PREFIX foaf: http://xmlns.com/foaf/0.1/

ASK { <http://helloopenworld.net/www2009/data/apassant.rdf#me> a foaf:Person . }

79 of XYZ 79 of XYZ

Page 80: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

SPARQL Protocol

  REST-compliant protocol for SPARQL queries   http://helloopenworld.net/www2009/store1/?

query=PREFIX+foaf%3A+%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0D%0ASELECT+%3Fperson+%3Fname%0D%0AWHERE+{%0D%0A+%3Fperson+a+foaf%3APerson+%3B%0D%0A+++foaf%3Aname+%3Fname+.%0D%0A}%0D%0A&output=htmltab

  Easy for remote SPARQL querying

  SPARCool   Easy SPARQL querying via simple URLs

  http://sparcool.net

80 of XYZ 80 of XYZ

Page 81: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Lightweight inference

  ARC2 does not provide RDFS inference engine   But triggers can be used to write one

  http://apassant.net/blog/2008/10/01/lightweight-subpropertyof-subclassof-inference-arc2

  Rule rdfs9: inference on subproperties   http://www.w3.org/TR/rdf-mt/#RDFSRules

  Can be done with SPARQL CONSTRUCT and ARC2 triggers

  http://helloopenworld.net/www2009/store2/index.phps

  http://helloopenworld.net/www2009/files/ARC2_SubPropertyInferenceTrigger.phps

81 of XYZ 81 of XYZ

Page 82: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Lightweight inference

  LOAD your profile in the inference-enabled store   http://helloopenworld.net/www2009/store2

  Try the following query in both stores   Only the second one deals with subProperty inference

  http://helloopenworld.net/www2009/files/select2.sparql

PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?person WHERE { <YOUR_URI> foaf:knows ?person . }

82 of XYZ 82 of XYZ

Page 83: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Complex triggers

  LOAD the RDF file corresponding to each user interest   Must be done to avoid issues of distributed SPARQL

querying

  Trigger designed using SPARQL SELECT + SPARUL LOAD   For each loaded file, check if there are any

foaf:topic_interest and load them into the store

  http://helloopenworld.net/www2009/files/ARC2_InterestLoadTrigger.phps

  http://helloopenworld.net/www2009/store3

83 of XYZ 83 of XYZ

Page 84: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

SPARQL SELECT w/ Triggers

  Advanced querying capabilities   http://helloopenworld.net/www2009/files/select3.sparql

PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX dbo: <http://dbpedia.org/ontology/> SELECT ?person WHERE { ?person foaf:topic_interest [ dbo:director <http://dbpedia.org/resource/Quentin_Tarantino> . ]

}

84 of XYZ 84 of XYZ

Page 85: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Outline

  Content

  Motivation   What is the Web of Data?

  Creating Structured Data   Discovery, Accessing & Querying

  Mash-ups & Advanced Topics

85 of XYZ

Page 86: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Mash-ups & Advanced Topics

  Applying and extending what we have learned

  Displaying and rendering the Web of Data   End-user Interaction, UI

  Read/write Web of Data

86 of XYZ

Page 87: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Exhibit faceted browsing

  Exhibit   JavaScript library for faceted browsing

  http://www.simile-widgets.org/exhibit/

  Can be used directly on the top of a SPARQL endpoint   Thanks to SPARQL CONSTRUCT and the Babel translation

service

  http://helloopenworld.net/www2009/files/construct2.sparql

  http://helloopenworld.net/www2009/exhibit

  http://microplanet.sioc-project.org/ –  With geolocation services

87 of XYZ 87 of XYZ

Page 88: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Ubiquity command

  Ubiquity   Mozilla Firefox command line for the Web

  http://ubiquity.mozilla.com/

  Find people that like a given topic when browsing Wikipedia   (1) Query Dbpedia to find the related URI

  (2) Query the RDF Store to identify related people

  Total: 2 SPARQL queries !

  http://helloopenworld.net/www2009/ubiquity

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

88 of XYZ 88 of XYZ

Page 89: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Ubiquity command

89 of XYZ 89 of XYZ

Page 90: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Mash-ups & Advanced Topics

  Enabling the read/write Web of Data with pushback/RDForms http://esw.w3.org/topic/PushBackDataToLegacySources

  Using linked data, SPARQL CONSTRUCT for mapping and a fixed-schema vocabulary called RDForms http://rdfs.org/ns/rdforms

90 of XYZ 90 of XYZ

Page 91: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Mash-ups & Advanced Topics

91 of XYZ 91 of XYZ

Page 92: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Mash-ups & Advanced Topics

  View demos at http://ld2sd.deri.org/pushback/

  Check out code at http://code.google.com/p/pushback/

  Join and contribute!

92 of XYZ 92 of XYZ

Page 93: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Outline

  Content

  Motivation   What is the Web of Data?

  Creating Structured Data   Discovery, Accessing & Querying

  Mash-ups & Advanced Topics

93 of XYZ 93 of XYZ

Page 94: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Conclusion

  Web of Data is a reality

  Tons of tools and technologies exist to   Create and describe data on the Web

  Store and access data on the Web

  Discover and query data on the Web

  Challenges   Technical issues such as scalability and usability

  Social issues (trust, privacy, etc.)

  Economic issues (building a critical mass) –  For example Obama administration using SIOC and linked

data is fairly motivating

94 of XYZ 94 of XYZ

Page 95: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Events

  LDOW2009   http://events.linkeddata.org/ldow2009/

  Today, will continue this afternoon

  Gathering tonight with the LOD community !

  ESWC and ISWC   Major venues for research on the Semantic Web

  Triplification challenge   http://triplify.org/Challenge/2009

  Deadline 30 May

95 of XYZ 95 of XYZ

Page 96: Hello Open World - The Web of Data for the Pragmatic Developer

Digital Enterprise Research Institute www.deri.ie

Feedback

  Did you learn something during the tutorial ?

  Do you think you can now explain the Web of Data and build applications ?

  Which topics that you expected were not covered ?

  Feel free to discuss or contact us   [email protected]

[email protected]

  #swig on irc.freenode.net

96 of XYZ 96 of XYZ