Save 37% off PRO during our Black Friday Sale! »

The Web of the Future: Introduction to the Semantic Web - Bulgaria PHP 2019

8dfcb5f1b3cd5397f19780e2319694da?s=47 Arnout Boks
November 09, 2019

The Web of the Future: Introduction to the Semantic Web - Bulgaria PHP 2019

What if we could evolve our web of individual documents and data to a web of interlinked knowledge, a web where machines can automatically combine data from multiple sources and draw conclusions from it? The Semantic Web technologies from W3C enable us to make sense of the data wilderness on the web and unlock the full potential of the data treasures hidden in it.

In this talk, we will see how RDF enables us to formally describe the meaning of data and how such data can be queried with SPARQL. We will look at how OWL lets us make more expressive statements about the world, so that a computer can logically reason about it and infer new information. We will demonstrate these technologies by showing how they can be used to query seemingly incompatible data sets as if they were one and letting a computer draw logical (and perhaps surprising) conclusions for us.

Contains: ‘retro’ technology, linked data, fundamental properties of the web, and Donald Trump’s opinion on PHP frameworks.

8dfcb5f1b3cd5397f19780e2319694da?s=128

Arnout Boks

November 09, 2019
Tweet

Transcript

  1. The Web of the Future: Introduction to the Semantic Web

    @arnoutboks Arnout Boks #bgphp19 09-11-2019
  2. @arnoutboks #bgphp19 What this talk is NOT about…

  3. @arnoutboks #bgphp19 Finding info on the web An example

  4. @arnoutboks #bgphp19 “Web 1.0”

  5. @arnoutboks #bgphp19 “Web 1.0”

  6. @arnoutboks #bgphp19 “Web 1.0”

  7. @arnoutboks #bgphp19 Web 1.0 Web of Documents for human consumption

  8. @arnoutboks #bgphp19 “Web 2.0” Feed of events • iCalendar or

    vCalendar? • Different types of events?
  9. @arnoutboks #bgphp19 “Web 2.0” Weather forecast API • XML or

    JSON? • Which fields and properties? • Which units?
  10. @arnoutboks #bgphp19 Web 2.0 Web of (individual) API’s for consumption

    by specialized software
  11. @arnoutboks #bgphp19 Semantic web • Question to agent (e.g. Siri,

    Google Assistant) • Agent searches across different sources • Agent combines data • Agent answers question
  12. @arnoutboks #bgphp19 Semantic Web (“Web 3.0”?) Web of Linked Data

    for consumption by intelligent agents/PA’s
  13. @arnoutboks #bgphp19 Revolutionary? Term coined by Tim Berners-Lee in 2001

  14. @arnoutboks #bgphp19 Revolutionary? Based on W3C-standards • RDF (1998) •

    RDFS (1998) • SPARQL (2008) • OWL (2004) • …
  15. @arnoutboks #bgphp19 RDF Cornerstone of the Semantic Web Resource Description

    Framework Cornerstone of the Semantic Web
  16. @arnoutboks #bgphp19 Records statements about things

  17. @arnoutboks #bgphp19 RDF allows reading, merging, relaying and inferring statements

    without fully understanding them
  18. @arnoutboks #bgphp19 RDF (triples) Subject Predicate Object

  19. @arnoutboks #bgphp19 RDF (triples) Subject Predicate Object Arnout worksAt Moxio

  20. @arnoutboks #bgphp19 RDF (triples) Subject Predicate Object Arnout worksAt Moxio

    Arnout twitterHandle “@arnoutboks” Arnout livesIn Delft Delft cityIn The Netherlands Moxio basedIn Delft
  21. @arnoutboks #bgphp19 RDF (graph) Arnout Moxio Delft @arnoutboks worksAt basedIn

    The Netherlands Subject Predicate Object Arnout worksAt Moxio Arnout twitterHandle “@arnoutboks” Arnout livesIn Delft Delft cityIn The Netherlands Moxio basedIn Delft
  22. @arnoutboks #bgphp19 Merging RDF (triples) Subject Predicate Object Arnout worksAt

    Moxio Arnout twitterHandle “@arnoutboks” Arnout livesIn Delft Delft cityIn The Netherlands Moxio basedIn Delft Subject Predicate Object The Netherlands hasCapital Amsterdam The Netherlands population “17.000.000”
  23. @arnoutboks #bgphp19 Merging RDF (triples) Subject Predicate Object Arnout worksAt

    Moxio Arnout twitterHandle “@arnoutboks” Arnout livesIn Delft Delft cityIn The Netherlands Moxio basedIn Delft The Netherlands hasCapital Amsterdam The Netherlands population “17.000.000”
  24. @arnoutboks #bgphp19 Merging RDF (graph) Arnout Moxio Delft @arnoutboks worksAt

    basedIn The Netherlands Amsterdam hasCapital 17.000.000 population
  25. @arnoutboks #bgphp19 Serializing RDF: Turtle @prefix : <http://www.example.com/#> . @prefix

    rdf: <http://www.w3.org/1999/02/22-rdf-syntax- ns#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @base <http://www.example.com/> . :Arnout :livesIn :Delft ; :worksAt :Moxio ; :twitterHandle "@arnoutboks"^^xsd:string . :Delft :cityIn :The_Netherlands . :Moxio :basedIn :Delft .
  26. @arnoutboks #bgphp19 Serializing RDF: RDF/XML <?xml version="1.0"?> <rdf:RDF xmlns="http://www.example.com/#" <!--

    ... -->> <rdf:Description rdf:about="http://www.example.com/#Arnout"> <twitterHandle rdf:datatype="http://www.w3.org/2001/XMLSchema#string">@a rnoutboks</twitterHandle> <worksAt rdf:resource="http://www.example.com/#Moxio"/> <livesIn rdf:resource="http://www.example.com/#Delft"/> </rdf:Description> <!-- ... --> </rdf:RDF>
  27. @arnoutboks #bgphp19 Serializing RDF: JSON-LD [ { "@id" : "http://www.example.com/#Arnout",

    "http://www.example.com/#livesIn" : [ { "@id" : "http://www.example.com/#Delft" } ], "http://www.example.com/#twitterHandle" : [ { "@value" : "@arnoutboks" } ], "http://www.example.com/#worksAt" : [ { "@id" : "http://www.example.com/#Moxio" } ] }, ... ]
  28. @arnoutboks #bgphp19 RDF is an abstract data model with different

    serialization formats
  29. @arnoutboks #bgphp19 Identity Because there are multiple things named “Amsterdam”

  30. @arnoutboks #bgphp19 Identity Subject Predicate Object Amsterdam numberOfGuns “42” Amsterdam

    status Wrecked National Maritime Museum (“Scheepvaartmuseum”)
  31. @arnoutboks #bgphp19 Identity Subject Predicate Object Amsterdam numberOfGuns “42” Amsterdam

    status Wrecked Subject Predicate Object The Netherlands hasCapital Amsterdam The Netherlands population “17.000.000” National Maritime Museum (“Scheepvaartmuseum”) Lonely Planet
  32. @arnoutboks #bgphp19 Identity The Netherlands Amsterdam hasCapital 17.000.000 population 42

    Wrecked
  33. @arnoutboks #bgphp19 URI’s for namespacing National Maritime Museum (“Scheepvaartmuseum”) https://www.hetscheepvaartmuseum.nl/ships/Amsterdam

    https://www.hetscheepvaartmuseum.nl/ships/numberOfGuns Lonely Planet https://www.lonelyplanet.com/Amsterdam https://www.lonelyplanet.com/hasCapital
  34. @arnoutboks #bgphp19 Prefixes & QNames lonelyplanet:Amsterdam === https://www.lonelyplanet.com/Amsterdam QName URI

    local name local name namespace prefix
  35. @arnoutboks #bgphp19 Prefixes & QNames National Maritime Museum (“Scheepvaartmuseum”) nmm:Amsterdam

    nmm:numberOfGuns Lonely Planet lonelyplanet:Amsterdam lonelyplanet:hasCapital
  36. @arnoutboks #bgphp19 Three fundamental laws of the (Semantic) Web

  37. @arnoutboks #bgphp19 Different name, different concept? lonelyplanet-en:Brussels lonelyplanet-nl:Brussel lonelyplanet-bg:Брюксел lonelyplanet-zh:布魯塞爾

  38. @arnoutboks #bgphp19 Different name, different concept? mi6:007 mi6:JamesBond

  39. @arnoutboks #bgphp19 Nonunique Naming Assumption Different names do not imply

    different concepts
  40. @arnoutboks #bgphp19 Truth & authority Subject Predicate Object whitehouse:Obama nsa:tapped

    whitehouse:Trump Donald Trump
  41. @arnoutboks #bgphp19 Truth & authority Subject Predicate Object php-fig:CakePHP fw:isBetterThan

    php-fig:Symfony Donald Trump
  42. @arnoutboks #bgphp19 The AAA Slogan “[On the web] Anyone can

    say Anything about Any topic”
  43. @arnoutboks #bgphp19 (this slide intentionally left blank)

  44. @arnoutboks #bgphp19 Absence of information Subject Predicate Object whitehouse:Trump fw:knows

    php-fig:Symfony whitehouse:Trump fw:knows php-fig:CakePHP whitehouse:Trump fw:knows php-fig:CodeIgniter
  45. @arnoutboks #bgphp19 Open World Assumption We never have all information

  46. @arnoutboks #bgphp19 SPARQL Query language for Semantic Web data

  47. @arnoutboks #bgphp19 Triple Store Database for RDF triples

  48. @arnoutboks #bgphp19 SPARQL SELECT ?employee ?company WHERE { ?employee :worksAt

    ?company . ?company :basedIn :Delft . }
  49. @arnoutboks #bgphp19 SPARQL SELECT ?employee ?company WHERE { ?employee :worksAt

    ?company . ?company :basedIn :Delft . } ?employee ?company :Arnout :Moxio
  50. @arnoutboks #bgphp19 SPARQL SELECT ?employee ?company ?city WHERE { ?employee

    :worksAt ?company . ?company :basedIn ?city . ?employee :livesIn ?city . } ?employee ?company ?city :Arnout :Moxio :Delft
  51. @arnoutboks #bgphp19 Online SPARQL endpoints http://dbpedia.org/sparql

  52. @arnoutboks #bgphp19 Online SPARQL endpoints

  53. @arnoutboks #bgphp19 Online SPARQL endpoints PREFIX dbo: <http://dbpedia.org/ontology/> PREFIX dbr:

    <http://dbpedia.org/resource/> SELECT ?song ?runtime WHERE { ?song dbo:artist dbr:The_Beatles . ?song dbo:runtime ?runtime . ?song rdf:type dbo:Song . } ORDER BY DESC (?runtime)
  54. @arnoutboks #bgphp19 Online SPARQL endpoints

  55. @arnoutboks #bgphp19 Online SPARQL endpoints PREFIX dbo: <http://dbpedia.org/ontology/> PREFIX dbr:

    <http://dbpedia.org/resource/> SELECT ?ancestor WHERE { dbr:Willem-Alexander_of_the_Netherlands dbo:parent+ ?ancestor . }
  56. @arnoutboks #bgphp19 RDF Schema Schema language for Semantic Web data

  57. @arnoutboks #bgphp19 RDF Schema (RDFS) Describes the structure of RDF-data…

    in RDF • Classes • Properties • Domain and range of properties • Inheritance of classes • ‘Inheritance’ of properties
  58. @arnoutboks #bgphp19 RDF Schema (RDFS) Subject Predicate Object :DonaldTrump :isFatherOf

    :IvankaTrump
  59. @arnoutboks #bgphp19 RDF Schema (RDFS) Subject Predicate Object :DonaldTrump :isFatherOf

    :IvankaTrump :isFatherOf rdfs:range :Person :isFatherOf rdfs:domain :Father :Father rdfs:subclassOf :Parent :Parent rdfs:subclassOf :Person :isFatherOf rdfs:subpropertyOf :isParentOf
  60. @arnoutboks #bgphp19 RDF Schema & Inference Subject Predicate Object :DonaldTrump

    :isFatherOf :IvankaTrump :isFatherOf rdfs:range :Person :isFatherOf rdfs:domain :Father :Father rdfs:subclassOf :Parent :Parent rdfs:subclassOf :Person :isFatherOf rdfs:subpropertyOf :isParentOf :IvankaTrump rdf:type :Person :DonaldTrump rdf:type :Father :DonaldTrump rdf:type :Parent :DonaldTrump rdf:type :Person :DonaldTrump :isParentOf :IvankaTrump
  61. @arnoutboks #bgphp19 Inference Reasoner (asserted) triples inferred/virtual triples

  62. @arnoutboks #bgphp19 Inference Reasoner (asserted) triples inferred/virtual triples

  63. @arnoutboks #bgphp19 SPARQL & Inference SELECT ?person WHERE { ?person

    rdf:type :Person . } ?person :IvankaTrump :DonaldTrump
  64. @arnoutboks #bgphp19 Combining data using inference Subject Predicate Object a:DonaldTrump

    rdf:type a:Person Datasource A Subject Predicate Object b:MelaniaTrump rdf:type b:Human Datasource B
  65. @arnoutboks #bgphp19 Combining data using inference Subject Predicate Object a:DonaldTrump

    rdf:type a:Person Datasource A Subject Predicate Object b:MelaniaTrump rdf:type b:Human Datasource B Subject Predicate Object a:Person rdfs:subclassOf b:Human b:Human rdfs:subclassOf a:Person Mapping rules
  66. @arnoutboks #bgphp19 Combining data using inference Subject Predicate Object a:DonaldTrump

    rdf:type a:Person b:MelaniaTrump rdf:type b:Human a:Person rdfs:subclassOf b:Human b:Human rdfs:subclassOf a:Person a:DonaldTrump rdf:type b:Human b:MelaniaTrump rdf:type a:Person
  67. @arnoutboks #bgphp19 Query different sources as if they were one

  68. @arnoutboks #bgphp19 RDF Schema vs. JSON/XML Schema Subject Predicate Object

    mi6:JamesBond rdf:type mi6:SecretAgent mi6:JamesBond nmm:numberOfGuns “1” MI6 files
  69. @arnoutboks #bgphp19 RDF Schema vs. JSON/XML Schema Subject Predicate Object

    mi6:JamesBond rdf:type mi6:SecretAgent mi6:JamesBond nmm:numberOfGuns “1” MI6 files
  70. @arnoutboks #bgphp19 RDF Schema vs. JSON/XML Schema Subject Predicate Object

    mi6:JamesBond rdf:type mi6:SecretAgent mi6:JamesBond nmm:numberOfGuns “1” MI6 files Subject Predicate Object nmm:numberOfGuns rdf:domain nmm:Ship National Maritime Museum (“Scheepvaartmuseum”)
  71. @arnoutboks #bgphp19 RDF Schema vs. JSON/XML Schema Subject Predicate Object

    mi6:JamesBond rdf:type mi6:SecretAgent mi6:JamesBond nmm:numberOfGuns “1” nmm:numberOfGuns rdf:domain nmm:Ship mi6:JamesBond rdf:type nmm:Ship
  72. @arnoutboks #bgphp19 RDF Schema vs. JSON/XML Schema

  73. @arnoutboks #bgphp19 RDF Schema will never consider data to be

    invalid
  74. @arnoutboks #bgphp19 Web Ontology Language (OWL) Even smarter inferencing Web

    Ontology Language (OWL) Even smarter inferencing
  75. @arnoutboks #bgphp19 OWL OWL ≈ RDFS++

  76. @arnoutboks #bgphp19 OWL Power comes at a price…

  77. @arnoutboks #bgphp19 OWL: Inverse properties Subject Predicate Object :DonaldTrump :isParentOf

    :IvankaTrump :isParentOf owl:inverseOf :isChildOf :IvankaTrump :isChildOf :DonaldTrump
  78. @arnoutboks #bgphp19 OWL: Symmetric properties Subject Predicate Object :DonaldTrump :isMarriedTo

    :MelaniaTrump :isMarriedTo rdf:type owl:SymmetricProperty :MelaniaTrump :isMarriedTo :DonaldTrump
  79. @arnoutboks #bgphp19 OWL: Equality Subject Predicate Object :DonaldTrump :isMarriedTo :MelaniaTrump

    :DonaldTrump owl:sameAs :TheDon :TheDon :isMarriedTo :MelaniaTrump
  80. @arnoutboks #bgphp19 OWL: Functional properties Subject Predicate Object :IvankaTrump :hasFather

    :DonaldTrump :IvankaTrump :hasFather :TheDon :hasFather rdf:type owl:FunctionalProperty :TheDon owl:sameAs :DonaldTrump
  81. @arnoutboks #bgphp19 Inconsistency Subject Predicate Object :IvankaTrump :hasFather :DonaldTrump :IvankaTrump

    :hasFather :TheDon :hasFather rdf:type owl:FunctionalProperty :TheDon owl:differentFrom :DonaldTrump
  82. @arnoutboks #bgphp19 Inconsistency

  83. @arnoutboks #bgphp19 Inconsistency

  84. @arnoutboks #bgphp19 It’s okay to be inconsistent… (remember the AAA

    slogan)
  85. @arnoutboks #bgphp19 It’s okay to be inconsistent… (remember the AAA

    slogan) …but the reasoner won’t help you anymore
  86. @arnoutboks #bgphp19 Self-test Subject Predicate Object :George :hasChild :Michelle :George

    :hasChild :James How many children does George have?
  87. @arnoutboks #bgphp19 Further steps Get going with the Semantic Web

  88. @arnoutboks #bgphp19 Leveraging the Semantic Web Network effect

  89. @arnoutboks #bgphp19 Leveraging the Semantic Web Only useful when multiple

    parties speak the same ‘language’
  90. @arnoutboks #bgphp19 Align with existing vocabularies

  91. @arnoutboks #bgphp19 Leveraging the Semantic Web Mapping between vocabularies: •

    rdfs:subclassOf • rdfs:subpropertyOf • owl:inverseOf • owl:sameAs
  92. @arnoutboks #bgphp19 Existing vocabularies • Dublin Core • Metadata about

    publications and authors • Friend of a Friend • People, connections, social networks • GoodRelations • Products, prices, eCommerce • CB-NL • Construction, infrastructure, spatial planning • QUDT • Quantities, units, dimensions, conversions
  93. @arnoutboks #bgphp19 Resources • Apache Jena (includes Fuseki triple store)

    • Semantic web framework/tools (written in Java) • easyrdf/easyrdf • RDF parser/writer for PHP • semsol/arc2 • PHP RDF library and MySQL-based triple store • FaCT++, HermiT & Pellet • Open source OWL reasoners • Protégé • RDF/OWL IDE with various reasoner plugins
  94. @arnoutboks #bgphp19 Resources

  95. @arnoutboks #bgphp19 Resources • https://www.w3.org/2013/data/ • https://www.w3.org/2001/sw/wiki/ • https://www.w3.org/TR/rdf11-primer/ •

    https://www.w3.org/TR/owl2-primer/ • https://www.w3.org/TR/sparql11-query/ • http://wiki.dbpedia.org/OnlineAccess • https://www.data.gov/ • http://lod-cloud.net/
  96. @arnoutboks #bgphp19 Feedback & Questions Please leave your feedback on

    joind.in: https://joind.in/talk/de222 @arnoutboks https://aboks.github.io Arnout Boks
  97. @arnoutboks #bgphp19 Image Credits • https://www.flickr.com/photos/lex-photographic/32521124574 • https://www.flickr.com/photos/rwoan/34676675925 • https://www.flickr.com/photos/littlehuw/15236543728

    • https://www.flickr.com/photos/crdominguez/422517106 • https://www.flickr.com/photos/pamwood707/5646757752 • https://www.flickr.com/photos/blair25/3240686470 • https://www.flickr.com/photos/tylerbeaulawrence/15167523690 • https://www.flickr.com/photos/23975018@N04/3675503072 • https://pixabay.com/nl/nuance-stalen-kleur-pantone-1074766/ • https://www.flickr.com/photos/borkurdotnet/9682277597