microdata)and) schema · 2014. 5. 7. · html5)! started)by)whatwg)as)an)alternave)to)...

26
Microdata and schema.org

Upload: others

Post on 26-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

Microdata  and  schema.org  

 

Page 2: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

Basics  

l Microdata  is  a  simple  seman0c  markup  scheme  that’s  an  alterna0ve  to  RDFa  

l Developed  by  WHATWG  and  supported  by  major  search  companies  (Google,  MicrosoD,  Yahoo,  Yandex)  

l Like  RDFa,  it  uses  HTML  tag  aIributes  to  host  metadata  

l Vocabularies  are  controlled  and  hosted  at  schema.org  

Page 3: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

What  is  WHATWG?  

l Web  Hypertext  Applica0on  Technology  Working  Group  –  Community  interested  in  evolving  the  Web  with  focus  on  HTML  and  Web  API  development  

–  Ian  Hickson  is  a  key  person,  now  at  Google  l Founded  in  2004  by  individuals  from  Apple,  Mozilla  and  Opera  aDer  a  W3C  workshop  –  Concern  about  W3C's  embrace  of  XHTML  

l Current  work  on  HTML5  l Developed  Microdata  spec  

Page 4: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

h8p://whatwg.org/  

Page 5: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

HTML5  

l Started  by  WHATWG  as  an  alterna0ve  to  XHTML,  joined  by  W3C  –  A  W3C  candidate  recommenda0on  in  2012  (draD)  –  WHATWG  will  evolve  it  as  a  “living  standard”  

l HTML5  ≈  HTML  +  CSS  +  js  l Na0ve  support  for  graphics,  video,  audio,  speech,  seman0c  markup,  …  

l Current  par0al  support  in  major  browsers  &  extensions  

Page 6: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

HTML  taxonomy  and  status  

Page 7: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

Microdata  

l The  microdata  effort  has  two  parts:    –  A  markup  scheme    –  A  set  of  vocabularies/ontologies  

l The  markup  is  similar  to  RDFa  in  providing  ways  to  iden0fy  subjects,  types,  proper0es  &  objects  There’s  also  a  standard  way  to  encode  microdata  as  RDFa  

l The  sanc0oned  vocabularies  are  found  at  schema.org  and  include  a  small  number  of  very  useful  ones:  people,  movies,  etc.  

 

Page 8: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

An  example    

         <div>    <h1>Avatar</h1>    <span>Director:  James  Cameron  (born  1954)  </span>    <span>Science  fic0on</span>    <a  href=”avatar-­‐trailer.html">Trailer</a>  </div>  

Page 9: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

An  example:  itemscope    

l  An  itemscope  aIribute  iden0fies  a  content  subtree  that  is  the  subject  about  which  we  want  to  say  something  

     <div  itemscope  >      <h1>Avatar</h1>      <span>Director:  James  Cameron  (born  1954)  </span>      <span>Science  fic0on</span>      <a  href=”avatar-­‐trailer.html">Trailer</a>  </div>  

Page 10: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

An  example:  itemtype    

l  An  itemscope  aIribute  iden0fies  a  content  subtree  that  is  the  subject  about  which  we  want  to  say  something  

l  The  itemtype  aIribute  specifies  the  subject’s  type      <div  itemscope  itemtype="h8p://schema.org/Movie">      <h1>Avatar</h1>      <span>Director:  James  Cameron  (born  1954)  </span>      <span>Science  fic0on</span>      <a  href=”avatar-­‐trailer.html">Trailer</a>  </div>  

Page 11: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

Microdata  <-­‐>  RDF  http://rdf-translator.appspot.com/

Page 12: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

Microdata  <-­‐>  RDF  http://rdf-translator.appspot.com/

Page 13: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

An  example:  itemtype    

l  An  itemscope  aIribute  iden0fies  a  content  subtree  that  is  the  subject  about  which  we  want  to  say  something  

l  The  itemtype  aIribute  specifies  the  subject’s  type      <div  itemscope  itemtype="h8p://schema.org/Movie">      <h1>Avatar</h1>      <span>Director:  James  Cameron  (born  1954)  </span>      <span>Science  fic0on</span>      <a  href=”avatar-­‐trailer.html">Trailer</a>  </div>  

[ ] a schema:Movie .

Page 14: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

An  example:  itemprop    

l  An  itemscope  aIribute  iden0fies  a  content  subtree  that  is  the  subject  about  which  we  want  to  say  something  

l  The  itemtype  aIribute  specifies  the  subject’s  type  l  An  itemprop  aIribute  gives  a  property  of  that  type    <div  itemscope  itemtype="h8p://schema.org/Movie">      <h1  itemprop="name">Avatar</h1>      <span>Director:  James  Cameron  (born  1954)  </span>      <span  itemprop="genre">Science  fic0on</span>      <a  href=”avatar-­‐trailer.html”  itemprop="trailer">Trailer</a>  </div>  

Page 15: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

An  example:  itemprop    

l  An  itemscope  aIribute  iden0fies  a  content  subtree  that  is  the  subject  about  which  we  want  to  say  something  

l  The  itemtype  aIribute  specifies  the  subject’s  type  l  An  itemprop  aIribute  gives  a  property  of  that  type    <div  itemscope  itemtype="h8p://schema.org/Movie">      <h1  itemprop="name">Avatar</h1>      <span>Director:  James  Cameron  (born  1954)  </span>      <span  itemprop="genre">Science  fic0on</span>      <a  href=”avatar-­‐trailer.html”  itemprop="trailer">Trailer</a>  </div>  

