Your SlideShare is downloading. ×
0
Semantic WebDr. Sebastian Ryszard KrukDec 11th, 2012; Web Tuesday, Zurich
Outline✤   Quick walk through the history of the Web✤   The core principles of the Semantic Web✤   Some vocabularies, sche...
The history of the Web
Let’s go back in time✤   1937 - H.G. Wells: “World Brain”✤   1945 - Vannevar Bush: Memex✤   1969 - Doug Engelbart: ARPANET...
The blueprints of the Web
The core principles
The “roadmap” cake
RDF is not a format!
RDF is not a format!        Leather                           made by Wood                                     Chair      ...
RDF is not a format!        Leather                           made by Wood                                     Chair      ...
Resource, Literals and BNodes✤   Resource - everything identified by URI/IRI✤   Literal - a value (“four”)    ✤   with an o...
Resource, Literals and BNodes✤   Resource - everything identified by URI/IRI✤   Literalns: a value (“four”)            - <h...
Vocabularies✤   Schemes:    ✤   Taxonomy: narrower/broader    ✤   Thesaurus: related    ✤   Folksonomy: “machines are (usi...
Ontology languages✤   RDF Schema: classes, properties, domains and ranges✤   OWL (Web Ontology Language) - Lite, DL and Fu...
Vocabularies and ontologies
Dublin Core✤   One of the oldest, originates from digital libraries✤   Goals:    ✤   semantic and syntactic interoperabili...
FOAF+SIOC+SKOS                 http://sioc-project.org
Good Relations✤   De-facto standard for semantic e-commerce    ✤   Supported by Google via Rich Snippets    ✤   BestBuy sh...
schema.org✤   Vocabulary for Rich Snippets and Knowledge Graph✤   Yahoo+Bing+Google✤   Microdata vs RDFa (Lite)
Publishing semantics
Linked (Open) Data  http://linkeddata.org
5-Star Data Rules✤   URIs = names for things✤   HTTP URIs = enable look up✤   Provide useful information    upon lookup, u...
5-Star Data Rules✤   URIs = names for things✤   HTTP URIs = enable look up✤   Provide useful information    upon lookup, u...
Content negotiation
RDFa and RDFa Lite✤   Extension to XHTML/HTML5 for embeding RDF graph semantics in    HTML syntax:    ✤   property vs rel ...
RDFa and RDFa Lite✤   Extension to XHTML/HTML5 for embeding RDF graph semantics in    HTML syntax:    <p vocab="http://sch...
Rich Snippets (microdata)<div class="col-right small" itemid="http://example/" itemtype="http://schema.org/FurnitureStore"...
Rich Snippets (RDFa Lite)<div class="col-right small" resource="http://example.com/" typeof="FurnitureStore"vocab="http://...
Consuming semantics
SPARQL✤   W3C standard for querying RDF graphs✤   Purposely made similar to SQL (to the extent possible)✤   SPARQL endpoin...
Path queries✤   ?a :d “D”.✤   ?a :a ?b. ?b :e “E”; :f “F”.✤   ?a :b [ :c “C” ].
Path queries                                             :c                                                  C            ...
SELECT and more✤   PREFIX dc: <http://purl.org/dc/elements/1.1/>✤   SELECT ?title    WHERE { <http://mybook.com> dc:title ...
SPARQL Filtering✤   OPTIONAL { ?x ns:y ?z }✤   FILTER ( xsd:dateTime(?date) >    xsd:dateTime("2010-03-01T00:00:00Z") )✤  ...
Python RDFLibfrom rdflib.graph import Graph, URIReffrom rdflib.namespace import Namespacefrom rdflib import pluginplugin.regi...
Read RDFa into RDFfrom pyRdfa import pyRdfa, Optionsdef rdf2turtle(url):       options = Options(output_processor_graph=Tr...
Gotchas
Don’t overcomplicate✤   Gödel’s Incompleteness Theorems✤   First-Order Logic vs OWL-Full / CYC✤   Jim Handler: “Little sem...
OOP vs Description Logic✤   B rdfs:subClassOf A    C rdfs:domain A    D rdfs:domain B✤   Infers:    ✤   C rdfs:domain B [W...
OOP vs Description Logic✤   B rdfs:subClassOf A    C rdfs:domain A    D rdfs:domain B                                 doma...
Open World Assumptions✤   RDF is by it’s virtue a distributed being    ✤   You might only have a part of it    ✤   The res...
RDBMS and NoSQL vs RDF✤   We can store RDF in RDBMS; even easier in NoSQL✤   Certain SPARQL path queries can be translated...
How can web semantics help✤   interoperability✤   information retrieval✤   recommendations and matchmaking✤   SEO
Linked Data is KingDr. Sebastian Ryszard KrukCTO/CRO Knowledge Hives sp. z o.o., sebastian@kruk.me
Upcoming SlideShare
Loading in...5
×

Semantic Web

995

Published on

Presentation for the WebTuesday http://webtuesday.ch/meetings/20121211/ Dec 11th, 2012.

Published in: Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
995
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
24
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Semantic Web"

  1. 1. Semantic WebDr. Sebastian Ryszard KrukDec 11th, 2012; Web Tuesday, Zurich
  2. 2. Outline✤ Quick walk through the history of the Web✤ The core principles of the Semantic Web✤ Some vocabularies, schemas and ontologies you should know✤ Publishing the Web 3.0 way✤ Consuming semantics✤ Semantic Web gotchas✤ Summary: how Semantic Web technologies can help
  3. 3. The history of the Web
  4. 4. Let’s go back in time✤ 1937 - H.G. Wells: “World Brain”✤ 1945 - Vannevar Bush: Memex✤ 1969 - Doug Engelbart: ARPANET, online collaboration, mouse✤ 1989 - sir Tim Berners-Lee: WWW✤ 1995 - Dublin Core: semantics from librarian world✤ 1999 - prof. Stefan Decker: OntoBroker✤ 2000 - DARPA publish DAML specification✤ 2001 - TBL, Handler i Lassila: “The Semantic Web” (SciAm)✤ 2009 - TBL - 20th anniversary: “we’ve got all the tools"✤ 2009 - Google introduces Rich Snippets/RDFa; BestBuy sales increase✤ 2010 - Facebook starts Open Graph✤ 2012 - Google announces Knowledge Graph
  5. 5. The blueprints of the Web
  6. 6. The core principles
  7. 7. The “roadmap” cake
  8. 8. RDF is not a format!
  9. 9. RDF is not a format! Leather made by Wood Chair is a made made of is a Carpenter Man sits on is a has Back Leg count used for 4 Sitting
  10. 10. RDF is not a format! Leather made by Wood Chair is a made predicate subject made of object is a Carpenter a statement Man sits on is a has Back Leg count used for 4 Sitting
  11. 11. Resource, Literals and BNodes✤ Resource - everything identified by URI/IRI✤ Literal - a value (“four”) ✤ with an optional type (4^^xsd:int) ✤ or optional lang tag (“four”@en)✤ BNode - point in the graph with only local _:name✤ Statement - a triple (subject, predicate, object)✤ Reification - a statement about the statement
  12. 12. Resource, Literals and BNodes✤ Resource - everything identified by URI/IRI✤ Literalns: a value (“four”) - <http://test.test/ns> . @prefix @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema> . ✤ with an optional type (4^^xsd:int) ns:Chair ns:has ns:Leg. _:sentence a rdf:Statement; tag (“four”@en) or optional lang ✤ rdf:subject ns:Chair; rdf:predicate ns:has;✤ BNoderdf:object ns:Leg;the graph with only - point in local _:name ns:count “4”^^xsd:int.✤ Statement - a triple (subject, predicate, object)✤ Reification - a statement about the statement
  13. 13. Vocabularies✤ Schemes: ✤ Taxonomy: narrower/broader ✤ Thesaurus: related ✤ Folksonomy: “machines are (using) us” Peter Mika [Yahoo]✤ Ontology: “An ontology is a specification of a conceptualization” Tom Gruber, 1993 [*Siri]
  14. 14. Ontology languages✤ RDF Schema: classes, properties, domains and ranges✤ OWL (Web Ontology Language) - Lite, DL and Full, and OWL 2: (among others) inverse functional property, symmetry, transitiveness and disjointness✤ But also: UML, ERD, ...
  15. 15. Vocabularies and ontologies
  16. 16. Dublin Core✤ One of the oldest, originates from digital libraries✤ Goals: ✤ semantic and syntactic interoperability ✤ shareable descriptions, vocabularies and constrains✤ Defines: ✤ 15 basic concepts, such as dc:title, dc:creator ✤ Additional classes and concepts in DC Qualifiers
  17. 17. FOAF+SIOC+SKOS http://sioc-project.org
  18. 18. Good Relations✤ De-facto standard for semantic e-commerce ✤ Supported by Google via Rich Snippets ✤ BestBuy showed how to increase revenue with it ✤ Part of the schema.org specification✤ Example information: ✤ the geo-location of the store ✤ the countries the store ships to ✤ the payment options the ship accepts✤ Distribute, open “Amazon”
  19. 19. schema.org✤ Vocabulary for Rich Snippets and Knowledge Graph✤ Yahoo+Bing+Google✤ Microdata vs RDFa (Lite)
  20. 20. Publishing semantics
  21. 21. Linked (Open) Data http://linkeddata.org
  22. 22. 5-Star Data Rules✤ URIs = names for things✤ HTTP URIs = enable look up✤ Provide useful information upon lookup, using the standards (RDF*, SPARQL)✤ Link to other URIs = enable discovery of more things. http://www.w3.org/DesignIssues/LinkedData.html
  23. 23. 5-Star Data Rules✤ URIs = names for things✤ HTTP URIs = enable look up✤ Provide useful information upon lookup, using the standards (RDF*, SPARQL)✤ Link to other URIs = enable discovery of more things. http://www.w3.org/DesignIssues/LinkedData.html
  24. 24. Content negotiation
  25. 25. RDFa and RDFa Lite✤ Extension to XHTML/HTML5 for embeding RDF graph semantics in HTML syntax: ✤ property vs rel ✤ resource vs about ✤ typeof ✤ vocab, prefix
  26. 26. RDFa and RDFa Lite✤ Extension to XHTML/HTML5 for embeding RDF graph semantics in HTML syntax: <p vocab="http://schema.org/" property vs rel ✤ prefix="ov: http://open.vocab.org/terms/" resource="#skruk" typeof="Person"> My name is <span property="name">Sebastian Kruk</span> ✤ resource vs about and you can give me a ring via <span property="telephone">+41-78-87-961-89</span>. <img property="image" src="http://bit.ly/QAYF10" /> My favorite animal is the <span property="ov:preferredAnimal">Hamster</span>. ✤ </p>typeof ✤ vocab, prefix
  27. 27. Rich Snippets (microdata)<div class="col-right small" itemid="http://example/" itemtype="http://schema.org/FurnitureStore"> <ul class="list"><li><div itemprop="address" itemscope="" itemtype="http://schema.org/PostalAddress"> <p> <span itemprop="postalCode">5210</span> <span itemprop="addressLocality">Windisch</span><br> <span itemprop="addressCountry">Switzerland</span><br> </p> <p> <a class="email" href="mailto:windisch@kruk.me" itemprop="email">windisch@kruk.me</a> <span itemprop="telephone">+41788796189</span><br> </p> </div></li></ul>
  28. 28. Rich Snippets (RDFa Lite)<div class="col-right small" resource="http://example.com/" typeof="FurnitureStore"vocab="http://schema.org/"> <ul class="list"><li><div property="address" typeof="PostalAddress"> <p> <span property="postalCode">5210</span> <span property="addressLocality">Windisch</span><br> <span property="addressCountry">Switzerland</span><br> </p> <p> <a class="email" href="mailto:windisch@kruk.me" property="email">windisch@kruk.me</a> <span property="telephone">+41788796189</span><br> </p> </div></li></ul></div>
  29. 29. Consuming semantics
  30. 30. SPARQL✤ W3C standard for querying RDF graphs✤ Purposely made similar to SQL (to the extent possible)✤ SPARQL endpoint: a standard way to expose (open) data published by the service
  31. 31. Path queries✤ ?a :d “D”.✤ ?a :a ?b. ?b :e “E”; :f “F”.✤ ?a :b [ :c “C” ].
  32. 32. Path queries :c C :b✤ ?a :d “D”. :a :e ?a ?b E✤ ?a :a ?b. ?b :e “E”; :f “F”. :d :f✤ ?a :b [ :c “C” ]. D F
  33. 33. SELECT and more✤ PREFIX dc: <http://purl.org/dc/elements/1.1/>✤ SELECT ?title WHERE { <http://mybook.com> dc:title ?title.}✤ CONSTRUCT { ?b ns:isKnownBy ?a } WHERE { ?a foaf:knows ?b }✤ ASK { <http://kruk.me/> foaf:knows ?c }✤ DESCRIBE ?a WHERE { ?a foaf:knows <http://kruk.me> }
  34. 34. SPARQL Filtering✤ OPTIONAL { ?x ns:y ?z }✤ FILTER ( xsd:dateTime(?date) > xsd:dateTime("2010-03-01T00:00:00Z") )✤ FILTER regex( ?value, "This is a S+", "i" )✤ isURI/isIRI, isBlank, isLiteral, sameTerm, langMatches✤ str, lang, datatype
  35. 35. Python RDFLibfrom rdflib.graph import Graph, URIReffrom rdflib.namespace import Namespacefrom rdflib import pluginplugin.register(sparql, rdflib.query.Processor, rdfextras.sparql.processor, Processor)plugin.register(sparql, rdflib.query.Result, rdfextras.sparql.query, SPARQLQueryResult)plugin.register(turtle, rdflib.serializer.Serializer, rdflib.plugins.serializers.turtle, TurtleSerializer)namespaces = { skos : Namespace(http://www.w3.org/2004/02/skos/core#), }def list_friends(f_name, uri): g = Graph() g.parse(f_name, format="n3") query = "SELECT ?fn WHERE { ?f foaf:knows <%s>; foaf:name ?fn. }" % uri return [ f for f in g.query(query, initNs=namespaces) ]
  36. 36. Read RDFa into RDFfrom pyRdfa import pyRdfa, Optionsdef rdf2turtle(url): options = Options(output_processor_graph=True) turtle = pyRdfa(options=options).rdf_from_source(url, outputFormat=turtle) return turtle
  37. 37. Gotchas
  38. 38. Don’t overcomplicate✤ Gödel’s Incompleteness Theorems✤ First-Order Logic vs OWL-Full / CYC✤ Jim Handler: “Little semantics go a long way”✤ Folksonomies
  39. 39. OOP vs Description Logic✤ B rdfs:subClassOf A C rdfs:domain A D rdfs:domain B✤ Infers: ✤ C rdfs:domain B [WRONG!] ✤ D rdfs:domain A [OK]
  40. 40. OOP vs Description Logic✤ B rdfs:subClassOf A C rdfs:domain A D rdfs:domain B domain A C✤ Infers: subClassOf domain B D ✤ C rdfs:domain B [WRONG!] ✤ D rdfs:domain A [OK]
  41. 41. Open World Assumptions✤ RDF is by it’s virtue a distributed being ✤ You might only have a part of it ✤ The rest is on Linked Data✤ Unlike in the close world assumption reasoning, if there is no statement “Sebastian isFrom Poland” it does not mean, I am not.
  42. 42. RDBMS and NoSQL vs RDF✤ We can store RDF in RDBMS; even easier in NoSQL✤ Certain SPARQL path queries can be translated to SQL✤ Usually no joint queries NoSQL ➡ DIY path querying
  43. 43. How can web semantics help✤ interoperability✤ information retrieval✤ recommendations and matchmaking✤ SEO
  44. 44. Linked Data is KingDr. Sebastian Ryszard KrukCTO/CRO Knowledge Hives sp. z o.o., sebastian@kruk.me
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×