The Semantic Web and Drupal 7 - Loja 2013

1,637 views

Published on

Presentation given at Drupal Summit Latino 2013 in Loja, Ecuador, covering the topic of the Semantic Web and Drupal 7.

Published in: Technology

The Semantic Web and Drupal 7 - Loja 2013

  1. 1. The Semantic Web and Drupal 7Stéphane CorlosquetDrupal Summit Latino – Loja, EcuadorMarch, 2013
  2. 2. About the speaker● Stéphane “scor” Corlosquet ● 7 years with Drupal ● Software engineer at Acquia ● Drupal 7 RDF core maintainer ● Drupal Security Team member ● Co-authored the Definitive Guide to Drupal 7 ● Contrib modules: RDF Extensions, SPARQL, schema.org, WebID ● Member of the RDFa WG at W3C
  3. 3. The Semantic Web
  4. 4. The Web today
  5. 5. Many information silosImage credits: www.pidgintech.com
  6. 6. Many isolated and disparate communitiesImage credits: www.pidgintech.com
  7. 7. Growing amount of information● Blogs, News, Comments● Social platforms: Facebook, Google plus● Everyday more and more content is published● Desktop, laptops, tablets, smartphones...● Sensor data for weather, traffic, healthcare● Billions of public pages● Deep web?
  8. 8. What do machines see?
  9. 9. Challenge:How can machines help ussearch all this information?
  10. 10. Vision of the Semantic Web● Transition to the Giant Global Graph ● WWW = content+links ● GGG = WWW+relationships+descriptions● Universal medium for data, information and knowledge exchange
  11. 11. Evolution of the Web
  12. 12. The One Machine● All devices connected ● Personal computers ● Data servers ● Cell phones ● PDAs ● RFID tags http://www.kk.org/thetechnium/archives/2007/11/dimensions_of_t.php
  13. 13. Key● Agree on Standards● Open Data
  14. 14. Rich Snippets
  15. 15. Google
  16. 16. Yahoo!
  17. 17. Bing
  18. 18. Why Structured Data in HTML● Helps machines extract relevant data from HTML● Can make use of this data in new ways: –enhanced search results – Knowledge graph● Search engines only index HTML
  19. 19. Structured Data in HTML● HTML attributes● Syntaxes – Microformats (@class, @rel) – RDFa (@property, @typeof, @resource…) – Microdata (@itemscope, @itemtype, @itemprop, …)
  20. 20. Structured Data in HTML● Evolution and cross-syntax influence
  21. 21. Schema.org
  22. 22. Schema.org● Describe the type of your content (Person, Event, Recipe, Product, Book, Movie, etc.) – 416 types and counting● Each type has a set of properties – Common properties: name, description, image, url – Specific properties depending on the type (see type page on schema.org) – 544 properties and counting
  23. 23. Credits: Dan Brickley - link.
  24. 24. Schema.org
  25. 25. How does schema.org apply to Drupal?● Content types
  26. 26. How does schema.org apply to Drupal?● From content types to RDF
  27. 27. Schema.org module for Drupal● Map your content types and fields to the schema.org terms http://drupal.org/project/schemaorg
  28. 28. Content types and Fields
  29. 29. Content types and Fields
  30. 30. Content types and Fields
  31. 31. Example: Event
  32. 32. Rich Snippet testing tool● http://www.google.com/webmasters/tools/richsnippets
  33. 33. Examples● Events – “force11 events”: http://goo.gl/VVhNM – DrupalCon Munich: http://goo.gl/jgMvw – University of Waterloo: http://goo.gl/Df9hp● Person – DGD7 – Jacine Luisi: http://t.co/rTK8N9K2 – Stéphane Corlosquet: http://goo.gl/9dWdL
  34. 34. Drupal, rNews and RDFaOpen Publish● Free Drupal distribution for building News sites● rNews support in RDFa● Download
  35. 35. Useful modules● http://drupal.org/project/schemaorg – UI for mapping content types and fields to schema.org – Documentation on drupal.org – Screencast + examples● http://drupal.org/project/rdfa – Implements the latest RDFa 1.1 (Drupal core is 1.0) – HTML5 and RDFa – Under development● http://drupal.org/project/microdata – Standalone module – HTML5 Microdata
  36. 36. Schema.org module Play time! http://bit.ly/schema-eventhttp://www.google.com/webmasters/tools/richsnippets
  37. 37. Beyond SEO:How is RDF architected in Drupal 7
  38. 38. History of RDF in Drupal● rdf.php (2000, Dries)● FOAF, vCard (2004, walkah)● Relationship (2005, dman)● Semantic Search (2006, hendler)● RDF (2007, Arto)● OpenCalais (febbraro, 2008)● RDF CCK (2008, scor)
  39. 39. Architecture● User driven data model● Content type => RDF class● Field => RDF property● Node => RDF resource http://en.wikipedia.org/wiki/File:Oriente_Station_Lisboa_roof.jpg
  40. 40. Content types and Fields
  41. 41. Content types and Fields
  42. 42. Node
  43. 43. Drupal 7 and RDF● The RDF mapping API allows any vocabulary● Default mappings on blogs, forums, comments, etc. using FOAF, SIOC, DC, SKOS● Drupal 7 core outputs these mappings in RDFa● Mappings can be changed to include other vocabularies like schema.org
  44. 44. Drupal 7 default RDF mappings
  45. 45. Drupal 7 core RDF limitations● No schema.org out of the box● No UI for managing the RDF mappings● Only core fields are supported (text, file, image) – No support for contrib fields: addressfield, fivestar● No native support for Views or Panels – Display suite 2.0 is OK● Some contrib modules can help● Drupal 8 to fix these many of these issues
  46. 46. Drupal 7 and RDF● Contributed module for more features ● RDF Extensions ● Serialization formats: RDF/XML, Turtle, N-Triples ● Mapping UI ● SPARQL ● Expose Drupal RDF data in a SPARQL Endpoint ● SPARQL Views ● Display remote RDF data in Drupal using SPARQL ● JSON-LD ● Expose Drupal RDF data as JSON-LD (CORS-enabled) ● Features and packaging ● Build distributions / deployment workflow
  47. 47. SPARQL Endpoint● Indexing http://drupal.org/project/sparql
  48. 48. SPARQL Endpoint● Public endpoint available at /sparql● http://prefix.cc/sioc,rnews.sparql
  49. 49. RDFa 1.1● Published as W3C Recommendation● RDFa Lite● RDFa 1.1 Full● Leaner markup● http://rdfa.info/play/
  50. 50. RDFa 1.1● Works with HTML5● No dependency on XHTML● HTML5 doctype● Popular themes have been updated (Omega, Zen, Adaptive Themes)
  51. 51. DemosrNews by International PressTelecommunications Council (IPTC) – Open Publish PREFIX rnews: <http://iptc.org/std/rNews/2011-10-07#> SELECT * WHERE { ?s a rnews:Article; rnews:name ?title. }
  52. 52. JSON-LD in Drupal● Client side as well as server side friendly● Browser Scripting: – Native javascript format – RDFa API in the DOM● Data can be fetched from anywhere: – Cross-Origin Resource Sharing (CORS) enabled● Client can mash data● http://drupal.org/project/jsonld
  53. 53. Demos● Occupy Directory – http://directory.occupy.net/occupations – JSON-LD: http://directory.occupy.net/node/19652.jsonld● Federated General Assembly – Drupal distribution for occupy movement – http://wiki.occupy.net/wiki/Federated_General_Assembly
  54. 54. Domeo + Drupal● Data mash up from independent, but related sources
  55. 55. Domeo + Drupal● Data mash up from independent, but related sources
  56. 56. Thanks!● Stéphane Corlosquet: scorlosquet@gmail.com – @scorlosquet – http://openspring.net/

×