[ ] a schema:Movie ; schema:genre "Science fiction" ; schema:name "Avatar" ; schema:trailer <avatar-trailer.html> .

Page 16: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

An  example:  embedded  items    

l  An  itemprop  immediately  followed  by  another  itemcope  makes  the  value  an  object  

<div  itemscope  itemtype="hIp://schema.org/Movie">    <h1  itemprop="name">Avatar</h1>          <div  itemprop="director"                          itemscope  itemtype="h8p://schema.org/Person">                  Director:  <span  itemprop="name">James  Cameron</span>                      (born    <span  itemprop="birthDate">1954</span>)          </div>      <span  itemprop="genre">Science  fic0on</span>    <a  href="avatar-­‐trailer.html"  itemprop="trailer">Trailer</a>  </div>  

Page 17: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

An  example:  embedded  items    

l  An  itemprop  immediately  followed  by  another  itemcope  makes  the  value  an  object  

<div  itemscope  itemtype="hIp://schema.org/Movie">    <h1  itemprop="name">Avatar</h1>          <div  itemprop="director"                          itemscope  itemtype="h8p://schema.org/Person">                  Director:  <span  itemprop="name">James  Cameron</span>                      (born    <span  itemprop="birthDate">1954</span>)          </div>      <span  itemprop="genre">Science  fic0on</span>    <a  href="avatar-­‐trailer.html"  itemprop="trailer">Trailer</a>  </div>  

[ ] a schema:Movie ; schema:director [ a schema:Person ; schema:birthDate "1954" ; schema:name "James Cameron" ] ; schema:genre "Science fiction" ; schema:name "Avatar" ; schema:trailer <avatar-trailer.html> .

Page 18: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

schema.org  vocabulary  

l Full  type  hierarchy  in  one  file  l 548  classes,  711  proper0es  (5/4/14)  l Data  types:  Boolean,  Date,  DateTime,  Number  (Float,  Integer)  Text  (URL),  Time  

l Objects:    Rooted  at  Thing  with  two  ‘metaclasses’  (Class  and  Property)  and  eight  subclasses  

Page 19: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

h8p://www.schema.org/Recipe  

Page 20: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

Microdata  as  a  KR  language  

l More  than  RDF,  less  than  RDFS  l Proper0es  have  an  expected  type  (range)  

–  Might  be  a  string  –  A  list  of  types,  any  of  which  are  OK  

l Proper0es  aIached  ≥  1  types  (domain)  l Classes  can  have  mul0ple  parents  and  inherit  (proper0es)  from  all  of  them    

l No  axioms  (e.g.,  disjointness,  cardinality,  etc.)  l No  subPropertyOf  like  rela0on  

Page 21: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

Mixing  vocabularies  

l Microdata  is  intended  to  work  with  just  one  vocabulary  –  the  one  at  schema.org  

l Advantages  –  Simple,  organized,  well  designed  –  Controlled  by  the  schema.org  people  

l Disadvantages:  too  simple,  controlled  –  Too  simple,  narrow,  mono-­‐lingual  –  Controlled  by  the  schema.org  people  

l Schema.rdfs.org  defines  mappings  between  schema.org  and  popular  RDF  ontologies  

Page 22: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

Schema  <-­‐>  RDF  hIp://schema.rdf.org  

Page 23: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

Extending  the  schema.org  ontology  

l hIp://www.schema.org/docs/extension.html  l You  can  subclass  exis0ng  classes  

–  Person/Engineer  –  Person/Engineer/ElectricalEngineer  

l Subclass  exisi0ng  proper0es  –  musicGroupMember/leadVocalist  –  musicGroupMember/leadGuitar1  –  musicGroupMember/leadGuitar2  

 

Page 24: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

Extension  Problems  

l Do  agreed  upon  meaning    –  Through  axioms  supported  by  the  language  (e.g.,  equivalence,  disjointness,  etc.)  

–  No  place  for  documenta0on  (annota0ons,  labels,  comments)  

l Without  a  namespace  mechanism,  your  Person/Engineer  and  mine  can  be  confused  and  might  mean  different  things  

 

Page 25: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

SerializaTon  

l Schema.org  has  a  data  model  and  serializa0ons  –  Microdata  is  the  original,  na0ve  steriliza0on  –  RDFa  is  more  expressive  and  works  with  the  RDF  stack  –  Everyone  agrees  that  RDFa  Lite  is  a  good  encoding:  as  simple  as  Microdata  but  more  expressive  

–  JSON-­‐LD  is  also  an  accepted  encoding  

l Search  engines  look  for  Microdata  and  RDFa  encodings  and  are  beginning  to  look  for  JSON-­‐LD  

l Schema.org  considers  RDFa  to  be  the  “canonical  machine  representa0on  of  schema.org”  

Page 26: Microdata)and) schema · 2014. 5. 7. · HTML5)! Started)by)WHATWG)as)an)alternave)to) XHTML,)joined)by)W3C) – A)W3C)candidate)recommendaon)in)2012)( dra ) – WHATWG)will)evolve)itas)a“living)standard

l Microdata  is  a  good  effort  by  the  search  companies  to  use  a  simple  seman0c  language  

l The  seman0cs  is  pragma0c  –  e.g.,  expected  types:  A  string  is  accepted  where  a  thing  is  expected  –  “some  data  is  beIer  than  none”  

l The  real  value  is  in      –  the  supported  vocabularies  and  –  their  use  by  Search  companies  

l =>  Immediate  mo0va0on  for  using  seman0c  markup  

Conclusions