Slide 1

Slide 1 text

Introduction to the Semantic Web @arnoutboks Arnout Boks #phpce17 04 nov 2017

Slide 2

Slide 2 text

@arnoutboks #phpce17 What this talk is NOT about…

Slide 3

Slide 3 text

@arnoutboks #phpce17 Finding info on the web An example

Slide 4

Slide 4 text

@arnoutboks #phpce17 “Web 1.0”

Slide 5

Slide 5 text

@arnoutboks #phpce17 “Web 1.0”

Slide 6

Slide 6 text

@arnoutboks #phpce17 “Web 1.0”

Slide 7

Slide 7 text

@arnoutboks #phpce17 Web 1.0 Web of Documents for human consumption

Slide 8

Slide 8 text

@arnoutboks #phpce17 “Web 2.0” Feed of events • iCalendar or vCalendar? • Different types of events?

Slide 9

Slide 9 text

@arnoutboks #phpce17 “Web 2.0” Weather forecast API • XML or JSON? • Which fields and properties? • Which units?

Slide 10

Slide 10 text

@arnoutboks #phpce17 Web 2.0 Web of (individual) API’s for consumption by specialized software

Slide 11

Slide 11 text

@arnoutboks #phpce17 Semantic web • Question to agent (e.g. Siri) • Agent searches across different sources • Agent combines data • Agent answers question

Slide 12

Slide 12 text

@arnoutboks #phpce17 Semantic Web (“Web 3.0”?) Web of Linked Data for consumption by intelligent agents/PA’s

Slide 13

Slide 13 text

@arnoutboks #phpce17 Revolutionary? Term coined by Tim Berners-Lee in 2001

Slide 14

Slide 14 text

@arnoutboks #phpce17 Revolutionary? Based on W3C-standards • RDF (1998) • RDFS (1998) • SPARQL (2008) • OWL (2004) • …

Slide 15

Slide 15 text

@arnoutboks #phpce17 RDF Cornerstone of the Semantic Web Resource Description Framework Cornerstone of the Semantic Web

Slide 16

Slide 16 text

@arnoutboks #phpce17 Records statements about things

Slide 17

Slide 17 text

@arnoutboks #phpce17 RDF allows reading, merging, relaying and inferring statements without fully understanding them

Slide 18

Slide 18 text

@arnoutboks #phpce17 RDF (triples) Subject Predicate Object

Slide 19

Slide 19 text

@arnoutboks #phpce17 RDF (triples) Subject Predicate Object Arnout worksAt Moxio

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

@arnoutboks #phpce17 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

Slide 22

Slide 22 text

@arnoutboks #phpce17 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”

Slide 23

Slide 23 text

@arnoutboks #phpce17 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”

Slide 24

Slide 24 text

@arnoutboks #phpce17 Merging RDF (graph) Arnout Moxio Delft @arnoutboks worksAt basedIn The Netherlands Amsterdam hasCapital 17.000.000 population

Slide 25

Slide 25 text

@arnoutboks #phpce17 Serializing RDF: Turtle @prefix : . @prefix rdf: . @prefix xsd: . @base . :Arnout :livesIn :Delft ; :worksAt :Moxio ; :twitterHandle "@arnoutboks"^^xsd:string . :Delft :cityIn :The_Netherlands . :Moxio :basedIn :Delft .

Slide 26

Slide 26 text

@arnoutboks #phpce17 Serializing RDF: RDF/XML > @a rnoutboks

Slide 27

Slide 27 text

@arnoutboks #phpce17 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" } ] }, ... ]

Slide 28

Slide 28 text

@arnoutboks #phpce17 RDF is an abstract data model with different serialization formats

Slide 29

Slide 29 text

@arnoutboks #phpce17 Identity Because there are multiple things named “Amsterdam”

Slide 30

Slide 30 text

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

Slide 31

Slide 31 text

@arnoutboks #phpce17 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

Slide 32

Slide 32 text

@arnoutboks #phpce17 Identity The Netherlands Amsterdam hasCapital 17.000.000 population 42 Wrecked

Slide 33

Slide 33 text

@arnoutboks #phpce17 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

Slide 34

Slide 34 text

@arnoutboks #phpce17 Prefixes & QNames lonelyplanet:Amsterdam === https://www.lonelyplanet.com/Amsterdam QName URI local name local name namespace prefix

Slide 35

Slide 35 text

