Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Semantic Web Intro - St. Patrick's Day 2016 Update

800 views

Published on

This presentation was delivered to a Database class at the University of Montana on March 16, 2016. It's a mix of previous presentations with updated content.

Published in: Data & Analytics
  • Be the first to comment

Semantic Web Intro - St. Patrick's Day 2016 Update

  1. 1. ©2016 Eric Axel Franzon Introduction to Semantic Web (Meets St. Patrick’s Day) Eric Franzon Smart Data SEO
  2. 2. ©2016 Eric Axel Franzon Semantic Web is like the harmonica
  3. 3. ©2016 Eric Axel Franzon Easy to play; takes work to master.
  4. 4. ©2016 Eric Axel Franzon What we’ll discuss • What is Semantic Web? • Who’s using it? • What makes it work? • What can you do with it?
  5. 5. ©2016 Eric Axel Franzon What is Semantic Web? • A Web-scale architecture • A metadata technology • A layer of meaning on the Web • In use TODAY!
  6. 6. ©2016 Eric Axel Franzon What is it not? • A software package • Something that will ever be “done” • A replacement for the current Web
  7. 7. ©2016 Eric Axel Franzon What is it not? • Limited to the public WWW • A pipe dream • A silver bullet • HAL 9000 or Skynet
  8. 8. ©2016 Eric Axel Franzon • Globally • Inexpensively • In Real-Time Behind the Firewall (public) World Wide Web HTTP HTML Based on W3C Standards
  9. 9. ©2016 Eric Axel Franzon • Globally • Inexpensively • In Real-Time Behind the Firewall Semantic Web RDF SPARQL OWL Based on W3C Standards
  10. 10. ©2016 Eric Axel Franzon History…
  11. 11. ©2016 Eric Axel Franzon
  12. 12. ©2016 Eric Axel Franzon
  13. 13. ©2016 Eric Axel Franzon
  14. 14. ©2016 Eric Axel Franzon
  15. 15. ©2016 Eric Axel Franzon
  16. 16. ©2016 Eric Axel Franzon
  17. 17. ©2016 Eric Axel FranzonIoT Enhancements by Eric Franzon IoT
  18. 18. ©2016 Eric Axel Franzon • to connect DATA • to make information interpretable by machines Semantic Web Standards are used…
  19. 19. ©2016 Eric Axel Franzon Machine Interpretation as the Web Evolves…
  20. 20. ©2016 Eric Axel Franzon Web 1.0 – Linking Documents
  21. 21. ©2016 Eric Axel Franzon Web 1.0 “I see: characters + formatting + images” --my Computer
  22. 22. ©2016 Eric Axel Franzon Web 1.0 – Linking Documents Web 2.0 – Linking People
  23. 23. ©2016 Eric Axel Franzon Web 2.0 “I see: characters + formatting + images” --my Computer
  24. 24. ©2016 Eric Axel Franzon It’s hard to interpret meaning when all you see are characters, images, and formatting. Context is critical.
  25. 25. ©2016 Eric Axel Franzon Web 1.0 – Linking Documents Web 2.0 – Linking People Web 3.0 – Linking Data
  26. 26. ©2016 Eric Axel Franzon Web 3.0 – Linking Data Title Price Format Cover Band “I see: things + relationships. This is about a collection of music.”
  27. 27. ©2016 Eric Axel Franzon Linking Open Data
  28. 28. ©2016 Eric Axel Franzon Linking Open Data Project May, 2007
  29. 29. ©2016 Eric Axel Franzon July 2009
  30. 30. ©2016 Eric Axel Franzon September 2011
  31. 31. ©2016 Eric Axel Franzon August 2014
  32. 32. ©2016 Eric Axel Franzon Data from these trusted sources is available for you to use in your applications TODAY. Data you can LINK to.
  33. 33. ©2016 Eric Axel Franzon Semantic Data that is machine READABLE. …and machine INTERPRETABLE!
  34. 34. ©2016 Eric Axel Franzon Who’s Using Semantic Web Standards?
  35. 35. ©2016 Eric Axel Franzon • Healthcare / Life Sciences • Financial Services • Manufacturing / Retail • Marketing, Advertising • SEO/SEM • Libraries • Archives • Museums • Governments • Enterprise Software Vendors Who’s Using Sem Web?
  36. 36. ©2016 Eric Axel Franzon Who’s Using Sem Web?
  37. 37. ©2016 Eric Axel Franzon Who’s Using Sem Web?
  38. 38. ©2016 Eric Axel Franzon Who’s Using Sem Web?
  39. 39. ©2016 Eric Axel Franzon What is schema.org? “…A collection of schemas, i.e., html tags, that webmasters can use to markup their pages in ways recognized by major search providers.”
  40. 40. ©2016 Eric Axel Franzon e.g. Product Markup
  41. 41. ©2016 Eric Axel Franzon What is schema.org? “…A collection of schemas, i.e., html tags, that webmasters can use to markup their pages in ways recognized by major search providers.”
  42. 42. ©2016 Eric Axel Franzon What it looks like
  43. 43. ©2016 Eric Axel Franzon What is schema.org? “…A collection of schemas, i.e., html tags, that webmasters can use to markup their pages in ways recognized by major search providers.”
  44. 44. ©2016 Eric Axel Franzon What it looks like
  45. 45. ©2016 Eric Axel Franzon e.g. TV Episode Markup
  46. 46. ©2016 Eric Axel Franzon What it looks like
  47. 47. ©2016 Eric Axel Franzon What it looks like
  48. 48. ©2016 Eric Axel Franzon What it looks like
  49. 49. ©2016 Eric Axel Franzon What makes SemWeb work?
  50. 50. ©2016 Eric Axel Franzon The Technologies of RDBMS • Data • Schemas • Query Language
  51. 51. ©2016 Eric Axel Franzon RDBMS Data t_people Name City State Post code Sean Bozeman MT 59715 Erika Missoula MT 59801
  52. 52. ©2016 Eric Axel Franzon RDBMS Schema
  53. 53. ©2016 Eric Axel Franzon RDBMS Query Language: SQL SELECT isbn, title, price, price * 0.06 AS sales_tax FROM Book WHERE price > 100.00 ORDER BY title;
  54. 54. ©2016 Eric Axel Franzon The Technologies of SemWeb • Data • Schemas • Query Language
  55. 55. ©2016 Eric Axel Franzon The Data Language Resource Description Framework
  56. 56. ©2016 Eric Axel Franzon “RDF is good for distributing data across the Web and pretending it’s in one place.” -Dean Allemang, Author, Semantic Web for the Working Ontologist
  57. 57. ©2016 Eric Axel Franzon • to connect DATA • to make it interpretable by machines RDF is used…
  58. 58. ©2016 Eric Axel Franzon 1. By uniquely identifying THINGS 2. By uniquely identifying RELATIONSHIPS 3. By using TRIPLES Machine Interpretable - How? (RDF is made up of triples!)
  59. 59. ©2016 Eric Axel Franzon So, what’s a THING? 1. By uniquely identifying THINGS Machine Interpretable - How?
  60. 60. ©2016 Eric Axel Franzon A THING is anything that can be uniquely identified by a URI or a literal (string) Me My postal code The White House L.A. County’s sales tax rate http://about.me/eric.franzon#me http://www.city-data.com/zips/59801.html Lat: 38.89859 Long: -77.035971 9.750 % http://ericfranzon.com/harpcase.jpg
  61. 61. ©2016 Eric Axel Franzon This is a collection of THINGS: t_people Name City State Post code Sean Bozeman MT 59715 Erika Missoula MT 59801
  62. 62. ©2016 Eric Axel Franzon Who’s your daddy? 1. By uniquely identifying THINGS 2. By uniquely identifying RELATIONSHIPS Machine Interpretable - How?
  63. 63. ©2016 Eric Axel Franzon Is Father of <owl:ObjectProperty rdf:ID="isFather"> <rdfs:domain rdf:resource="#Person"/> <rdfs:range rdf:resource="#Person"/> </owl:ObjectProperty> http://ericaxel.com/eric.rdf#me ns:isFather
  64. 64. ©2016 Eric Axel Franzon 1. By uniquely identifying THINGS 2. By uniquely identifying RELATIONSHIPS 3. By using TRIPLES What’s a triple? Machine Interpretable - How?
  65. 65. ©2016 Eric Axel Franzon The Building block of RDF The Triple
  66. 66. ©2016 Eric Axel Franzon Predicate Triples? It’s Elementary! (School) song has title. Relationship That is a Triple!
  67. 67. ©2016 Eric Axel Franzon “This band recorded a song.” “This recording is part of a collection.” “This item has a barcode.” “I like blues.” “I like B.L.U.E.S.” “This image can be used non-commercially.” “My email address is eric@smartdataseo.com.” Triples? It’s Elementary!
  68. 68. ©2016 Eric Axel Franzon Song Author Title PublisherLyrics A Simple Graph
  69. 69. ©2016 Eric Axel Franzon Visualization of graph from Pharma space - Cytoscape.org
  70. 70. ©2016 Eric Axel Franzon Where does one store triples? In a “triple store”• Native Semantic Web stores • RDBMS databases • As native files (.rdf) • Woven into documents (RDFa) • Generated on the fly
  71. 71. ©2016 Eric Axel Franzon Just so you know… There are many ways of representing RDF: • RDF/XML • N3 • JSON-LD • N-Triples • Turtle • RDFa Each has pros and cons, but they all connect THINGS and RELATIONSHIPS into TRIPLES
  72. 72. ©2016 Eric Axel Franzon The Technologies of SemWeb • Data • Schemas • Query Language
  73. 73. ©2016 Eric Axel Franzon The Schemata Linked Data schemas consist of: Your RDF relationships (predicates) + Relationship descriptions
  74. 74. ©2016 Eric Axel Franzon SemWeb Schemata id First Name Last Name 1 Tom Stockburger Schema Data Initial Schema hasID hasFirstName hasLastName Tom Stockburger1 owl:sameAs hasSurnameRelationship description
  75. 75. ©2016 Eric Axel Franzon 1. Resource Description Framework Schema (RDFS): Simple, hierarchical classes 2. Simple Knowledge Organization System (SKOS): Port taxonomies to the Semantic Web 3. Web Ontology Language (OWL): Complex logical relationships Relationship Descriptions
  76. 76. ©2016 Eric Axel Franzon Worldcat.org • A project of the OCLC
  77. 77. ©2016 Eric Axel Franzon Vocabulary Combination “in the wild”
  78. 78. ©2016 Eric Axel Franzon Vocabulary Combination “in the wild”
  79. 79. ©2016 Eric Axel Franzon The Technologies of SemWeb • Data • Schemas • Query Language (…or “What can you do with it?”)
  80. 80. ©2016 Eric Axel Franzon The query language SPARQL Protocol And RDF Query Language SPARQL
  81. 81. ©2016 Eric Axel Franzon SPARQL allows us to: • Pull values from structured & semi-structured data • Explore data by querying unknown relationships • Perform complex joins of disparate databases in a single, simple query • Transform RDF data from one vocabulary to another --Lee Feigenbaum, Cambridge Semantics
  82. 82. ©2016 Eric Axel Franzon Eric
  83. 83. ©2016 Eric Axel Franzon <hasDepiction> Eric
  84. 84. ©2016 Eric Axel Franzon <hasLicense> <hasDepiction> Eric
  85. 85. ©2016 Eric Axel Franzon <hasLicense> <hasDepiction> <likes> Eric
  86. 86. ©2016 Eric Axel Franzon <hasLicense> <hasDepiction> <likes> <likes> Eric
  87. 87. ©2016 Eric Axel Franzon <hasLicense> <hasDepiction> <likes> <likes> <likes> Eric
  88. 88. ©2016 Eric Axel Franzon Chicago, Illinois On the shores of Lake Michigan, Chicago is one of the major… <hasLicense> <wrote> <hasDepiction> <likes> <likes> <likes> Eric Ann
  89. 89. ©2016 Eric Axel Franzon Chicago, Illinois On the shores of Lake Michigan, Chicago is one of the major… <hasLicense> <wrote> <isAbout> <hasDepiction> <likes> <likes> <likes> Eric Ann
  90. 90. ©2016 Eric Axel Franzon Chicago, Illinois On the shores of Lake Michigan, Chicago is one of the major… <hasLicense> <wrote> <isAbout> <hasDepiction> <likes> <likes> <likes> Eric Ann <hasLicense>
  91. 91. ©2016 Eric Axel Franzon Chicago, Illinois On the shores of Lake Michigan, Chicago is one of the major… <hasLicense> <hasLicense> <wrote> <isAbout> <livedIn> <hasDepiction> <likes> <likes> <likes> Eric Ann
  92. 92. ©2016 Eric Axel Franzon What can we ask of a system like this?
  93. 93. ©2016 Eric Axel Franzon Chicago, Illinois On the shores of Lake Michigan, Chicago is one of the major… <hasLicense> <hasLicense> <wrote> <isAbout> <livedIn> <hasDepiction> <likes> <likes> <likes> Eric Ann
  94. 94. ©2016 Eric Axel Franzon Chicago, Illinois On the shores of Lake Michigan, Chicago is one of the major… <hasLicense> <hasLicense> <wrote> <isAbout> <livedIn> <hasDepiction> <likes> <likes> <likes> What does Eric Like? Eric Ann
  95. 95. ©2016 Eric Axel Franzon Chicago, Illinois On the shores of Lake Michigan, Chicago is one of the major… <hasLicense> <hasLicense> <wrote> <isAbout> <livedIn> <hasDepiction> <likes> <likes> <likes> What has a Creative Commons License? Eric Ann
  96. 96. ©2016 Eric Axel Franzon Chicago, Illinois On the shores of Lake Michigan, Chicago is one of the major… <hasLicense> <hasLicense> <wrote> <isAbout> <livedIn> <hasDepiction> <likes> <likes> <likes> What license does THIS document have? Eric Ann
  97. 97. ©2016 Eric Axel Franzon Chicago, Illinois On the shores of Lake Michigan, Chicago is one of the major… <hasLicense> <hasLicense> <wrote> <isAbout> <livedIn> <hasDepiction> <likes> <likes> <likes> What is liked by anyone who has lived somewhere that is the subject of a document Ann has written? Eric Ann
  98. 98. ©2016 Eric Axel Franzon A quick note about database types…
  99. 99. ©2016 Eric Axel Franzon Trees and Tables t_people Name City State Post code Bob Cat Bozeman MT 59715 Monte Missoula MT 59801 people MonteBob Cat Bozeman MT 59715 City State Post code Missoula MT 59801 City State Post code
  100. 100. ©2016 Eric Axel Franzon Trees and Tables – Problem 1 t_people Name City State Post code flag Bob Cat Bozeman MT 59715 1 Monte Missoula MT 59801 people MonteBob Cat Bozeman MT 59715 City State Post code Missoula MT 59801 City State Post code flag 1 Adding partial data to tables leads to sparseness
  101. 101. ©2016 Eric Axel Franzon Trees and Tables – Problem 2 t_people Name City State Post code Monte Missoula MT 59801 Erika Missoula MT 59801 people ErikaMonte Missoula MT 59801 City State Post code Missoula MT 59801 City State Post code Common data leads to (lots!) of duplication
  102. 102. ©2016 Eric Axel Franzon Graphs people ErikaMonte City State Post code Missoula MT 59801 City State Post code flag 1
  103. 103. ©2016 Eric Axel Franzon
  104. 104. ©2016 Eric Axel Franzon SPARQL Queries
  105. 105. ©2016 Eric Axel Franzon SPARQL Example #1 (specific endpoint – dbPedia) Artists/Albums produced by Pharrell PREFIX d: <http://dbpedia.org/ontology/> SELECT ?artistName ?albumName WHERE { ?album d:producer :Pharrell_Williams . ?album d:musicalArtist ?artist . ?album rdfs:label ?albumName . ?artist rdfs:label ?artistName . FILTER ( lang(?artistName) = "en" ) FILTER (lang(?albumName) = "en" ) }
  106. 106. ©2016 Eric Axel Franzon SPARQL Example #1
  107. 107. ©2016 Eric Axel Franzon SPARQL Example #1
  108. 108. ©2016 Eric Axel Franzon
  109. 109. ©2016 Eric Axel Franzon SPARQL Example #2 (specific endpoint – dbPedia) Musical artists who were born in or have a hometown in Ireland and the acts they performed with.
  110. 110. ©2016 Eric Axel Franzon SPARQL Example #2 (specific endpoint – dbPedia) PREFIX dbo: <http://dbpedia.org/ontology/> SELECT DISTINCT ?name ?person ?artist WHERE { ?person foaf:name ?name . ?person rdf:type <http://dbpedia.org/ontology/MusicalArtist> . ?person <http://dbpedia.org/ontology/associatedMusicalArtist> ?artist . { ?person dbo:hometown <http://dbpedia.org/resource/Republic_of_Ireland> . } UNION { ?person dbo:birthPlace <http://dbpedia.org/resource/Republic_of_Ireland> . } } ORDER BY ?name
  111. 111. ©2016 Eric Axel Franzon SPARQL Example #2
  112. 112. ©2016 Eric Axel Franzon SPARQL Example #2 A major retailer ran this query… associated it with the catalog of albums it sells… and delivered a set of recommended purchases for St. Patrick’s Day!
  113. 113. ©2016 Eric Axel Franzon
  114. 114. ©2016 Eric Axel Franzon
  115. 115. ©2016 Eric Axel Franzon • Show me all landlocked countries • With populations > 50,000 • Display the country names in English • Eliminate duplicates PREFIX type: <http://dbpedia.org/class/yago/> PREFIX prop: <http://dbpedia.org/property/> SELECT ?country_name ?population WHERE { ?country a type:LandlockedCountries ; rdfs:label ?country_name ; prop:populationEstimate ?population . FILTER (?population > 15000000 && langMatches(lang(?country_name), "EN")) . } ORDER BY DESC(?population) SPARQL Query #3
  116. 116. ©2016 Eric Axel Franzon SPARQL Query #3 Results
  117. 117. ©2016 Eric Axel Franzon • Show me all landlocked countries • With populations > 50,000 • Display the country names in English • Eliminate duplicates PREFIX type: <http://dbpedia.org/class/yago/> PREFIX prop: <http://dbpedia.org/property/> SELECT ?country_name ?population WHERE { ?country a type:LandlockedCountries ; rdfs:label ?country_name ; prop:populationEstimate ?population . FILTER (?population > 15000000 && langMatches(lang(?country_name), "RU")) . } ORDER BY DESC(?population) SPARQL Query #3
  118. 118. ©2016 Eric Axel Franzon SPARQL Query #3 Results
  119. 119. ©2016 Eric Axel Franzon • 8 KB text file with the .rdf extension • Hosted on my website • Information on me, my interests, and people I know My FOAF Profile
  120. 120. ©2016 Eric Axel Franzon SPARQL Example #4 (generic endpoint) FOAF (some people that Eric Franzon knows) PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?name FROM <http://ericaxel.com/eric.rdf> WHERE { ?knower foaf:knows ?known . ?known foaf:name ?name . }
  121. 121. ©2016 Eric Axel Franzon SPARQL Example #4
  122. 122. ©2016 Eric Axel Franzon Example #4 - Results
  123. 123. ©2016 Eric Axel Franzon 2 Disparate Data Sources: 2 FOAF Profiles
  124. 124. ©2016 Eric Axel Franzon SPARQL Example #5 Querying two FOAF Profiles PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> SELECT ?name FROM <http://ericaxel.com/eric.rdf> FROM <http://bosatsu.net/foaf/brian.rdf> WHERE { ?x rdf:type foaf:Person . ?x foaf:name ?name . }
  125. 125. ©2016 Eric Axel Franzon Where’s the Data? What’s The Question?
  126. 126. ©2016 Eric Axel Franzon Example #5 - Results
  127. 127. ©2016 Eric Axel Franzon Another Benefit of querying Linked Data… Data link to other data! SPARQL Example #6
  128. 128. ©2016 Eric Axel Franzon 1. Find these pieces of information: • Episode number • Airdate • Guest star • Chalkboard gag • Couch gag 2. Order them by Episode number SPARQL Example #6
  129. 129. ©2016 Eric Axel Franzon Bart Simpson's Linked Data (DBPedia) SELECT ?epnum ?airdate ?guest_star ?chalkboard_gag ?couch_gag WHERE { ?s dbpedia2:airdate ?airdate . ?s dbpedia2:blackboard ?chalkboard_gag . ?s dbpedia2:guestStar ?guest_star . ?s dbpedia2:episodeNo ?epnum . ?s dbpedia2:couchGag ?couch_gag . } order by ?epnum SPARQL Example #6
  130. 130. ©2016 Eric Axel Franzon SPARQL Example #6
  131. 131. ©2016 Eric Axel Franzon Example #6 - Results
  132. 132. ©2016 Eric Axel Franzon Following the Trail…
  133. 133. ©2016 Eric Axel Franzon Following the Trail…
  134. 134. ©2016 Eric Axel Franzon Following the Trail…
  135. 135. ©2016 Eric Axel Franzon Following the Trail…
  136. 136. ©2016 Eric Axel Franzon And that is how you get from The Simpsons to the London School of Economics.
  137. 137. ©2016 Eric Axel Franzon
  138. 138. ©2016 Eric Axel Franzon Wikidata
  139. 139. ©2016 Eric Axel Franzon One More Thing…
  140. 140. ©2016 Eric Axel Franzon A little bit can be powerful!
  141. 141. ©2016 Eric Axel Franzon Questions? Operators are standing by. THANK YOU! eric@smartdataseo.com @EricAxel http://linkedin.com/in/ericfranzon https://plus.google.com/+EricFranzon
  142. 142. ©2016 Eric Axel Franzon
  143. 143. ©2016 Eric Axel Franzon Resources https://flic.kr/p/6krdsM https://flic.kr/p/p9jiDK https://flic.kr/p/3q8afL https://flic.kr/p/brJs4G https://flic.kr/p/78rsTc https://flic.kr/p/bpSeR2 https://flic.kr/p/pQcWQt https://flic.kr/p/daKwML https://flic.kr/p/8bpMhF http://www.flickr.com/photos/dawnmanser/3532853278/ http://www.flickr.com/photos/artolog/3983764041/ http://www.flickr.com/photos/97964364@N00/59780745/ http://www.flickr.com/photos/starwarsblog/ http://aldobucchi.com http://www.addletters.com/pictures/bart-simpson-generator/3024046.htm http://richard.cyganiak.de/2007/10/lod/

×