Your SlideShare is downloading. ×
0
Semantic Web                                               Technologies                                                   ...
Semantic Web Technologies Last Lecture....2                                                                             D ...
Semantic Web Technologies    Content3    1. Introduction    2. Semantic Web - Basic Architecture             Languages of ...
FS                               D4           R                                                                         SO...
Semantic Web Technologies    Content5    2. Semantic Web Basic Architecture       The Languages of the Semantic Web - Part...
2. Semantic Web - Basic Architecture             Languages of the Semantic Web - Part 16             Semantic Web Technolo...
Why RDFSchema...?7              • An application program can define and use RDF data              • ….if the application pr...
RDFSchema8                     • First W3C draft in April 1998,                       W3C Recommendation Feb. 2004.       ...
RDFSchema9                           • RDFSchema allows:                           • Definition of classes                 ...
Example10                                                                                                                 ...
Vocabulary11                 • Classes                    • rdfs:Resource                       every entity of an RDF mod...
Vocabulary12                   •Properties                     • rdfs:subClassOf                       transitive property...
Vocabulary13             ■Properties               □ rdfs:subClassOf                 transitive property to define inherita...
Vocabulary1514             ■Properties               □ rdfs:subPropertyOf                 transitive property to define inh...
Language Model                                                                        t                                 t ...
Vocabulary16                • Further Properties                  • rdfs:seeAlso                      defines a relation of...
RDF(S) Knowledge Base17     T-Box                                                                                         ...
Example             @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>                                  Turtle    ...
Summary               • RDFSchema defines a data model for the definition of simple ontologies                   (knowledge ...
led ge                                           kn ow                                  mu  ch             (S)            ...
How much knowledge                                                   (semantics) has RDF(S)                               ...
How much knowledge                                                   (semantics) has RDF(S)                               ...
an we                                           ion sc                                 Co nc lus      F(S )?              ...
What conclusions can we deduce                                          with RDF(S)?                                 rdfs:...
What conclusions can we deduce                                          with RDF(S)?                                 rdfs:...
What conclusions can we deduce                                          with RDF(S)?                                      ...
What conclusions can we deduce                                          with RDF(S)?                                      ...
cie nt for                                             (S) s uffi        tat ion                                    Is R  D...
Semantic Web Technologies     Content29     2. Semantic Web Basic Architecture        The Languages of the Semantic Web - ...
2. Semantic Web - Basic Architecture             Languages of the Semantic Web - Part 130             Semantic Web Technol...
Semantic Annotation in the Web        • RDF/XML can directly be embedded in an HTML document via             <head> and <s...
Semantic Annotation in the Web            • W3C recommends linking of external RDF documents via                HTML <link...
Semantic Annotation in the Web        • Problem: HTML and RDF data are separate                                        wep...
Semantic Annotation in the Web        • ,Embed‘ RDF into HTML                                        wep page             ...
Semantic Annotation in the Web             Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universit...
Semantic Annotation                               in the Web                                  • In principle there are thr...
Microformats                                 • Microformats (µformats) emerged about 2005                                 ...
Microformats                                 • Microformats reuse of the following (X)HTML tag attributes:                ...
Microformats                              • Simple Example: HTML marked up with hCard microformat        <div class="vcard...
Microformats                                • Microformats reuse existing (X)HTML attributs to encode                     ...
Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
RDFa                               • RDFa = RDF in HTML attributes                               • enables generic RDF ann...
RDFa                                 • RDFa Lite reuses existing HTML attributes                                   •vocab,...
RDFa                                • First we need a vocabulary to talk about things                                    <...
RDFa                              • Then we have to define the type of thing we are talking                                ...
RDFa Lite                                • Now we can define all properties of the thing we are                            ...
RDFa Lite                             • We can create identifiers for the things we are talking                            ...
RDFa Lite                              • And if the vocabulary is not sufficient to describe all                           ...
RDFa                               • With RDFa you have can add additional functionality                                  ...
RDFa                               • With RDFa you have can add additional functionality                                  ...
RDFa                               • Difference between resource and about       <div resource="/alice/posts/trouble_with_...
RDFa                               • Difference between resource and about      <ul resource="/alice/posts/trouble_with_bo...
RDFa                               • Difference between resource and about      <ul resource="/alice/posts/trouble_with_bo...
RDFa                              • Difference between resource and about      <ul resource="/alice/posts/trouble_with_bob...
RDFa                            • Difference between property and rel       <div vocab="http://xmlns.com/foaf/0.1/" resour...
RDFa                                 • Distinguish two different sorts of RDF triples                                    •...
Differences with RDFa 1.0                           <html>                                                                ...
RDFa            <?xml version="1.0" encoding="UTF-8"?>            <html xmlns="http://www.w3.org/1999/xhtml" version="XHTM...
RDFa                 RDFa is already applied by                  • Google, Yahoo                  • Facebook, MySpace,    ...
RDFa     ...but how does HTML + RDFa become RDF?             Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-I...
http://www.flickr.com/photos/cho45/1402634073/                          •Gleaning                          •Resource Descr...
http://www.flickr.com/photos/cho45/1402634073/                  • Gleaning Resource Descriptions from Dialects of         ...
http://www.flickr.com/photos/cho45/1402634073/            • To extract semantic anotation from a document, GRDDL does     ...
http://www.flickr.com/photos/cho45/1402634073/                                                     GRDDL Profildata (XHTML...
http://www.flickr.com/photos/cho45/1402634073/        <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> ...
RDFa                       ...more RDFa Extractors             Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner...
HTML5 Microdata        • HTML5 Microdata extends microformats and addresses          its shortcomings        • schema.org ...
schema.org             Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, ...
schema.org                • Initiative started by Bing, Google, Yahoo! on June 2, 2011.                • Goals:           ...
schema.org and Rich Snippets          • Snippets = The few lines of text that appear under every search result            ...
HTML5 Microdata            • Microdata extends microformats and addresses its shortcomings            • Microdata annotate...
HTML5 Microdata           • HTML5 microdata specification comprises                 • microdata Vocabularies (http://data-v...
<section itemscope itemtype="http://data-vocabulary.org/Person">        Hello, my name is        <span itemprop="name">Joh...
http://www.google.com/webmasters/tools/richsnippets             Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattne...
schema.org                 movies                  people                   recipes                                       ...
schema.org    products          music         events                   ...                                                ...
schema.org                 •extends microdata vocabulary with proprietary category                  hierarchies:          ...
schema.org                                                                                                         http://...
schema.org                                                            vs.                                                 ...
schema.org - RDFa Mapping         1.<div vocab="http://schema.org/" typeof="Product">         2.  <img rel="image" src="de...
Microdata Usage                                                                    http://tripletalk.wordpress.com/2011/01...
Semantic Web Technologies     Content82     2. Semantic Web Basic Architecture        The Languages of the Semantic Web - ...
83                                                                                                       Q L              ...
2. Semantic Web Basic Architecture     2.4 RDF Schema     2.5 How Do We Get Semantics into WWW?84           Bibliography  ...
2. Semantic Web Basic Architecture     2.1 Uniform Resource Identifier     2.2 XML und XMLSchema     2.3 Resource Descripti...
Upcoming SlideShare
Loading in...5
×

03 Semantic Web Technologies - RDFS and RDFa

1,154

Published on

Published in: Education
1 Comment
2 Likes
Statistics
Notes
No Downloads
Views
Total Views
1,154
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
99
Comments
1
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of "03 Semantic Web Technologies - RDFS and RDFa"

  1. 1. Semantic Web Technologies Lecture Dr. Harald Sack Hasso-Plattner-Institut für IT Systems Engineering University of Potsdam Winter Semester 2012/13 Lecture Blog: http://semweb2013.blogspot.com/ This file is licensed under the Creative Commons Attribution-NonCommercial 3.0 (CC BY-NC 3.0)Dienstag, 30. Oktober 12
  2. 2. Semantic Web Technologies Last Lecture....2 D F R Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  3. 3. Semantic Web Technologies Content3 1. Introduction 2. Semantic Web - Basic Architecture Languages of the Semantic Web - Part 1 3. Knowledge Representation and Logics Languages of the Semantic Web - Part 2 4. Applications in the ,Web of Data‘ Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  4. 4. FS D4 R SO ... WE NEED A WAY TO DEFINE RDF SCHEMATA FOR CLASSES AND RELATIONS ?! Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  5. 5. Semantic Web Technologies Content5 2. Semantic Web Basic Architecture The Languages of the Semantic Web - Part 1 • Uniform Resource Identifier - URI • Recapitulation: XML and XMLSchema • Resource Description Framework - RDF • RDF Schema • How Do We Get Semantics into WWW? • µFormats, schema.org, RDFa and GRDDL • Query Language SPARQL • Why RDF(S) is not enough Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  6. 6. 2. Semantic Web - Basic Architecture Languages of the Semantic Web - Part 16 Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  7. 7. Why RDFSchema...?7 • An application program can define and use RDF data • ….if the application program knows, which terms and classes to use, as e.g. • name, title, year, … • name, blog, phone number… • author, cites, … • But..... • Are all terms known? • Are all terms correct? • Are there (logical) relations among the terms? • We need a language for data definition: RDF Schema • officially called “RDF Vocabulary Description Language” Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  8. 8. RDFSchema8 • First W3C draft in April 1998, W3C Recommendation Feb. 2004. • RDF Schema defines a data model for the creation of RDF statements • abstract data type (class) • hierarchical class model and class inheritance (subclasses) • Syntax for common data exchange • = „Language for the definition of structured vocabularies.“ Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  9. 9. RDFSchema9 • RDFSchema allows: • Definition of classes •Class instantiation in RDF via <rdf:type> • Definition of properties and restrictions • Definition of hierarchies •Subclasses and superclasses Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  10. 10. Example10 class Person class subClassOf domain property class Course range is managed by Staff subClassOf subClassOf subClassOf class class subClassOf class class Seminar Lecture Prof. Senior Researcher RDFS rdf:type rdf:type RDF exv:SemanticWebTechnologies exv:HaraldSack exv:isManagedBy Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  11. 11. Vocabulary11 • Classes • rdfs:Resource every entity of an RDF model is instance of this class • rdf:Property Base class for properties • rdfs:Class Concept of a class, defines an abstract object and is applied (with rdf:type) to create instances • rdfs:Literal Class for literals • and additionally rdfs:Datatype, rdf:XMLLiteral, rdfs:Container, rdfs:ContainerMembershipProperty Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  12. 12. Vocabulary12 •Properties • rdfs:subClassOf transitive property to define inheritance hierarchies for classes • rdfs:subPropertyOf transitive property to define inheritance hierarchies for properties • rdfs:domain defines the domain of a property concerning a class • rdfs:range defines range of a property concerning a class Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  13. 13. Vocabulary13 ■Properties □ rdfs:subClassOf transitive property to define inheritance hierarchies for classes (1) (2) (3) Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  14. 14. Vocabulary1514 ■Properties □ rdfs:subPropertyOf transitive property to define inheritance hierarchies for properties (1) (2) (3) Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  15. 15. Language Model t t rdfs:Class rdfs:Resource s t t s s t rdfs:Literal rdf:Property rdf:type t t t t rdfs:comment t rdfs:range rdfs:domain rdfs:subClassOf s – subclass relation rdfs:subPropertyOf t – instance relation Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  16. 16. Vocabulary16 • Further Properties • rdfs:seeAlso defines a relation of a resource to another, which explains it • rdfs:isDefinedBy subproperty of rdf:seeAlso, defines the relation of a resource to its definition • rdfs:comment comment, usually as text • rdfs:label „readable“ name of a resource (contrary to ID) Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  17. 17. RDF(S) Knowledge Base17 T-Box class Terminologcal Knowledge Person class subClassOf domain property class Course range is managed by Staff subClassOf subClassOf subClassOf class class subClassOf class class Seminar Lecture Prof. Senior Researcher RDFSA-Box rdf:type RDF rdf:typeAssertional Knowledge exv:SemanticWebTechnologies exv:HaraldSack exv:isManagedBy Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  18. 18. Example @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> Turtle @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> @prefix xsd: <http://www.w3.org/2001/XMLSchema#>. @base <http://hpi-web.de/ws1213> :Course a rdfs:Class . :Lecture a rdfs:Class; rdfs:subClassOf :Course. :Seminar a rdfs:Class ; rdfs:subClassOf :Course. :Person a rdfs:Class . :Staff a rdfs:Class ; rdfs:subClassOf :Person . :SeniorResearcher a rdfs:Class ; rdfs:subClassOf :Staff . :isManagedBy a rdf:Property; rdfs:domain :Course ; rdfs:range :Staff . :SemanticWebTechnologies a :Lecture . :HaraldSack a :SeniorResearcher . :SemanticWebTechnologies :isManagedBy :HaraldSack . Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  19. 19. Summary • RDFSchema defines a data model for the definition of simple ontologies (knowledge representations). • Via RDFSchema ontologies RDF statements (facts) can be expressed • More than XML: • (small) ontological agreement about modelling primitives • Possibility to define own vocabularies • Next steps: • more logic • Constrains, dependencies, and rules Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  20. 20. led ge kn ow mu ch (S) Ho w sR DF tics ) ha (s em an Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  21. 21. How much knowledge (semantics) has RDF(S) rdfs:Class rdfs:Class rdfs:Property exv:Lecture exv:takesPlace exv:Event rdf:type rdf:type exv:SemanticWebTechnologies exv:takes Place exv:hasRoom exv:hasName HS3 Semantic Web Technologies exv:hasDate Tue 13.30-15.00 Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  22. 22. How much knowledge (semantics) has RDF(S) rdfs:Class rdfs:Class rdfs:Property exv:Lecture exv:takesPlace exv:Event rdf:type rdf:type exv:SemanticWebTechnologies exv:takes Place exv:hasRoom exv:hasName HS3 Semantic Web Technologies exv:hasDate Tue 13.30-15.00 • The semantics of a term from an RDF(S) ontology is given in terms of its properties and its values (instances) Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  23. 23. an we ion sc Co nc lus F(S )? Wh at ith RD ed uc ew d Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  24. 24. What conclusions can we deduce with RDF(S)? rdfs:Class rdfs:Class rdfs:Property exv:Lecture exv:takesPlace exv:Event rdf:type exv:SemanticWebTechnologies exv:takes place • Deduction of entity class membership from the domain of one of its properties Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  25. 25. What conclusions can we deduce with RDF(S)? rdfs:Class rdfs:Class rdfs:Property exv:Lecture exv:takesPlace exv:Event rdf:type rdf:type exv:SemanticWebTechnologies exv:takes place • Deduction of entity class membership from the range of one of its properties Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  26. 26. What conclusions can we deduce with RDF(S)? rdfs:Class exv:Course rdfs:subClassOf rdf:type rdfs:Class rdfs:Property exv:Lecture exv:takesPlace exv:Event rdfs:Class rdf:type rdf:type exv:SemanticWebTechnologies exv:takesPlace • Deduction of entity superclass membership from a class hierarchy. Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  27. 27. What conclusions can we deduce with RDF(S)? rdfs:Class rdfs:Property exv:Person exv:isParentOf exv:Person rdfs:subPropertyOf rdfs:Property exv:Person exv:isMotherOf exv:Person rdfs:Class rdfs:Class rdf:type rdf:type exv:Alice exv:Bob exv:isMotherOf exv:Alice exv:Bob exv:isParentOf • Deduction of new facts from subproperty relationships Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  28. 28. cie nt for (S) s uffi tat ion Is R DF pre sen ge Re b? o wl ed ntic We Kn Se ma in the Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  29. 29. Semantic Web Technologies Content29 2. Semantic Web Basic Architecture The Languages of the Semantic Web - Part 1 • Uniform Resource Identifier - URI • Recapitulation: XML and XMLSchema • Resource Description Framework - RDF • RDF Schema • How Do We Get Semantics into WWW? • µFormats, schema.org, RDFa and GRDDL • Query Language SPARQL • Why RDF(S) is not enough Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  30. 30. 2. Semantic Web - Basic Architecture Languages of the Semantic Web - Part 130 Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  31. 31. Semantic Annotation in the Web • RDF/XML can directly be embedded in an HTML document via <head> and <script> • RFC 3870 defines Mime-Type application/rdf+xml <head> <title>My Document</title> <script type="application/rdf+xml"> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> <rdf:Description rdf:about="http://www.w3.org/" dc:title="W3C Homepage"/> </rdf:RDF> </script> </head> Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  32. 32. Semantic Annotation in the Web • W3C recommends linking of external RDF documents via HTML <link> element in HTML <head> <link rel="meta" type="application/rdf+xml" href="Meta-Data-for-Web-Page.rdf"/> • RDF documents can also embedded via <a href=...> and additional markup (e.g. RDF logo) withinin HTML <body> Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  33. 33. Semantic Annotation in the Web • Problem: HTML and RDF data are separate wep page HTML RDF data Turtle <http://www.bestbuy.com/site/Plan+9+from+Outer+Space +-+DVD/7167941.p?id=23883&skuId=7167941&st=plan %209%20from%20outer%20space&lp=6&cp=1> <http:// ogp.me/ns#title> "Plan 9 from Outer Space - DVD" . <http://www.bestbuy.com/site/Plan+9+from+Outer+Space +-+DVD/7167941.p?id=23883&skuId=7167941&st=plan %209%20from%20outer%20space&lp=6&cp=1> <http:// ogp.me/ns#type> "product" . <http://www.bestbuy.com/site/Plan+9+from+Outer+Space +-+DVD/7167941.p?id=23883&skuId=7167941&st=plan %209%20from%20outer%20space&lp=6&cp=1> <http:// ogp.me/ns#url> "http://www.bestbuy.com:80/site/Plan-9- from-Outer-Space---DVD/6429224.p? id=23883&skuId=7167941" . • Maintenance <http://www.bestbuy.com/site/Plan+9+from+Outer+Space +-+DVD/7167941.p?id=23883&skuId=7167941&st=plan • Verification • Consistency %209%20from%20outer%20space&lp=6&cp=1> <http:// ogp.me/ns#image> "http://images.bestbuy.com:80/ BestBuy_US/images/products/6429/6429224s.jpg" . <http://www.bestbuy.com/site/Plan+9+from+Outer+Space +-+DVD/7167941.p?id=23883&skuId=7167941&st=plan Hasso-Plattner-Institut, Universität Potsdam Semantic Web Technologies , Dr. Harald Sack, %209%20from%20outer%20space&lp=6&cp=1> <http://Dienstag, 30. Oktober 12
  34. 34. Semantic Annotation in the Web • ,Embed‘ RDF into HTML wep page HTML RDF data Turtle <http://www.bestbuy.com/site/Plan+9+from+Outer+Space +-+DVD/7167941.p?id=23883&skuId=7167941&st=plan %209%20from%20outer%20space&lp=6&cp=1> <http:// ogp.me/ns#title> "Plan 9 from Outer Space - DVD" . <http://www.bestbuy.com/site/Plan+9+from+Outer+Space +-+DVD/7167941.p?id=23883&skuId=7167941&st=plan %209%20from%20outer%20space&lp=6&cp=1> <http:// ogp.me/ns#type> "product" . <http://www.bestbuy.com/site/Plan+9+from+Outer+Space +-+DVD/7167941.p?id=23883&skuId=7167941&st=plan %209%20from%20outer%20space&lp=6&cp=1> <http:// ogp.me/ns#url> "http://www.bestbuy.com:80/site/Plan-9- from-Outer-Space---DVD/6429224.p? id=23883&skuId=7167941" . <http://www.bestbuy.com/site/Plan+9+from+Outer+Space +-+DVD/7167941.p?id=23883&skuId=7167941&st=plan %209%20from%20outer%20space&lp=6&cp=1> <http:// ogp.me/ns#image> "http://images.bestbuy.com:80/ BestBuy_US/images/products/6429/6429224s.jpg" . <http://www.bestbuy.com/site/Plan+9+from+Outer+Space +-+DVD/7167941.p?id=23883&skuId=7167941&st=plan Hasso-Plattner-Institut, Universität Potsdam Semantic Web Technologies , Dr. Harald Sack, %209%20from%20outer%20space&lp=6&cp=1> <http://Dienstag, 30. Oktober 12
  35. 35. Semantic Annotation in the Web Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  36. 36. Semantic Annotation in the Web • In principle there are three ways to embed structured data with explicit semantic annotations within HTML documents • Domain specific microformats • Generic RDFa and embedded RDF • HTML5 Microdata including Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  37. 37. Microformats • Microformats (µformats) emerged about 2005 • (X)HTML Markup to express (limited) semantics in an HTML document • designed to solve simple, specific problems • designed for humans first, machines second • used in web pages to describe a specific type of information, as e.g. a person, an event, a product, a review, etc. • Applications can easily extract data from HTML documents • In general, Microformats use the class attribute in HTML tags (most times <span> or <div> tags) and assign brief and descriptive names to entities and their properties Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  38. 38. Microformats • Microformats reuse of the following (X)HTML tag attributes: • class • rel • rev • Predefined standard microformats: • hCard - personal data (vCard, RFC2426) • hCalender – calendars and events • rel-Tag – tags, keywords, categories • XFN – XHTML friends network • hReview, VoteLinks -- opinions, ratings, and reviews • XOXO – lists and outlines • ... http://microformats.org/ Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  39. 39. Microformats • Simple Example: HTML marked up with hCard microformat <div class="vcard"> <span class="fn">Joe Blow</span> <span class="title">Senior Manager</span> <span class="org">The Example Company</span> <span class="adr"> <span class="street-address">Hauptstr. 123, </span> <span class="postal-code">14482</span> <span class="locality">Potsdam</span> </span> Tel.<span class="tel">604-555-1234</span> <img class="photo" src="www.example.com/JoeBlow.jpg" /> </div> Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  40. 40. Microformats • Microformats reuse existing (X)HTML attributs to encode structured data • Microformats can easily be transcoded to RDF via XSLT • New microformat vocabularies first must be consolidated by the community, while always a new XSLT stylesheet has to be developed for extraction • By using more than one microformat vocabulary in a single (X)HTML document the processing complexity increases rapidly • Conflicts with used (X)HTML attributes might be possible Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  41. 41. Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  42. 42. RDFa • RDFa = RDF in HTML attributes • enables generic RDF annotation in (X)HTML documents by reusing existing (X)HTML attributes • RDFa 1.0 based on XHTML (W3C Recommendation 2008) • RDFa 1.1 based on HTML5 (W3C Recommendation June 2012) • RDFa Lite 1.1 • RDFa 1.1 Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  43. 43. RDFa • RDFa Lite reuses existing HTML attributes •vocab, •typeof, •property, •resource, •prefix Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  44. 44. RDFa • First we need a vocabulary to talk about things <p vocab="http://xmlns.com/foaf/0.1/"> My name is Harald Sack and you can give me a ring via 1-800-555-0527. </p> Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  45. 45. RDFa • Then we have to define the type of thing we are talking about <p vocab="http://xmlns.com/foaf/0.1/" typeof="Person"> My name is Harald Sack and you can give me a ring via 1-800-555-0527. </p> Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  46. 46. RDFa Lite • Now we can define all properties of the thing we are talking about <p vocab="http://xmlns.com/foaf/0.1/" typeof="Person"> My name is <span property="name">Harald Sack</span> and you can give me a ring via <span property="phone">1-800-555-0527</span>. <img property="img" src="http://hpi-web.de/images/harald.jpg" /> </p> Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  47. 47. RDFa Lite • We can create identifiers for the things we are talking about <p vocab="http://xmlns.com/foaf/0.1/" resource=“#harald“ typeof="Person"> My name is <span property="name">Harald Sack</span> and you can give me a ring via <span property="phone">1-800-555-0527</span>. <img property="img" src="http://hpi-web.de/images/harald.jpg" /> </p> • resource bezieht sich hier auf Basis-URL der Webseite Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  48. 48. RDFa Lite • And if the vocabulary is not sufficient to describe all properties, we can use additional vocabularies by using prefixes <p vocab="http://xmlns.com/foaf/0.1/" prefix=“ov: http://open.vocab.org/terms/“ resource=“#harald“ typeof="Person"> My name is <span property="name">Harald Sack</span> and you can give me a ring via <span property="phone">1-800-555-0527</span>. My favorite beverage is <span property="ov:preferredBeverage">Green Tea </span>. </p> Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  49. 49. RDFa • With RDFa you have can add additional functionality • separate content from presentation <p vocab="http://purl.org/dc/terms/" > <h2 property="title">Syllabus SWT 2012/13</h2> <h3 property="creator" resource="#me">Harald</h3> Creation Date: <span property="created" content="2012-10-28"> 28.10.2012 </span> </p> Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  50. 50. RDFa • With RDFa you have can add additional functionality • use datatypes from XML Schema Definition <p vocab="http://purl.org/dc/terms/" > <h2 property="title">Syllabus SWT 2012/13</h2> <h3 property="creator" resource="#me">Harald</h3> Creation Date: <span property="created" datatype="xsd:gYear"> 2012 </span> </p> • alternatives: • resource <> about and property <> rel Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  51. 51. RDFa • Difference between resource and about <div resource="/alice/posts/trouble_with_bob"> <h2 property="title">The trouble with Bob</h2> <h3 property="creator" resource="#me">Alice</h3> ... </div> • The resource attribute in the <div> element sets the context, i.e. the subject for all subsequent statements. • Also, when combined with the property attribute, resource can be used to set the object for the statement Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  52. 52. RDFa • Difference between resource and about <ul resource="/alice/posts/trouble_with_bob"> ... <li resource="/alice/posts/trouble_with_bob"> <span property="title">The trouble with Bob</span> </li> <li resource="/alice/posts/jos_barbecue"> <span property="title">Jos Barbecue</span> </li> ... </ul> • ...works, but its a bit convoluted Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  53. 53. RDFa • Difference between resource and about <ul resource="/alice/posts/trouble_with_bob"> ... <li resource="/alice/posts/trouble_with_bob" property="title">The trouble with Bob</li> <li resource="/alice/posts/jos_barbecue" property="title">Jos Barbecue</li> ... </ul> • not correct; the combination of property and resource would generate a different statement than originally intended. Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  54. 54. RDFa • Difference between resource and about <ul resource="/alice/posts/trouble_with_bob"> <li about="/alice/posts/trouble_with_bob" property="title">The trouble with Bob</li> <li about="/alice/posts/jos_barbecue" property="title">Jos Barbecue</li> ... </li> • about is only used to set the context Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  55. 55. RDFa • Difference between property and rel <div vocab="http://xmlns.com/foaf/0.1/" resource="#me"> <ul rel="knows"> <li resource="http://example.com/bob/#me" typeof="Person"> <a property="homepage" href="http://example.com/bob/"> <span property="name">Bob</span></a> </li> <li resource="http://example.com/eve/#me" typeof="Person"> <a property="homepage" href="http://example.com/eve/"> <span property="name">Eve</span></a> </li> <li resource="http://example.com/harald/#me" typeof="Person"> <a property="homepage" href="http://example.com/harald/"> <span property="name">Harald</span></a> </li> </ul> </div> • rel never considers the textual content of an element • parser is always looking for a target (object) Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  56. 56. RDFa • Distinguish two different sorts of RDF triples •Triple with resource as object •Triple with literal as object Subjekt Property Objekt content or Object is Literal resource/about property #PCDATA Object is Resource href or resource/about property/rel (URI) resource Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  57. 57. Differences with RDFa 1.0 <html> Namespace ... <div xmlns:dc="http://purl.org/dc/elements/1.1/"> Im currently reading Subject <span about=”urn:ISBN:0-596-00027-8”> <span property="dc:title"> Property Programming Perl Object </span> (Literal) by <span property="dc:creator">Larry Wall</span> </span>. </div> ... </html> Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  58. 58. RDFa <?xml version="1.0" encoding="UTF-8"?> <html xmlns="http://www.w3.org/1999/xhtml" version="XHTML+RDFa 1.0" xml:lang="en"> <head>...</head> <body>...</body> </html> </xml> XHTML <!DOCTYPE html> <html version="HTML+RDFa 1.1" lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:foaf="http://xmlns.com/foaf/0.1/"> HTML5 Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  59. 59. RDFa RDFa is already applied by • Google, Yahoo • Facebook, MySpace, LinkedIn • Best Buy, Tesco, O’Reilly • SlideShare, Digg • WhiteHouse.gov, Library of Congress, UK government • Newsweek, BBC • ... Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  60. 60. RDFa ...but how does HTML + RDFa become RDF? Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  61. 61. http://www.flickr.com/photos/cho45/1402634073/ •Gleaning •Resource Descriptions •from Dialects of Languages Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  62. 62. http://www.flickr.com/photos/cho45/1402634073/ • Gleaning Resource Descriptions from Dialects of Languages • GRDDL provides a simple way to extract RDF from (X)HTML documents • GRDDL applies transformations (XSLT Stylesheets) to extract •RDFa •Mircoformats •RSS • from (X)HTML documents Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  63. 63. http://www.flickr.com/photos/cho45/1402634073/ • To extract semantic anotation from a document, GRDDL does 1. Detect GRDDL Profile metadata 2. Link/Fetch transformation data (Extraktors) 3. Apply transformations to convert into RDF Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  64. 64. http://www.flickr.com/photos/cho45/1402634073/ GRDDL Profildata (XHTML only) <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head profile="http://www.w3.org/2003/g/data-view"> <link rel="transformation" href="http://ns.inria.fr/grddl/rdfa/2008/09/03/RDFa2RDFXML.xsl"/> </head> ... Title: <span property="dc:title"> Digitale Kommunikation: Vernetzung, Multimedia, Sicherheit GRDDL Transformation </span> Category: <span property="dc:subject">Computer Science</span> ... </html> Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  65. 65. http://www.flickr.com/photos/cho45/1402634073/ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head profile="http://www.w3.org/2003/g/data-view"> <link rel="transformation" href="http://ns.inria.fr/grddl/rdfa/2008/09/03/RDFa2RDFXML.xsl"/> </head> ... Title: <rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" <span property="dc:title"> xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> Digitale Kommunikation: Vernetzung, Multimedia, Sicherheit ... </span> <rdf:Description rdf:about=""> Category: <dc:title> <span property="dc:subject">Computer Science</span> Digitale Kommunikation: Vernetzung, Multimedia, Sicherheit ... </dc:title> </html> <dc:subject>Computer Science</dc:subject> </rdf:Description> ... </rdf:RDF> Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  66. 66. RDFa ...more RDFa Extractors Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität Potsdam http://rdfa.info/play/Dienstag, 30. Oktober 12
  67. 67. HTML5 Microdata • HTML5 Microdata extends microformats and addresses its shortcomings • schema.org is the most prominent microdata vocabulary Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  68. 68. schema.org Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  69. 69. schema.org • Initiative started by Bing, Google, Yahoo! on June 2, 2011. • Goals: • Semantic markup for web page content based on proprietary HTML5 microdata schemata •Search engines, web crawler, and Browser recognize and understand schema.org markup •small number of formats (extensible) •RDF mapping available Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  70. 70. schema.org and Rich Snippets • Snippets = The few lines of text that appear under every search result • Designed to give users a sense for what’s on the web page and why it’s relevant to their query • If Google understands the content on the web page, it can create “Rich” Snippets • = detailed information intended to help users with specific queries • You can help Google find this relevant information by adding additional microdata as HTML markup Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  71. 71. HTML5 Microdata • Microdata extends microformats and addresses its shortcomings • Microdata annotates the DOM with scoped name/value pairs from custom vocabularies • centered around custom vocabularies: anyone can define a microdata vocabulary and start embedding custom properties in their own web pages • works with name/value pairs: every microdata vocabulary defines a set of named properties • applies concept of “scoping”: microdata re-use the hierarchical structure of the DOM itself to provide a way to say “all the properties within this element are taken from this vocabulary” Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  72. 72. HTML5 Microdata • HTML5 microdata specification comprises • microdata Vocabularies (http://data-vocabulary.org/) • Persons, Events, Organisations, Products, Reviews, Breadcrumbs, Ads, agreggated Reviews/Ads • microdata Global Attributes • itemscope (creates resource) • itemtype (applied vocabulary) • itemid (identifies resource) • itemprop (property of a resource) • itemref (references on other resources) Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  73. 73. <section itemscope itemtype="http://data-vocabulary.org/Person"> Hello, my name is <span itemprop="name">John Doe</span>, I am a <span itemprop="title">graduate research assistant</span> at the <span itemprop="affiliation">University of Dreams</span>. My friends call me <span itemprop="nickname">Johnny</span>. You can visit my homepage at <a href="http://www.JohnnyD.com" itemprop="url">www.JohnnyD.com</a>. <section itemprop="address" itemscope itemtype="http://data-vocabulary.org/Address"> I live at <span itemprop="street-address">1234 Peach Drive</span> <span itemprop="locality">Warner Robins</span> , <span itemprop="region">Georgia</span>. </section> </section> http://yovisto.com/labs/swt1112/microdata01.html Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  74. 74. http://www.google.com/webmasters/tools/richsnippets Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  75. 75. schema.org movies people recipes http://schema.org/docs/full.html Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  76. 76. schema.org products music events ... http://schema.org/docs/full.html Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  77. 77. schema.org •extends microdata vocabulary with proprietary category hierarchies: • Creative works: • CreativeWork, Book, Movie, MusicRecording, Recipe, TVSeries ... • Embedded non-text objects: • AudioObject, ImageObject, VideoObject • Event • Organization • Person • Place, LocalBusiness, Restaurant ... • Product, Offer, AggregateOffer • Review, AggregateRating •and according properties (relations) with different domain and range http://schema.org/docs/full.html Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  78. 78. schema.org http://schema.org/docs/full.html Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  79. 79. schema.org vs. RDFa Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  80. 80. schema.org - RDFa Mapping 1.<div vocab="http://schema.org/" typeof="Product"> 2.  <img rel="image" src="dell-30in-lcd.jpg" /> 3.  <span property="name">Dell UltraSharp 30" LCD Monitor</span> 5.  <div rel="hasAggregateRating" > 6.    <div typeof="http://schema.org/AggregateRating"> 7.      <span property="ratingValue">87</span> 8.      out of <span property="bestRating">100</span> 9.      based on <span property="ratingCount">24</span> user ratings 10.    </div> 11. </div> 13.  <div rel="offers" > 14.    <div typeof="http://schema.org/AggregateOffer"> 15.      <span property="lowPrice">$1250</span> 16.       to <span property="highPrice">$1495</span> 17.        from <span property="offerCount">8</span> sellers 18.   </div> 19. </div> 20.... 21.</div> http://schema.org/docs/datamodel.html http://schema.rdfs.org/ Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  81. 81. Microdata Usage http://tripletalk.wordpress.com/2011/01/25/rdfa-deployment-across-the-web/ Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  82. 82. Semantic Web Technologies Content82 2. Semantic Web Basic Architecture The Languages of the Semantic Web - Part 1 • Uniform Resource Identifier - URI • Recapitulation: XML and XMLSchema • Resource Description Framework - RDF • RDF Schema • How Do We Get Semantics into WWW? • µFormats, schema.org, RDFa and GRDDL • Query Language SPARQL • Why RDF(S) is not enough Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  83. 83. 83 Q L A R SP Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, via http://www.snee.com/bobdc.blog/2008/10/learning-more-about-sparql.html Universität PotsdamDienstag, 30. Oktober 12
  84. 84. 2. Semantic Web Basic Architecture 2.4 RDF Schema 2.5 How Do We Get Semantics into WWW?84 Bibliography • P. Hitzler, S. Roschke, Y. Sure: Semantic Web Grundlagen, Springer, 2007. • P. Hitzler, M. Krötzsch, S. Rudolph: Foundations of Semantic Web Technologies, CRC Press, 2009. Semantic Web Technologies , Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  85. 85. 2. Semantic Web Basic Architecture 2.1 Uniform Resource Identifier 2.2 XML und XMLSchema 2.3 Resource Description Framework85 □Blog http://semweb2013.blogspot.com/ □Webseite http://www.hpi.uni-potsdam.de/studium/ lehrangebot/itse/veranstaltung/ semantic_web_technologien-3.html □bibsonomy - Bookmarks http://www.bibsonomy.org/user/lysander07/ swt1213_03 Lecture Semantic Web Technologies, Dr. Harald Sack, Hasso-Plattner-Institut, Universität PotsdamDienstag, 30. Oktober 12
  1. A particular slide catching your eye?

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

×