@arnoutboks #phpce17 Prefixes & QNames National Maritime Museum (“Scheepvaartmuseum”) nmm:Amsterdam nmm:numberOfGuns Lonely Planet lonelyplanet:Amsterdam lonelyplanet:hasCapital

Slide 36

Slide 36 text

@arnoutboks #phpce17 Three fundamental laws of the (Semantic) Web

Slide 37

Slide 37 text

@arnoutboks #phpce17 Different name, different concept? lonelyplanet-en:Brussels lonelyplanet-nl:Brussel lonelyplanet-fr:Bruxelles lonelyplanet-zh:布魯塞爾

Slide 38

Slide 38 text

@arnoutboks #phpce17 Different name, different concept? mi6:007 mi6:JamesBond

Slide 39

Slide 39 text

@arnoutboks #phpce17 Nonunique Naming Assumption Different names do not imply different concepts

Slide 40

Slide 40 text

@arnoutboks #phpce17 Truth & authority Subject Predicate Object whitehouse:Obama nsa:tapped whitehouse:Trump Donald Trump

Slide 41

Slide 41 text

@arnoutboks #phpce17 Truth & authority Subject Predicate Object php-fig:CakePHP fw:isBetterThan php-fig:Symfony Donald Trump

Slide 42

Slide 42 text

@arnoutboks #phpce17 The AAA Slogan “[On the web] Anyone can say Anything about Any topic”

Slide 43

Slide 43 text

@arnoutboks #phpce17 (this slide intentionally left blank)

Slide 44

Slide 44 text

@arnoutboks #phpce17 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

Slide 45

Slide 45 text

@arnoutboks #phpce17 Open World Assumption We never have all information

Slide 46

Slide 46 text

@arnoutboks #phpce17 SPARQL Query language for Semantic Web data

Slide 47

Slide 47 text

@arnoutboks #phpce17 Triple Store Database for RDF triples

Slide 48

Slide 48 text

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

Slide 49

Slide 49 text

@arnoutboks #phpce17 SPARQL SELECT ?employee ?company WHERE { ?employee :worksAt ?company . ?company :basedIn :Delft . } ?employee ?company :Arnout :Moxio

Slide 50

Slide 50 text

@arnoutboks #phpce17 SPARQL SELECT ?employee ?company ?city WHERE { ?employee :worksAt ?company . ?company :basedIn ?city . ?employee :livesIn ?city . } ?employee ?company ?city :Arnout :Moxio :Delft

Slide 51

Slide 51 text

@arnoutboks #phpce17 Online SPARQL endpoints http://dbpedia.org/sparql

Slide 52

Slide 52 text

@arnoutboks #phpce17 Online SPARQL endpoints PREFIX dbo: PREFIX dbr: SELECT ?song ?runtime WHERE { ?song dbo:artist dbr:The_Beatles . ?song dbo:runtime ?runtime . ?song rdf:type dbo:Song . } ORDER BY DESC (?runtime)

Slide 53

Slide 53 text

@arnoutboks #phpce17 Online SPARQL endpoints

Slide 54

Slide 54 text

@arnoutboks #phpce17 RDF Schema Schema language for Semantic Web data

Slide 55

Slide 55 text

@arnoutboks #phpce17 RDF Schema (RDFS) Describes the structure of RDF-data… in RDF • Classes • Properties • Domain and range of properties • Inheritance of classes • ‘Inheritance’ of properties

Slide 56

Slide 56 text

@arnoutboks #phpce17 RDF Schema (RDFS) Subject Predicate Object :DonaldTrump :isFatherOf :IvankaTrump

Slide 57

Slide 57 text

@arnoutboks #phpce17 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

Slide 58

Slide 58 text

@arnoutboks #phpce17 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

Slide 59

Slide 59 text

@arnoutboks #phpce17 Inference Reasoner (asserted) triples inferred/virtual triples

Slide 60

Slide 60 text

@arnoutboks #phpce17 Inference Reasoner (asserted) triples inferred/virtual triples

Slide 61

Slide 61 text

@arnoutboks #phpce17 SPARQL & Inference SELECT ?person WHERE { ?person rdf:type :Person . } ?person :IvankaTrump :DonaldTrump

Slide 62

Slide 62 text

@arnoutboks #phpce17 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

Slide 63

Slide 63 text

@arnoutboks #phpce17 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

Slide 64

Slide 64 text

@arnoutboks #phpce17 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

Slide 65

Slide 65 text

