Drupal Camp
  Jamie Taylor
What can semantic web
technologies do for you?
Tag your content
Topic Hubs
RDFa Powered Search
Data Exploration Widgets
Why Semantics?




A Brief History of Data Modeling
                 Photo CC-BY: http://en.wikipedia.org/wiki/File:McDona...
Ugly Tabular Data
A Simple Restaurant Schema
A Simple Restaurant Schema
Big Ugly Schema
What Went Wrong?
                            Scripting Languages
                            facilitate change

          ...
Graph Data Models
                      Deli Liiama
          Name

          Cuisine
     S1                  Deli
      ...
Graph Data Models
     Peking Inn                                  Deli Liiama
                                  Name

   ...
Extending Graph Data Models
                                                    Deli Liiama
Urban Chic                    ...
Integrating Graph Data Models
                   Deli Liiama
         Name
                                             De...
Semantic Representation


Relationships are represented explicitly
Schema can be represented as a graph
Data integration i...
Plugable Data

         Data


                 Semantics allows an
Data



                 application to utilize
      ...
Plugable Data
Data Portability
Data     Data


                Semantics allows data to
                be utilized by
         Data
   ...
Data Portability




     http://dev.mqlx.com/~jamie/simile/timeline.html
Data Portability
Why Does This Work?

 Semantics facilitate shared meaning through
• Subject Identity
• Strong and Consistent Semantics
• O...
Just enough RDF
Just Enough RDF



RDF is a Data Model
   A very simple model!
Cosmos was written by Carl Sagan
(Cosmos) (was written by) (Carl Sagan)
Subject Predicate Object



(Cosmos) (was written by) (Carl Sagan)
Subject Predicate Object



(Cosmos) (was written by) (Carl Sagan)


               author       Carl
   Cosmos
          ...
Subject   Which Cosmos?




(Cosmos)
Subject   Which Cosmos?




(Cosmos)
Identifiers are Everywhere
The humble URI

•URI’s provide strong references
 •Much like pointing in the physical
  world
             “this is red”
 ...
Subject                      Which Cosmos?




(Cosmos)



 http://rdf.freebase.com/ns/authority.openlibrary.book.OL356886...
What do you mean, author?

http://rdf.freebase.com/ns/book.written_work.author




                   author              ...
There are billions of Carl Sagans...
      http://rdf.freebase.com/ns/en.carl_sagan




  Cosmos            author
0 ”
                           9 8
                       d “1
                   h e
              b lis
         p   u

...
RDF Data Model


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


RDF has many (inconvenient) serializations
   •RDF-XML
   •N3
   •Turtle
   •NTriples
   •RDFa
In N-Triples:
 <http://rdf.freebase.com/ns/authority.openlibrary.book.OL3568862M>
 <http://rdf.freebase.com/ns/book.writte...
In N-Triples:
<http://rdf.freebase.com/ns/authority/openlibrary/book/OL3568862M>
<http://rdf.freebase.com/ns/book.written_...
URIs provide identity
http://rdf.freebase.com/ns/en.robert_cook


  Stability
  Simplicity
  Manageability
     PURL.org
Not all URL’s are good identifiers
A socially managed semantic database
All objects in Freebase have strong identifiers




http://rdf.freebase.com/ns/en.yorkie
Types of things in Freebase
5,203,825 Topics
14,110,006 Named Entites
Sources of Freebase Data
Freebase is user writable
schema = vocabulary
Freebase Suggest
Freebase Suggest in Drupal
Freebase Suggest in Drupal
jQuery Freebase Drupal Module
if (module_exists('jquery_freebase')) {
     jq_add('freebase');
     drupal_add_js(

      ...
RDF Graphs
 Carrie
              Starred In   Star Wars
 Fisher



              Starred In



Harrison                   ...
SPARQL Query
            Carrie
                        Starred In   Star Wars
            Fisher



                     ...
SPARQL Query
        carrie_fisher      starred_in         star_wars
       harrison_ford      starred_in         star_wars...
Review:
Why is identity important?
Data Integration
        B                            B



A                            A


        C                     ...
W3C Vision
    Tim Berners-Lee’s
    Giant Global Graph
The Layer Cake




  The Cake
     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 Cloud
        (LOD)
Drupal is a part of the LOD Cloud




     http://drupal.deri.ie/cheese/node/20
Drupal is a part of the LOD Cloud
<http://drupal.deri.ie/cheese/node/20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>...
RDF in HTML = RDFa
SUBJECT
@about - a URI, stating the RDF subject

PREDICATE
@rel - CURIEs, expressing relationships betw...
RDF in HTML = RDFa
SUBJECT
@about - a URI, stating the RDF subject

PREDICATE
@rel - CURIEs, expressing relationships betw...
RDF in HTML = RDFa
SUBJECT
@about - a URI, stating the RDF subject

PREDICATE
@property - CURIEs, expressing relationships...
What “concepts” are covered in content
                                  Like existing tagging,
                          ...
Drupal Module
<resource>

                                                                    tagged




                               ...
Drupal and the Semantic Web
Drupal and the Semantic Web
Drupal and the Semantic Web
Drupal and the Semantic Web
Drupal and the Semantic Web
Drupal and the Semantic Web
Drupal and the Semantic Web
Drupal and the Semantic Web
Drupal and the Semantic Web
Drupal and the Semantic Web
Drupal and the Semantic Web
Drupal and the Semantic Web
Upcoming SlideShare
Loading in...5
×

Drupal and the Semantic Web

3,801

Published on

Presented at Drupal Camp SF (6/6/09)

Three part presentation:

1) Provides an overview of how semantic technologies can simplify data management and integration.

2) Gives a brief introduction to RDF/RDFa.

