Your SlideShare is downloading. ×
0
Creating Semantic Mashups:

  Bridging Web 2.0 and the
       Semantic Web


   Jamie Taylor, Colin Evans, Toby Segaran
Why is Semantic Data Interesting?
Why is Semantic Data Interesting?


•Walmart demo
Why is Semantic Data Interesting?


•Walmart demo
 • http://blog.kiwitobes.com/?p=51
Why is Semantic Data Interesting?


•Walmart demo
 • http://blog.kiwitobes.com/?p=51

•Political Query
Why is Semantic Data Interesting?


•Walmart demo
 • http://blog.kiwitobes.com/?p=51

•Political Query
 • http://www.freeb...
Why is Semantic Data Interesting?


•Walmart demo
 • http://blog.kiwitobes.com/?p=51

•Political Query
 • http://www.freeb...
Why is Semantic Data Interesting?


•Walmart demo
 • http://blog.kiwitobes.com/?p=51

•Political Query
 • http://www.freeb...
Semantic Data is Flexible Data

•   The data for these demos all used structured semantics

•   The data was not specifical...
Overview
Overview

•Introduction to semantic ideas
Overview

•Introduction to semantic ideas

•Technologies and Architectural techniques
Overview

•Introduction to semantic ideas

•Technologies and Architectural techniques

•Build something now looking to the...
Goals
Goals
•Enough to get you started with semantic
 technologies
Goals
•Enough to get you started with semantic
 technologies

•Understand advantages and issues with
 semantic architectures
Goals
•Enough to get you started with semantic
 technologies

•Understand advantages and issues with
 semantic architectur...
Goals
•Enough to get you started with semantic
 technologies

•Understand advantages and issues with
 semantic architectur...
Goals
•Enough to get you started with semantic
 technologies

•Understand advantages and issues with
 semantic architectur...
Semantics: Why do we care?


 As web developers we want to:
 • Increase the utility of our applications
      e.g., help u...
Web 1.0
Web 1.0



           •Single function applications
           •Publishing large private databases
Web 1.0: Stovepipes
                Diner and a Movie
Web 1.0: Stovepipes

•   Data is in silos
•   No information sharing except in the user’s head
•   The end user drives sys...
Web 2.0
Web 2.0
            •Leverage silos of content
            •User-generated content
            •Open APIs facilita...
Web 2.0: UI Mashups
Web 2.0: UI Mashups


• Mash-ups only allow shallow integration at the UI
• Data is still in silos
• User-generated conten...
Today
• Even with open APIs and mash-ups, users still do
  most of the system integration
• With the proliferation of user...
History of Web Integration




Users’ Brain
 Web 1.0



               Point of Integration
History of Web Integration




Users’ Brain   UI (Mash-up)
 Web 1.0         Web 2.0



                Point of Integration
History of Web Integration




Users’ Brain   UI (Mash-up)            Semantic
 Web 1.0         Web 2.0               Mash...
Integration Scaling          Users benefit as
                                 more data is
                               ...
Integration Scaling          Easy to integrate
                                 first few sources,

                       ...
Integration Scaling        Pay a slightly higher
                                start-up cost, but

Semantic Mashup
     ...
Why Semantics
Why Semantics


•Developing Content is expensive
Why Semantics


•Developing Content is expensive

•Developing Web applications is expensive
Why Semantics


•Developing Content is expensive

•Developing Web applications is expensive

•Use existing systems/sources...
Cracking the Stovepipe

• Semantics facilitate shared meaning through
 • Subject Identity
 • Strong Semantics
 • Open APIS...
Creating Meaning




Ridley Scott directed Blade Runner
Creating Meaning




Ridley Scott directed Blade Runner

   subject
Creating Meaning




Ridley Scott directed Blade Runner

   subject    predicate
Creating Meaning




Ridley Scott directed Blade Runner

   subject    predicate   object
Creating Meaning
Creating Meaning




Ridley
Scott
Creating Meaning




Ridley
         directed
Scott
Creating Meaning




Ridley               Blade
         directed
Scott               Runner
Creating Meaning




 Ridley                 Blade
          directed
 Scott                 Runner



subject    predicat...
Using Shared Meaning

         Creating Triples in Javascript:

myRDF = new RDF()
t1 = new Triple('A', 'geo', '37.44, -122...
Using Shared Meaning




              http://kiwitobes.com/maptest/
                                              http://...
Using Shared Meaning
Example of a service (Freebase):
function businessindustry(store) {
   at=store.Match(null,null,'indu...
Using Shared Meaning
Example of a service (Upcoming):

function eventsearch(store) {
    at=store.Match(null,null,'event',...
Identifying Shared Meaning
The Meaning of “is” is
http://dbpedia.org/resource/IS
The Meaning of “is” is
     http://dbpedia.org/resource/IS
•URI’s provide strong
 references
The Meaning of “is” is
     http://dbpedia.org/resource/IS
•URI’s provide strong
 references
 •Much like pointing in the
 ...
The Meaning of “is” is
     http://dbpedia.org/resource/IS
•URI’s provide strong
 references
 •Much like pointing in the
 ...
The Meaning of “is” is
     http://dbpedia.org/resource/IS
•URI’s provide strong
 references
 •Much like pointing in the
 ...
The Meaning of “is” is
     http://dbpedia.org/resource/IS
•URI’s provide strong
 references
 •Much like pointing in the
 ...
Creating Meaning




  http://...         http://...
ridley_scott      blade_runner
Creating Meaning




  http://...         http://...
ridley_scott      blade_runner
Creating Meaning




  http://...                           http://...
ridley_scott   http://...directed   blade_runner
Creating Meaning




  http://...                           http://...
ridley_scott   http://...directed   blade_runner
Creating Meaning




  http://...                           http://...
ridley_scott   http://...directed   blade_runner


...
Creating Meaning


fb = Namespace(quot;http://www.freebase.com/view/en/quot;)
graph.add(
 ( fb(quot;blade_runnerquot;),
  ...
Two Types of URIrefs
Two Types of URIrefs
•Things/states (subjects, objects)
Two Types of URIrefs
•Things/states (subjects, objects)
 •Blade Runner
Two Types of URIrefs
•Things/states (subjects, objects)
 •Blade Runner
 •Ridley Scott
Two Types of URIrefs
•Things/states (subjects, objects)
 •Blade Runner
 •Ridley Scott
 •Movies
Two Types of URIrefs
•Things/states (subjects, objects)
 •Blade Runner
 •Ridley Scott
 •Movies
•Relations (predicates)
Two Types of URIrefs
•Things/states (subjects, objects)
 •Blade Runner
 •Ridley Scott
 •Movies
•Relations (predicates)
 •d...
Two Types of URIrefs
•Things/states (subjects, objects)
 •Blade Runner
 •Ridley Scott
 •Movies
•Relations (predicates)
 •d...
Graph Data Models
Graph Data Models


      quot;Blade Runnerquot;

     name
Graph Data Models


       quot;Blade Runnerquot;

     name           Jun 25, 1982
     release date
Graph Data Models


       quot;Blade Runnerquot;

     name           1981
     release date
       actor
               ...
Graph Data Models


        quot;Blade Runnerquot;

     name           Jun 25, 1982
     release date
                   ...
Graph Data Models


        quot;Blade Runnerquot;

     name           Jun 25, 1982
     release date
                   ...
Graph Data Models
from rdflib import *

fb = Namespace(quot;http://www.freebase.com/view/en/quot;)
graph = ConjunctiveGrap...
Graph Integration
Graph Integration
        B



A


        C



            D



    E
Graph Integration
        B                   B



A                   A


        C                   C



            D
...
Graph Integration
              B               B



      A               A


              C               C



        ...
Graph Integration
                B



        A


                C



                    D



            E
    F
W3C Vision

   Tim Berners-Lee’s
   Giant Global Graph
Stack Attack: Semantic Web




            taken from http://www.w3.org/2007/Talks/0130-sb-W3CTechSemWeb/layerCake-4.png
Stack Attack: J2EE
Take What You Need




        taken from http://www.w3.org/2007/Talks/0130-sb-W3CTechSemWeb/layerCake-4.png
Take What You Need




        taken from http://www.w3.org/2007/Talks/0130-sb-W3CTechSemWeb/layerCake-4.png
Linked Open Data
•Web of Open Data (“global graph”)
•Expressed in RDF
•Lack of ontological agreement
 •how many ways are t...
Tabulator
          Browsing the Global Graph




http://dig.csail.mit.edu/2005/ajar/ajaw/data#Tabulator
Open Data




            http://demo.openlibrary.org/dev/docs/data




    R Data
                     http://theinfo.org...
Just Enough RDF
              Don’t get caught up in the
              serial representation - any
              RDF libra...
Just Enough RDF
                       Don’t get caught up in the
                       serial representation - any
     ...
Just Enough RDF
                         Don’t get caught up in the
                         serial representation - any
 ...
Just Enough RDF
                                 Don’t get caught up in the
                                 serial repres...
Just Enough RDF
                                 Don’t get caught up in the
                                 serial repres...
Just Enough RDF
                                 Don’t get caught up in the
                                 serial repres...
Just Enough RDF
                                 Don’t get caught up in the
                                 serial repres...
RDF Data Model

• Nodes (“Subjects”)
• connect via Links (“Predicates”)
• to Objects
 • either Nodes or Literals
RDF Data Model

• Nodes are referenced by URIs (http://foo/bar/)
• Links are referenced by URIs
• Literals are text string...
RDF Data Model

• RDF is typically expressed in statements or triples
• Triples are composed of a node, a link, and either...
RDF Graphs

• RDF triples are typically grouped into graphs
• Graph Query
 • Triple (s, p, o)
 • Graph query languages (RD...
Query Graph
from rdflib import *



fb = Namespace(quot;http://www.freebase.com/view/en/quot;)

graph = ConjunctiveGraph()...
Triple Query


for triple in graph.triples((None, starredin, fb[quot;star_warsquot;])): print triple



for subject in gra...
SPARQL Query
SELECT ?costar WHERE {
    fb:carrie_fisher fb:starred_in ?movie .
    ?actor fb:starred_in ?movie .
    ?acto...
RDFLib SPARQL Query
print list(graph.query(

quot;quot;quot;SELECT ?costar WHERE {

  fb:carrie_fisher fb:starred_in ?movi...
μformats
    •Semantics embedded in display markup (XHTML)
    •Strong (predefined) semantics
     •Each μformat defines an ...
RDFa
  •Yet another RDF serialization
  •Like μformats, embeddable in HTML
  •Like RDF high expressability + extensibility...
What I mean by Ontology
What I mean by Ontology

Ontology:
What I mean by Ontology

Ontology:
An explicit specification of a conceptualization
What I mean by Ontology

Ontology:
An explicit specification of a conceptualization


Conceptualization:
What I mean by Ontology

Ontology:
An explicit specification of a conceptualization


Conceptualization:
Abstract, simplifie...
What I mean by Ontology

Ontology:
An explicit specification of a conceptualization


Conceptualization:
Abstract, simplifie...
Ontology
Ontology
IS NOT:
Ontology
            IS NOT:
•   Magic
Ontology
            IS NOT:
•   Magic
•   Universal
Ontology
            IS NOT:
•   Magic
•   Universal
•   Change the world
Ontology
            IS NOT:              IS:
•   Magic
•   Universal
•   Change the world
Ontology
            IS NOT:                     IS:
•   Magic                  •   An artifact
•   Universal
•   Change t...
Ontology
            IS NOT:                     IS:
•   Magic                  •   An artifact
•   Universal             ...
Ontology
            IS NOT:                     IS:
•   Magic                  •   An artifact
•   Universal             ...
Movie Ontology
        name
           release_date
                imdb_rating
movie            rt_rating
Movie Ontology
        name
           release_date
                imdb_rating           name
movie             rt_rating...
Movie Ontology
        name
           release_date
                   imdb_rating             name
movie                r...
Ontology Declaration
from rdflib import *


fbCommon = Namespace(quot;http://www.freebase.com/view/common/quot;)
oName = f...
What is Freebase?

• Structured Database
 • Strong Collaboratively Edited Subjects
 • Strong Collaboratively Developed Sem...
What’s in Freebase?
• Over 3.3 million subjects
 • ~750,000 people
 • ~450,000 locations
 • ~50,000 companies
 • ~40,000 m...
http://www.freebase.com/view/en/blade_runner
Freebase Data Model
Freebase Data Model
MQL

•JSON structure
•Schemas (ontologies) form
 object abstraction
•Query by example
  Fill in the parts you know
  Resul...
MQL

•JSON structure                Show me the IMDB links for films
                               by George Lucas:

•Sche...
MQL
                             performance
                                                                      [
     ...
A Semantic Architecture
Semantic Architecture
                  •A little knowledge...
                             ...goe...
A Semantic Architecture
Semantic Architecture



                 Semantic Mapping Layer
A Semantic Architecture
Semantic Architecture


                 Semantic Mash-up Layer
                  Semantic Plugin ...
Film Mashup
• Strong Identity through IMDB IDs
• Pulls data from:
 • IMDB (movie & actor data & rating)
 • Rotten Tomatoes...
Movie Ontology
        name
           release_date
                   imdb_rating             name
movie                r...
MIT SIMILE




             http://www.cse.msu.edu/~dunham/exhibit/top100.html
MIT SIMILE




             http://www.cse.msu.edu/~dunham/exhibit/top100.html
MIT SIMILE




             http://www.cse.msu.edu/~dunham/exhibit/top100.html
MIT SIMILE




             http://www.cse.msu.edu/~dunham/exhibit/top100.html
MIT SIMILE




             http://www.cse.msu.edu/~dunham/exhibit/top100.html
Useful Places

•   Freebase/MQL:

    •   http://www.freebase.com/

•   Javascript RDF Library (used in Toby’s map demo)

...
Useful Places

•   SPARQL:

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

•   Linked Open Data/Semantic Web Interest Gro...
Creating Semantic Mashups  Bridging Web 2 0 And The Semantic Web Presentation 1
Upcoming SlideShare
Loading in...5
×

Creating Semantic Mashups Bridging Web 2 0 And The Semantic Web Presentation 1

1,303

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,303
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
70
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of "Creating Semantic Mashups Bridging Web 2 0 And The Semantic Web Presentation 1"

  1. 1. Creating Semantic Mashups: Bridging Web 2.0 and the Semantic Web Jamie Taylor, Colin Evans, Toby Segaran
  2. 2. Why is Semantic Data Interesting?
  3. 3. Why is Semantic Data Interesting? •Walmart demo
  4. 4. Why is Semantic Data Interesting? •Walmart demo • http://blog.kiwitobes.com/?p=51
  5. 5. Why is Semantic Data Interesting? •Walmart demo • http://blog.kiwitobes.com/?p=51 •Political Query
  6. 6. Why is Semantic Data Interesting? •Walmart demo • http://blog.kiwitobes.com/?p=51 •Political Query • http://www.freebase.com/view/guid/9202a8c04000641f8000000008053940
  7. 7. Why is Semantic Data Interesting? •Walmart demo • http://blog.kiwitobes.com/?p=51 •Political Query • http://www.freebase.com/view/guid/9202a8c04000641f8000000008053940 •Venture Spin
  8. 8. Why is Semantic Data Interesting? •Walmart demo • http://blog.kiwitobes.com/?p=51 •Political Query • http://www.freebase.com/view/guid/9202a8c04000641f8000000008053940 •Venture Spin • http://www.perlgoddess.com/FreeSpin/FreeSpin.swf
  9. 9. Semantic Data is Flexible Data • The data for these demos all used structured semantics • The data was not specifically designed for the demo • The demos can utilize any data set with shared semantics (e.g., Venture Spin)
  10. 10. Overview
  11. 11. Overview •Introduction to semantic ideas
  12. 12. Overview •Introduction to semantic ideas •Technologies and Architectural techniques
  13. 13. Overview •Introduction to semantic ideas •Technologies and Architectural techniques •Build something now looking to the Future
  14. 14. Goals
  15. 15. Goals •Enough to get you started with semantic technologies
  16. 16. Goals •Enough to get you started with semantic technologies •Understand advantages and issues with semantic architectures
  17. 17. Goals •Enough to get you started with semantic technologies •Understand advantages and issues with semantic architectures •Basic understanding of semantic representation
  18. 18. Goals •Enough to get you started with semantic technologies •Understand advantages and issues with semantic architectures •Basic understanding of semantic representation •Ability to use basic semantic repository
  19. 19. Goals •Enough to get you started with semantic technologies •Understand advantages and issues with semantic architectures •Basic understanding of semantic representation •Ability to use basic semantic repository •Working overview of a semantic system
  20. 20. Semantics: Why do we care? As web developers we want to: • Increase the utility of our applications e.g., help users get stuff done • Build applications with greater efficiency
  21. 21. Web 1.0 Web 1.0 •Single function applications •Publishing large private databases
  22. 22. Web 1.0: Stovepipes Diner and a Movie
  23. 23. Web 1.0: Stovepipes • Data is in silos • No information sharing except in the user’s head • The end user drives system and data integration ...usually through “copy & paste”
  24. 24. Web 2.0 Web 2.0 •Leverage silos of content •User-generated content •Open APIs facilitate mash-ups •The “Social Web”
  25. 25. Web 2.0: UI Mashups
  26. 26. Web 2.0: UI Mashups • Mash-ups only allow shallow integration at the UI • Data is still in silos • User-generated content is also in silos Data doesn’t stray far from its point of creation
  27. 27. Today • Even with open APIs and mash-ups, users still do most of the system integration • With the proliferation of user-generated content, system integration is more important than ever! • Data, whether user-generated, or proprietary, is not easily accessible or transferable • We’re still fighting with stovepipe systems
  28. 28. History of Web Integration Users’ Brain Web 1.0 Point of Integration
  29. 29. History of Web Integration Users’ Brain UI (Mash-up) Web 1.0 Web 2.0 Point of Integration
  30. 30. History of Web Integration Users’ Brain UI (Mash-up) Semantic Web 1.0 Web 2.0 Mash-ups Point of Integration
  31. 31. Integration Scaling Users benefit as more data is made available Web 2.0 Mashup in application Utility increase as number of sources increases
  32. 32. Integration Scaling Easy to integrate first few sources, but complexity increases as Web 2.0 Mashup number of sources increases Integration effort grows with number of sources
  33. 33. Integration Scaling Pay a slightly higher start-up cost, but Semantic Mashup quickly benefit. Note: red line is should somewhat sloping up :-) Treat sources uniformly
  34. 34. Why Semantics
  35. 35. Why Semantics •Developing Content is expensive
  36. 36. Why Semantics •Developing Content is expensive •Developing Web applications is expensive
  37. 37. Why Semantics •Developing Content is expensive •Developing Web applications is expensive •Use existing systems/sources where possible
  38. 38. Cracking the Stovepipe • Semantics facilitate shared meaning through • Subject Identity • Strong Semantics • Open APIS + Open Data • These principles make it much easier to combine stovepipe systems and integrate data
  39. 39. Creating Meaning Ridley Scott directed Blade Runner
  40. 40. Creating Meaning Ridley Scott directed Blade Runner subject
  41. 41. Creating Meaning Ridley Scott directed Blade Runner subject predicate
  42. 42. Creating Meaning Ridley Scott directed Blade Runner subject predicate object
  43. 43. Creating Meaning
  44. 44. Creating Meaning Ridley Scott
  45. 45. Creating Meaning Ridley directed Scott
  46. 46. Creating Meaning Ridley Blade directed Scott Runner
  47. 47. Creating Meaning Ridley Blade directed Scott Runner subject predicate object
  48. 48. Using Shared Meaning Creating Triples in Javascript: myRDF = new RDF() t1 = new Triple('A', 'geo', '37.44, -122.14') t2 = new Triple('B', 'company', 'Wal-mart') myRDF.addTriples([t1, t2]) http://rdflib.net/
  49. 49. Using Shared Meaning http://kiwitobes.com/maptest/ http://rdflib.net/
  50. 50. Using Shared Meaning Example of a service (Freebase): function businessindustry(store) {    at=store.Match(null,null,'industry',null)    for (i=0;i<at.length;i++) {       subject=at[i].subject       industry=at[i].object       query=[{'type':'/business/company',               'name':null,               'industry':industry}]              Metaweb.read(query,                    function(r) {                       t=[]                       for (i=0;i<r.length;i++) {                          t.push(new Triple(subject, 'company',r[i].name,'','','en'))                       }                       store.addTriples(t)                    })      } }
  51. 51. Using Shared Meaning Example of a service (Upcoming): function eventsearch(store) { at=store.Match(null,null,'event',null)     for (i=0;i<at.length;i++) {        subject=at[i].subject        event=at[i].object                var request = new XMLHttpRequest();         request.open(quot;GETquot;, 'upcomingread.php?query='+event, true);        request.onreadystatechange = function()        {            if (request.readyState == 4) {               var items = request.responseXML.getElementsByTagName(quot;eventquot;);               t=[]               for (j=0;j<items.length;j++) {                address=items[j].getAttribute('venue_address')+', '+                items[j].getAttribute('venue_city')+', '+                items[j].getAttribute('venue_state_code')+' '+ items[j].getAttribute('venue_zip')                               t.push(new Triple(subject,'address',address))               }               store.addTriples(t)            }        };        request.send(null);     } }
  52. 52. Identifying Shared Meaning
  53. 53. The Meaning of “is” is http://dbpedia.org/resource/IS
  54. 54. The Meaning of “is” is http://dbpedia.org/resource/IS •URI’s provide strong references
  55. 55. The Meaning of “is” is http://dbpedia.org/resource/IS •URI’s provide strong references •Much like pointing in the physical world
  56. 56. The Meaning of “is” is http://dbpedia.org/resource/IS •URI’s provide strong references •Much like pointing in the physical world “this is red”
  57. 57. The Meaning of “is” is http://dbpedia.org/resource/IS •URI’s provide strong references •Much like pointing in the physical world “this is red” “this is a pen”
  58. 58. The Meaning of “is” is http://dbpedia.org/resource/IS •URI’s provide strong references •Much like pointing in the physical world “this is red” “this is a pen” •a URIref is an unambiguous pointer to something of meaning
  59. 59. Creating Meaning http://... http://... ridley_scott blade_runner
  60. 60. Creating Meaning http://... http://... ridley_scott blade_runner
  61. 61. Creating Meaning http://... http://... ridley_scott http://...directed blade_runner
  62. 62. Creating Meaning http://... http://... ridley_scott http://...directed blade_runner
  63. 63. Creating Meaning http://... http://... ridley_scott http://...directed blade_runner subject predicate object
  64. 64. Creating Meaning fb = Namespace(quot;http://www.freebase.com/view/en/quot;) graph.add( ( fb(quot;blade_runnerquot;), fb(quot;directed_byquot;), fb(quot;ridley_scottquot;) )
  65. 65. Two Types of URIrefs
  66. 66. Two Types of URIrefs •Things/states (subjects, objects)
  67. 67. Two Types of URIrefs •Things/states (subjects, objects) •Blade Runner
  68. 68. Two Types of URIrefs •Things/states (subjects, objects) •Blade Runner •Ridley Scott
  69. 69. Two Types of URIrefs •Things/states (subjects, objects) •Blade Runner •Ridley Scott •Movies
  70. 70. Two Types of URIrefs •Things/states (subjects, objects) •Blade Runner •Ridley Scott •Movies •Relations (predicates)
  71. 71. Two Types of URIrefs •Things/states (subjects, objects) •Blade Runner •Ridley Scott •Movies •Relations (predicates) •directed by
  72. 72. Two Types of URIrefs •Things/states (subjects, objects) •Blade Runner •Ridley Scott •Movies •Relations (predicates) •directed by •acted in
  73. 73. Graph Data Models
  74. 74. Graph Data Models quot;Blade Runnerquot; name
  75. 75. Graph Data Models quot;Blade Runnerquot; name Jun 25, 1982 release date
  76. 76. Graph Data Models quot;Blade Runnerquot; name 1981 release date actor quot;Harrison Fordquot;
  77. 77. Graph Data Models quot;Blade Runnerquot; name Jun 25, 1982 release date quot;Harrison Fordquot; actor name
  78. 78. Graph Data Models quot;Blade Runnerquot; name Jun 25, 1982 release date quot;Harrison Fordquot; actor name birth date Jul 13, 1942
  79. 79. Graph Data Models from rdflib import * fb = Namespace(quot;http://www.freebase.com/view/en/quot;) graph = ConjunctiveGraph() br = fb(quot;blade_runnerquot;) graph.add((br, fb(quot;namequot;), Literal(“Blade Runner”)) graph.add((br, fb(quot;release_datequot;), Literal(“Jun 25, 1982”)) hf = fb(“harrison_ford”) graph.add((hf, fb(quot;namequot;), Literal(“Harrison Ford”)) graph.add((hf, fb(quot;birth_datequot;), Literal(“Jul 13, 1942”)) graph.add((br, fb(quot;actorquot;), hf))
  80. 80. Graph Integration
  81. 81. Graph Integration B A C D E
  82. 82. Graph Integration B B A A C C D E E F
  83. 83. Graph Integration B B A A C C D E E F
  84. 84. Graph Integration B A C D E F
  85. 85. W3C Vision Tim Berners-Lee’s Giant Global Graph
  86. 86. Stack Attack: Semantic Web taken from http://www.w3.org/2007/Talks/0130-sb-W3CTechSemWeb/layerCake-4.png
  87. 87. Stack Attack: J2EE
  88. 88. Take What You Need taken from http://www.w3.org/2007/Talks/0130-sb-W3CTechSemWeb/layerCake-4.png
  89. 89. Take What You Need taken from http://www.w3.org/2007/Talks/0130-sb-W3CTechSemWeb/layerCake-4.png
  90. 90. Linked Open Data •Web of Open Data (“global graph”) •Expressed in RDF •Lack of ontological agreement •how many ways are there to express lat/lon?! •Canonical references are problematic •Closest thing we have to the Semantic Web ...more like a test bed
  91. 91. Tabulator Browsing the Global Graph http://dig.csail.mit.edu/2005/ajar/ajaw/data#Tabulator
  92. 92. Open Data http://demo.openlibrary.org/dev/docs/data R Data http://theinfo.org/ http://theinfo.org/get/data
  93. 93. Just Enough RDF Don’t get caught up in the serial representation - any RDF library will take care of that for you transparently. Focus on the data model
  94. 94. Just Enough RDF Don’t get caught up in the serial representation - any RDF library will take care of that for you transparently. •RDF is a Data Model Focus on the data model
  95. 95. Just Enough RDF Don’t get caught up in the serial representation - any RDF library will take care of that for you transparently. •RDF is a Data Model Focus on the data model •A very simple model!
  96. 96. Just Enough RDF Don’t get caught up in the serial representation - any RDF library will take care of that for you transparently. •RDF is a Data Model Focus on the data model •A very simple model! •RDF has many (inconvenient) serializations
  97. 97. Just Enough RDF Don’t get caught up in the serial representation - any RDF library will take care of that for you transparently. •RDF is a Data Model Focus on the data model •A very simple model! •RDF has many (inconvenient) serializations •RDF-XML
  98. 98. Just Enough RDF Don’t get caught up in the serial representation - any RDF library will take care of that for you transparently. •RDF is a Data Model Focus on the data model •A very simple model! •RDF has many (inconvenient) serializations •RDF-XML •N3
  99. 99. Just Enough RDF Don’t get caught up in the serial representation - any RDF library will take care of that for you transparently. •RDF is a Data Model Focus on the data model •A very simple model! •RDF has many (inconvenient) serializations •RDF-XML •N3 •Turtle
  100. 100. RDF Data Model • Nodes (“Subjects”) • connect via Links (“Predicates”) • to Objects • either Nodes or Literals
  101. 101. RDF Data Model • Nodes are referenced by URIs (http://foo/bar/) • Links are referenced by URIs • Literals are text strings, sometimes with a URI type and a language attached • Literal types typically are XML Schema URIs (examples)
  102. 102. RDF Data Model • RDF is typically expressed in statements or triples • Triples are composed of a node, a link, and either another node or a literal • <http://www.w3.org/People/Berners-Lee/card#i> <http://www.w3.org/2000/01/rdf-schema#label> “Tim Berners-Lee”
  103. 103. RDF Graphs • RDF triples are typically grouped into graphs • Graph Query • Triple (s, p, o) • Graph query languages (RDQL, SPARQL)
  104. 104. Query Graph from rdflib import * fb = Namespace(quot;http://www.freebase.com/view/en/quot;) graph = ConjunctiveGraph() starredin = fb[quot;starred_inquot;] graph.add((fb[quot;carrie_fisherquot;], starredin, fb[quot;star_warsquot;])) graph.add((fb[quot;harrison_fordquot;], starredin, fb[quot;star_warsquot;])) graph.add((fb[quot;harrison_fordquot;], starredin, fb[quot;blade_runnerquot;])) graph.add((fb[quot;daryl_hannahquot;], starredin, fb[quot;blade_runnerquot;]))
  105. 105. Triple Query for triple in graph.triples((None, starredin, fb[quot;star_warsquot;])): print triple for subject in graph.subjects(predicate=starredin, object=fb[quot;star_warsquot;]): print subject
  106. 106. SPARQL Query SELECT ?costar WHERE { fb:carrie_fisher fb:starred_in ?movie . ?actor fb:starred_in ?movie . ?actor fb:starred_in ?othermovie . ?costar fb:starred_in ?othermovie . FILTER (?othermovie != ?movie && ?actor != ?costar) }
  107. 107. RDFLib SPARQL Query print list(graph.query( quot;quot;quot;SELECT ?costar WHERE { fb:carrie_fisher fb:starred_in ?movie . ?actor fb:starred_in ?movie . ?actor fb:starred_in ?othermovie . ?costar fb:starred_in ?othermovie . FILTER (?othermovie != ?movie && ?actor != ?costar) } quot;quot;quot;, initNs=dict(fb=Namespace(quot;http://www.freebase.com/view/en/quot;))))
  108. 108. μformats •Semantics embedded in display markup (XHTML) •Strong (predefined) semantics •Each μformat defines an “ontology” <div class=quot;hreviewquot;> <span><span class=quot;ratingquot;>5</span> out of 5 stars</span> <h4 class=quot;summaryquot;>Crepes on Cole is awesome</h4> <span class=quot;reviewer vcardquot;>Reviewer: <span class=quot;fnquot;>Tantek</span> - <abbr class=quot;dtreviewedquot; title=quot;20050418T2300-0700quot;>April 18, 2005</abbr></span> <div class=quot;description item vcardquot;><p> <span class=quot;fn orgquot;>Crepes on Cole</span> is one of the best little creperies in <span class=quot;adrquot;><span class=quot;localityquot;>San Francisco</span></span>. Excellent food and service. Plenty of tables in a variety of sizes WP identifies 22 distinct for parties large and small. </p></div> places called San Francisco in the world <p>Visit date: <span>April 2005</span></p> <p>Food eaten: <span>Florentine crepe</span></p> </div>
  109. 109. RDFa •Yet another RDF serialization •Like μformats, embeddable in HTML •Like RDF high expressability + extensibility •Like any RDF serialization, you don’t want to create them by hand! <p xmlns:dc=quot;http://purl.org/dc/elements/1.1/quot; about=quot;http://www.example.com/books/wikinomicsquot;> In his latest book <cite property=quot;dc:titlequot;>Wikinomics</cite>, <span property=quot;dc:authorquot;>Don Tapscott</span> explains deep changes in technology, demographics and business. The book is due to be published in <span property=quot;dc:datequot; content=quot;2006-10-01quot;>October 2006</span>. </p>
  110. 110. What I mean by Ontology
  111. 111. What I mean by Ontology Ontology:
  112. 112. What I mean by Ontology Ontology: An explicit specification of a conceptualization
  113. 113. What I mean by Ontology Ontology: An explicit specification of a conceptualization Conceptualization:
  114. 114. What I mean by Ontology Ontology: An explicit specification of a conceptualization Conceptualization: Abstract, simplified view of the world that we wish to represent for some purpose
  115. 115. What I mean by Ontology Ontology: An explicit specification of a conceptualization Conceptualization: Abstract, simplified view of the world that we wish to represent for some purpose
  116. 116. Ontology
  117. 117. Ontology IS NOT:
  118. 118. Ontology IS NOT: • Magic
  119. 119. Ontology IS NOT: • Magic • Universal
  120. 120. Ontology IS NOT: • Magic • Universal • Change the world
  121. 121. Ontology IS NOT: IS: • Magic • Universal • Change the world
  122. 122. Ontology IS NOT: IS: • Magic • An artifact • Universal • Change the world
  123. 123. Ontology IS NOT: IS: • Magic • An artifact • Universal • An API • Change the world
  124. 124. Ontology IS NOT: IS: • Magic • An artifact • Universal • An API • Change the world • A Social Contract
  125. 125. Movie Ontology name release_date imdb_rating movie rt_rating
  126. 126. Movie Ontology name release_date imdb_rating name movie rt_rating actor actor
  127. 127. Movie Ontology name release_date imdb_rating name movie rt_rating actor name actor address showing theater showing show time
  128. 128. Ontology Declaration from rdflib import * fbCommon = Namespace(quot;http://www.freebase.com/view/common/quot;) oName = fbCommon[quot;object/namequot;] oType = fbCommon[quot;object/typequot;] fbPeople = Namespace(quot;http://www.freebase.com/view/people/quot;) personType = fbPeople[quot;personquot;] pPhoto = fbPeople[quot;person/photoquot;] fbFilm = Namespace(quot;http://www.freebase.com/view/film/quot;) filmType = fbFilm[quot;filmquot;] fImdbId = fbFilm[quot;film/imdb_idquot;] fImdbRating = fbFilm[quot;film/imdb_ratingquot;] fRtRating = fbFilm[quot;film/rt_ratingquot;] fActor = fbFilm[quot;film/actorquot;] theaterType = fbFilm[quot;theaterquot;] tAddress = fbFilm[quot;theater/addressquot;] tShowing = fbFilm[quot;theater/showingquot;] showingType = fbFilm[quot;showingquot;] sTime = fbFilm[quot;showing/timequot;] fbDining = Namespace(quot;http://www.freebase.com/view/dining/quot;) restaurantType = fbDining[quot;restaurantquot;] rAddress = fbFilm[quot;restaurant/addressquot;]
  129. 129. What is Freebase? • Structured Database • Strong Collaboratively Edited Subjects • Strong Collaboratively Developed Semantics • Open API + Open Data
  130. 130. What’s in Freebase? • Over 3.3 million subjects • ~750,000 people • ~450,000 locations • ~50,000 companies • ~40,000 movies • Over 1000 types and 3000 properties
  131. 131. http://www.freebase.com/view/en/blade_runner
  132. 132. Freebase Data Model
  133. 133. Freebase Data Model
  134. 134. MQL •JSON structure •Schemas (ontologies) form object abstraction •Query by example Fill in the parts you know Result fills in the rest
  135. 135. MQL •JSON structure Show me the IMDB links for films by George Lucas: •Schemas (ontologies) form [{ object abstraction quot;namequot; : null, quot;imdb_idquot; : [ ], •Query by example quot;initial_release_datequot;:null, Fill in the parts you know quot;directed_byquot;:quot;George Lucasquot;, quot;typequot; : quot;/film/filmquot; Result fills in the rest }]
  136. 136. MQL performance [ { Carrie Star quot;filmquot; : [ film actor film starring Fisher Wars { quot;filmquot; : { quot;namequot; : null, ter quot;starringquot; : [ { Carrie Fisherʼs Costars: ac quot;actorquot; : { ar quot;filmquot; : [ ch { quot;filmquot; : { Princess [{ quot;namequot; : null, quot;starringquot; : [ Leia quot;filmquot; : [{ { quot;actorquot; : { quot;namequot; : null quot;filmquot; : { }, quot;limitquot; : 2 quot;namequot; : null, ] } quot;starringquot; : [{ }, quot;limitquot; : 2 quot;actorquot; : null ], } quot;namequot; : null }] }, quot;limitquot; : 2 } ] } }], }, quot;limitquot; : 2 quot;idquot; : quot;/en/carrie_fisherquot;, ], } quot;idquot; : quot;/en/carrie_fisherquot;, quot;typequot; : quot;/film/actorquot; quot;typequot; : quot;/film/actorquot; } }] ]
  137. 137. A Semantic Architecture Semantic Architecture •A little knowledge... ...goes a long way •Leverage Silos of Content •Effort ∝ semantic coverage
  138. 138. A Semantic Architecture Semantic Architecture Semantic Mapping Layer
  139. 139. A Semantic Architecture Semantic Architecture Semantic Mash-up Layer Semantic Plugin Layer
  140. 140. Film Mashup • Strong Identity through IMDB IDs • Pulls data from: • IMDB (movie & actor data & rating) • Rotten Tomatoes (rating) • Freebase (pictures & restaurants) • Fandango (movie theaters)
  141. 141. Movie Ontology name release_date imdb_rating name movie rt_rating actor name actor address showing theater showing show time
  142. 142. MIT SIMILE http://www.cse.msu.edu/~dunham/exhibit/top100.html
  143. 143. MIT SIMILE http://www.cse.msu.edu/~dunham/exhibit/top100.html
  144. 144. MIT SIMILE http://www.cse.msu.edu/~dunham/exhibit/top100.html
  145. 145. MIT SIMILE http://www.cse.msu.edu/~dunham/exhibit/top100.html
  146. 146. MIT SIMILE http://www.cse.msu.edu/~dunham/exhibit/top100.html
  147. 147. Useful Places • Freebase/MQL: • http://www.freebase.com/ • Javascript RDF Library (used in Toby’s map demo) • http://www.jibbering.com/rdf-parser/ • LIBrdf (Python) • http://rdflib.net/ • MIT Semantic Visualization Widgets • http://simile.mit.edu/
  148. 148. Useful Places • SPARQL: • http://www.w3.org/TR/rdf-sparql-query/ • Linked Open Data/Semantic Web Interest Group (SWIG) • http://www.w3.org/2001/sw/interest/ • http://www.w3.org/DesignIssues/LinkedData.html • Tabulator (Linked Open Data Browser): • http://www.w3.org/2005/ajar/tab
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×