Contenu connexe Similaire à Semantic Web Intro - St. Patrick's Day 2016 Update (20) Semantic Web Intro - St. Patrick's Day 2016 Update1. ©2016 Eric Axel Franzon
Introduction to Semantic Web
(Meets St. Patrick’s Day)
Eric Franzon
Smart Data SEO
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. ©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. ©2016 Eric Axel Franzon
What is it not?
• A software package
• Something that will ever
be “done”
• A replacement for the
current Web
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. ©2016 Eric Axel Franzon
• Globally
• Inexpensively
• In Real-Time
Behind the
Firewall
(public)
World
Wide
Web
HTTP
HTML
Based on W3C Standards
9. ©2016 Eric Axel Franzon
• Globally
• Inexpensively
• In Real-Time
Behind the
Firewall
Semantic
Web
RDF
SPARQL
OWL
Based on W3C Standards
18. ©2016 Eric Axel Franzon
• to connect DATA
• to make information
interpretable by machines
Semantic Web Standards
are used…
21. ©2016 Eric Axel Franzon
Web 1.0
“I see: characters
+ formatting
+ images”
--my Computer
22. ©2016 Eric Axel Franzon
Web 1.0 – Linking Documents
Web 2.0 – Linking People
23. ©2016 Eric Axel Franzon
Web 2.0
“I see: characters
+ formatting
+ images”
--my Computer
24. ©2016 Eric Axel Franzon
It’s hard to interpret meaning
when all you see are characters,
images, and formatting.
Context is critical.
25. ©2016 Eric Axel Franzon
Web 1.0 – Linking Documents
Web 2.0 – Linking People
Web 3.0 – Linking Data
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.”
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. ©2016 Eric Axel Franzon
Semantic Data that is machine READABLE.
…and machine INTERPRETABLE!
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?
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.”
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.”
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.”
50. ©2016 Eric Axel Franzon
The Technologies of RDBMS
• Data
• Schemas
• Query Language
51. ©2016 Eric Axel Franzon
RDBMS Data
t_people
Name City State Post code
Sean Bozeman MT 59715
Erika Missoula MT 59801
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. ©2016 Eric Axel Franzon
The Technologies of SemWeb
• Data
• Schemas
• Query Language
55. ©2016 Eric Axel Franzon
The Data Language
Resource
Description
Framework
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. ©2016 Eric Axel Franzon
• to connect DATA
• to make it interpretable
by machines
RDF is used…
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. ©2016 Eric Axel Franzon
So, what’s a THING?
1. By uniquely identifying THINGS
Machine Interpretable - How?
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. ©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. ©2016 Eric Axel Franzon
Who’s your daddy?
1. By uniquely identifying THINGS
2. By uniquely identifying RELATIONSHIPS
Machine Interpretable - How?
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. ©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?
66. ©2016 Eric Axel Franzon
Predicate
Triples? It’s Elementary! (School)
song has title.
Relationship
That is a Triple!
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. ©2016 Eric Axel Franzon
Song
Author Title
PublisherLyrics
A Simple Graph
69. ©2016 Eric Axel Franzon
Visualization of graph from Pharma space
- Cytoscape.org
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. ©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. ©2016 Eric Axel Franzon
The Technologies of SemWeb
• Data
• Schemas
• Query Language
73. ©2016 Eric Axel Franzon
The Schemata
Linked Data schemas consist of:
Your RDF relationships (predicates)
+
Relationship descriptions
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. ©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
79. ©2016 Eric Axel Franzon
The Technologies of SemWeb
• Data
• Schemas
• Query Language
(…or “What can you do with it?”)
80. ©2016 Eric Axel Franzon
The query language
SPARQL
Protocol
And
RDF
Query
Language
SPARQL
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
86. ©2016 Eric Axel Franzon
<hasLicense>
<hasDepiction>
<likes>
<likes>
Eric
87. ©2016 Eric Axel Franzon
<hasLicense>
<hasDepiction>
<likes>
<likes>
<likes>
Eric
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. ©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. ©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. ©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
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. ©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. ©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. ©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. ©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
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. ©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. ©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. ©2016 Eric Axel Franzon
Graphs
people
ErikaMonte
City
State
Post
code
Missoula
MT
59801
City
State
Post
code
flag
1
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" )
}
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. ©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
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!
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
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
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. ©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 .
}
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 .
}
127. ©2016 Eric Axel Franzon
Another Benefit of querying
Linked Data…
Data link to other data!
SPARQL Example #6
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. ©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
136. ©2016 Eric Axel Franzon
And that is how you get
from The Simpsons to the
London School of
Economics.
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
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/