3) Looks at the Drupal RDF module, SPARQL module, Exhibit module, Freebase Suggest and the upcoming Common Tag module.

Published in: Technology
1 Comment
19 Likes
Statistics
Notes
  • I've heard the real name for this is Dripple Camp.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
3,801
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
231
Comments
1
Likes
19
Embeds 0
No embeds

No notes for slide

Drupal and the Semantic Web

  1. 1. Drupal Camp Jamie Taylor
  2. 2. What can semantic web technologies do for you?
  3. 3. Tag your content
  4. 4. Topic Hubs
  5. 5. RDFa Powered Search
  6. 6. Data Exploration Widgets
  7. 7. Why Semantics? A Brief History of Data Modeling Photo CC-BY: http://en.wikipedia.org/wiki/File:McDonalds_on_Interstate_44.jpg
  8. 8. Ugly Tabular Data
  9. 9. A Simple Restaurant Schema
  10. 10. A Simple Restaurant Schema
  11. 11. Big Ugly Schema
  12. 12. What Went Wrong? Scripting Languages facilitate change ....where is the data model that does the same? Things change Requirements change User expectations change Data structures change Our data models aren’t keeping up
  13. 13. Graph Data Models Deli Liiama Name Cuisine S1 Deli Price $
  14. 14. Graph Data Models Peking Inn Deli Liiama Name Cuisine Name S1 Deli Price F7 $ Location Cuisine Location Chinese Contained-by San Francisco S4 Name North Beach
  15. 15. Extending Graph Data Models Deli Liiama Urban Chic Name Decor Cuisine S1 Deli Music Price $ Location Live DJ Contained-by San Francisco S4 Name North Beach
  16. 16. Integrating Graph Data Models Deli Liiama Name Deli Liiama Name A2 Cuisine S1 Deli Price OnTap $ Z6 Brand Leinenkugel Brand Pabst BR
  17. 17. Semantic Representation Relationships are represented explicitly Schema can be represented as a graph Data integration is the union of two graphs This makes creating, extending, and combining data much easier than before
  18. 18. Plugable Data Data Semantics allows an Data application to utilize unanticipated new Data Data data sources
  19. 19. Plugable Data
  20. 20. Data Portability Data Data Semantics allows data to be utilized by Data unanticipated new applications Data
  21. 21. Data Portability http://dev.mqlx.com/~jamie/simile/timeline.html
  22. 22. Data Portability
  23. 23. Why Does This Work? Semantics facilitate shared meaning through • Subject Identity • Strong and Consistent Semantics • Open APIS + Open Data These principles make it much easier to extend, combine, and integrate data
  24. 24. Just enough RDF
  25. 25. Just Enough RDF RDF is a Data Model A very simple model!
  26. 26. Cosmos was written by Carl Sagan
  27. 27. (Cosmos) (was written by) (Carl Sagan)
  28. 28. Subject Predicate Object (Cosmos) (was written by) (Carl Sagan)
  29. 29. Subject Predicate Object (Cosmos) (was written by) (Carl Sagan) author Carl Cosmos Sagan
  30. 30. Subject Which Cosmos? (Cosmos)
  31. 31. Subject Which Cosmos? (Cosmos)
  32. 32. Identifiers are Everywhere
  33. 33. The humble URI •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
  34. 34. Subject Which Cosmos? (Cosmos) http://rdf.freebase.com/ns/authority.openlibrary.book.OL3568862M
  35. 35. What do you mean, author? http://rdf.freebase.com/ns/book.written_work.author author Carl Cosmos Sagan vocabulary
  36. 36. There are billions of Carl Sagans... http://rdf.freebase.com/ns/en.carl_sagan Cosmos author
  37. 37. 0 ” 9 8 d “1 h e b lis p u author Carl Cosmos Sagan
  38. 38. RDF Data Model Nodes (“Subjects”) connect via Links (“Predicates”) to Objects • either Nodes or Literals
  39. 39. Expressions of RDF RDF has many (inconvenient) serializations •RDF-XML •N3 •Turtle •NTriples •RDFa
  40. 40. In N-Triples: <http://rdf.freebase.com/ns/authority.openlibrary.book.OL3568862M> <http://rdf.freebase.com/ns/book.written_work.author> <http://rdf.freebase.com/ns/en.carl_sagan> . author Carl Cosmos Sagan
  41. 41. In N-Triples: <http://rdf.freebase.com/ns/authority/openlibrary/book/OL3568862M> <http://rdf.freebase.com/ns/book.written_work.date_of_first_publication> “1980” . Cosmos published “1980”
  42. 42. URIs provide identity http://rdf.freebase.com/ns/en.robert_cook Stability Simplicity Manageability PURL.org
  43. 43. Not all URL’s are good identifiers
  44. 44. A socially managed semantic database
  45. 45. All objects in Freebase have strong identifiers http://rdf.freebase.com/ns/en.yorkie
  46. 46. Types of things in Freebase
  47. 47. 5,203,825 Topics 14,110,006 Named Entites
  48. 48. Sources of Freebase Data
  49. 49. Freebase is user writable
  50. 50. schema = vocabulary
  51. 51. Freebase Suggest
  52. 52. Freebase Suggest in Drupal
  53. 53. Freebase Suggest in Drupal
  54. 54. jQuery Freebase Drupal Module if (module_exists('jquery_freebase')) { jq_add('freebase'); drupal_add_js( quot;$(document).ready(function() { $('#edit-taglabel').freebaseSuggest({}) .bind('fb-select', function(e, data) { $('#edit-taguri').val('http://rdf.freebase.com/ns/' + new String(data.id).substring(1).replace(///g, '.'));}) });quot;, 'inline' ); } http://drupal.org/project/jquery_freebase Thomas Bonte - Belgium
  55. 55. RDF Graphs Carrie Starred In Star Wars Fisher Starred In Harrison Blade Starred In Ford Runner Starred In Daryl Hannah
  56. 56. SPARQL Query Carrie Starred In Star Wars Fisher Starred In Harrison Blade Starred In Ford Runner Starred In Daryl Hannah carrie_fisher starred_in star_wars harrison_ford starred_in star_wars harrison_ford starred_in blade_runner daryl_hannah starred_in blade_runner
  57. 57. SPARQL Query carrie_fisher starred_in star_wars harrison_ford starred_in star_wars harrison_ford starred_in blade_runner daryl_hannah starred_in blade_runner SELECT ? actor WHERE { fb:harrison_ford fb:starred_in ?movie . ?actor fb:starred_in ?movie . FILTER (fb:harrison_ford != ?actor) }
  58. 58. Review: Why is identity important?
  59. 59. Data Integration B B A A C C D E E F
  60. 60. W3C Vision Tim Berners-Lee’s Giant Global Graph
  61. 61. The Layer Cake The Cake taken from http://www.w3.org/2007/Talks/0130-sb-W3CTechSemWeb/layerCake-4.png
  62. 62. Take What You Need taken from http://www.w3.org/2007/Talks/0130-sb-W3CTechSemWeb/layerCake-4.png
  63. 63. Linked Open Data Cloud (LOD)
  64. 64. Drupal is a part of the LOD Cloud http://drupal.deri.ie/cheese/node/20
  65. 65. Drupal is a part of the LOD Cloud <http://drupal.deri.ie/cheese/node/20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://drupal.deri.ie/cheese/ns#Cheese> . <http://drupal.deri.ie/cheese/node/20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <ov:Cheese> . <http://drupal.deri.ie/cheese/node/20> <http://drupal.deri.ie/cheese/ns#cheese_Title> quot;Ardrahan Cheesequot; . <http://drupal.deri.ie/cheese/node/20> <http://drupal.deri.ie/cheese/ns#created> quot;2009-01-16T11:05:11Zquot;^^http://www.w3.org/2001/ XMLSchema#dateTime . <http://drupal.deri.ie/cheese/node/20> <http://drupal.deri.ie/cheese/ns#changed> quot;2009-04-27T13:20:43Zquot;^^http://www.w3.org/2001/ XMLSchema#dateTime . <http://drupal.deri.ie/cheese/node/20> <http://drupal.deri.ie/cheese/ns#cheese_Source_milk> quot;cowquot; . <http://drupal.deri.ie/cheese/node/20> <http://drupal.deri.ie/cheese/ns#cheese_Country_origin> quot;Irelandquot; . <http://drupal.deri.ie/cheese/node/20> <ov:origin> quot;Irelandquot; . <http://drupal.deri.ie/cheese/node/20> <http://drupal.deri.ie/cheese/ns#cheese_Picture> <http://drupal.deri.ie/cheese/sites/default/files/ Ardrahan_cheese_1.jpg> . <http://drupal.deri.ie/cheese/node/20> <http://xmlns.com/foaf/0.1/depiction> <http://drupal.deri.ie/cheese/sites/default/files/ Ardrahan_cheese_1.jpg> . <http://drupal.deri.ie/cheese/node/20> <http://drupal.deri.ie/cheese/ns#cheese_Description> quot;Ardrahan is a type of semi-soft cheese with a pungent aroma, Ardrahan cheese has buttery textured honey-coloured centre with a complex delicate flavour. It has a washed rind which grows into a golden colour, and its size and weight tend to vary slightly due to the fact that it is a hand-made product. In general the large wheel weighs about 1.5 kg. There is also a small consumer wheel which weighs 300g. It is yellow-coloured. Ardrahan also develops a nutty flavour with maturity. It has a unique flavour that lingers, leaving a very pleasant after-taste. It contains only 25% fat approximately. It is hand made using traditional methods and only whole milk and vegetarian rennet are used. quot; . <http://drupal.deri.ie/cheese/node/20> <http://purl.org/dc/elements/1.1/description> quot;Ardrahan is a type of semi-soft cheese with a pungent aroma, Ardrahan cheese has buttery textured honey-coloured centre with a complex delicate flavour. It has a washed rind which grows into a golden colour, and its size and weight tend to vary slightly due to the fact that it is a hand-made product. In general the large wheel weighs about 1.5 kg. There is also a small consumer wheel which weighs 300g. It is yellow-coloured. Ardrahan also develops a nutty flavour with maturity. It has a unique flavour that lingers, leaving a very pleasant after-taste. It contains only 25% fat approximately. It is hand made using traditional methods and only whole milk and vegetarian rennet are used. quot; . http://xxx/?q=node/X/rdf
  66. 66. RDF in HTML = RDFa SUBJECT @about - a URI, stating the RDF subject PREDICATE @rel - CURIEs, expressing relationships between two resources @property - CURIEs, expressing relationships between a resource and a literal @rev - CURIEs, expressing reverse relationship between two resources OBJECT @content - a string, representing a literal RDF object @href - a URI resource expressing the RDF object (as in-line clickable) @src - a URI resource expressing the RDF object (as in-line embedded item) @resource - a URI resource expressing the RDF object Special Predicate @typeof - CURIEs expressing the RDF type of a subject (rdf:type)
  67. 67. RDF in HTML = RDFa SUBJECT @about - a URI, stating the RDF subject PREDICATE @rel - CURIEs, expressing relationships between two resources OBJECT @resource - a URI resource expressing the RDF object <div xmlns:fb=”http://rdf.freebase.com/ns/” about=”http://rdf.freebase.com/ns/en.jamie_taylor” rel=fb:people.person.place_of_birth> <span resource=”http://rdf.freebase.com/ns/en.saint_paul”/> </div>
  68. 68. RDF in HTML = RDFa SUBJECT @about - a URI, stating the RDF subject PREDICATE @property - CURIEs, expressing relationships between a resource and a literal OBJECT @content - a string, representing a literal RDF object <div xmlns:fb=”http://rdf.freebase.com/ns/” about=”http://rdf.freebase.com/ns/en.carl_sagan” property=fb:people.person.date_of_birth> <span content=”1934-11-09”/> </div>
  69. 69. What “concepts” are covered in content Like existing tagging, but with strong identifiers! <resource> tagged Tag taggingDate quot;2001-01-01quot; label means quot;textquot; <resource> Strong identifier goes here!
  70. 70. Drupal Module
  71. 71. <resource> tagged Tag taggingDate label means <div class=quot;rdfaquot; quot;textquot; <resource> xmlns:ctag=quot;http://commontag.org/ns#quot;> NASA's <a typeof=quot;ctag:Tagquot; rel=quot;ctag:meansquot; href=quot;http://rdf.freebase.com/ns/en.phoenix_mars_missionquot; property=quot;ctag:labelquot;>Phoenix Mars Lander</a> has deployed its robotic arm. </div>
  1. A particular slide catching your eye?

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

×