@arnoutboks #phpce17 Query different sources as if they were one

Slide 66

Slide 66 text

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

Slide 67

Slide 67 text

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

Slide 68

Slide 68 text

@arnoutboks #phpce17 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”)

Slide 69

Slide 69 text

@arnoutboks #phpce17 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

Slide 70

Slide 70 text

@arnoutboks #phpce17 RDF Schema vs. JSON/XML Schema

Slide 71

Slide 71 text

@arnoutboks #phpce17 RDF Schema will never consider data to be invalid

Slide 72

Slide 72 text

@arnoutboks #phpce17 Web Ontology Language (OWL) Even smarter inferencing Web Ontology Language (OWL) Even smarter inferencing

Slide 73

Slide 73 text

@arnoutboks #phpce17 OWL OWL ≈ RDFS++

Slide 74

Slide 74 text

@arnoutboks #phpce17 OWL Power comes at a price…

Slide 75

Slide 75 text

@arnoutboks #phpce17 OWL: Inverse properties Subject Predicate Object :DonaldTrump :isParentOf :IvankaTrump :isParentOf owl:inverseOf :isChildOf :IvankaTrump :isChildOf :DonaldTrump

Slide 76

Slide 76 text

@arnoutboks #phpce17 OWL: Symmetric properties Subject Predicate Object :DonaldTrump :isMarriedTo :MelaniaTrump :isMarriedTo rdf:type owl:SymmetricProperty :MelaniaTrump :isMarriedTo :DonaldTrump

Slide 77

Slide 77 text

@arnoutboks #phpce17 OWL: Equality Subject Predicate Object :DonaldTrump :isMarriedTo :MelaniaTrump :DonaldTrump owl:sameAs :TheDon :TheDon :isMarriedTo :MelaniaTrump

Slide 78

Slide 78 text

@arnoutboks #phpce17 OWL: Functional properties Subject Predicate Object :IvankaTrump :hasFather :DonaldTrump :IvankaTrump :hasFather :TheDon :hasFather rdf:type owl:FunctionalProperty :TheDon owl:sameAs :DonaldTrump

Slide 79

Slide 79 text

@arnoutboks #phpce17 Inconsistency Subject Predicate Object :IvankaTrump :hasFather :DonaldTrump :IvankaTrump :hasFather :TheDon :hasFather rdf:type owl:FunctionalProperty :TheDon owl:differentFrom :DonaldTrump

Slide 80

Slide 80 text

@arnoutboks #phpce17 Inconsistency

Slide 81

Slide 81 text

@arnoutboks #phpce17 Inconsistency

Slide 82

Slide 82 text

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

Slide 83

Slide 83 text

@arnoutboks #phpce17 It’s okay to be inconsistent… (remember the AAA slogan) …but the reasoner won’t help you anymore

Slide 84

Slide 84 text

@arnoutboks #phpce17 Further steps Get going with the Semantic Web

Slide 85

Slide 85 text

@arnoutboks #phpce17 Self-test Subject Predicate Object :George :hasChild :Michelle :George :hasChild :James How many children does George have?

Slide 86

Slide 86 text

@arnoutboks #phpce17 Leveraging the Semantic Web Network effect

Slide 87

Slide 87 text

@arnoutboks #phpce17 Leveraging the Semantic Web Only useful when multiple parties speak the same ‘language’

Slide 88

Slide 88 text

@arnoutboks #phpce17 Align with existing vocabularies

Slide 89

Slide 89 text

@arnoutboks #phpce17 Leveraging the Semantic Web Mapping between vocabularies: • rdfs:subclassOf • rdfs:subpropertyOf • owl:inverseOf • owl:sameAs

Slide 90

Slide 90 text

@arnoutboks #phpce17 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

Slide 91

Slide 91 text

@arnoutboks #phpce17 Resources • Apache Jena • 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

Slide 92

Slide 92 text

@arnoutboks #phpce17 Resources

Slide 93

Slide 93 text

@arnoutboks #phpce17 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/

Slide 94

Slide 94 text

@arnoutboks #phpce17 Feedback & Questions @arnoutboks @arnoutboks @aboks Arnout Boks Please leave your feedback on joind.in

Slide 95

Slide 95 text

@arnoutboks #phpce17 Image Credits • https://www.flickr.com/photos/lex-photographic/32521124574 • https://www.flickr.com/photos/flamesworddragon/19686463141 • 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://www.flickr.com/photos/borkurdotnet/9682277597