microdata and schema - csee.umbc.eduhtml5 lstarted by whatwg as an alternative to xhtml, joined by...
TRANSCRIPT
![Page 1: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/1.jpg)
Microdataandschema.org
![Page 2: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/2.jpg)
Basics
lMicrodata isasimplesemanticmarkupschemethat’sanalternativetoRDFa
lDevelopedbyWHATWG* andsupportedbymajorsearchcompanies(Google,Microsoft,Yahoo,Yandex)
l LikeRDFa,itusesHTMLtagattributestohostmetadata
lVocabulariesarecontrolledandhostedatschema.org
* Web Hypertext Application Technology Working Group
![Page 3: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/3.jpg)
WhatisWHATWG?
lWebHypertextApplicationTechnologyWorkingGroup– CommunityinterestedinevolvingtheWebwithfocusonHTMLandWebAPIdevelopment
– IanHickson isakeyperson,nowatGoogle
lFoundedin2004byindividualsfromApple,MozillaandOperaafteraW3Cworkshop– ConcernaboutW3C'sembraceofXHTML
lWorkedonHTML5,developedMicrodata spec
![Page 4: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/4.jpg)
HTML5
lStartedbyWHATWGasanalternativetoXHTML,joinedbyW3C– HTML5 recommendation, October2014– HTML5.1 recommendation,November2016– WHATWGwillevolveitasa“livingstandard”
lHTML5≈HTML+CSS+jslNativesupportforgraphics,video,audio,speech,semanticmarkup,…
lCurrentsupportinmajorbrowsers
![Page 5: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/5.jpg)
Microdata
lThemicrodata efforthastwoparts:– Amarkupscheme– A setofvocabularies/ontologies
lThemarkupissimilartoRDFainprovidingwaystoidentifysubjects,types,properties&objectsAlsoastandardwaytoencodeMicrodataasRDFa
lSanctionedvocabulariesatschema.org andincludeasmallnumberofveryusefulones:people,movies,events,recipes,etc.
![Page 6: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/6.jpg)
Anexample
<div><h1>Avatar</h1><span>Director:JamesCameron(born1954)</span><span>Sciencefiction</span><ahref=”avatar-trailer.html">Trailer</a></div>
![Page 7: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/7.jpg)
Anexample:itemscope
l Anitemscope attributeidentifiesacontentsubtree thatisthesubjectaboutwhichwewanttosaysomething
<divitemscope ><h1>Avatar</h1><span>Director:JamesCameron(born1954)</span><span>Sciencefiction</span><ahref=”avatar-trailer.html">Trailer</a></div>
![Page 8: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/8.jpg)
Anexample:itemtype
l Anitemscope attributeidentifiesacontentsubtree thatisthesubjectaboutwhichwewanttosaysomething
l Theitemtype attributespecifiesthesubject’stype
<divitemscope itemtype="http://schema.org/Movie"><h1>Avatar</h1><span>Director:JamesCameron(born1954)</span><span>Sciencefiction</span><ahref=”avatar-trailer.html">Trailer</a></div>
![Page 9: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/9.jpg)
Microdata<->RDF
http://rdf-translator.appspot.com/
![Page 10: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/10.jpg)
Microdata<->RDF
http://rdf-translator.appspot.com/
![Page 11: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/11.jpg)
Anexample:itemtype
l Anitemscope attributeidentifiescontentsubtree thatisthesubjectaboutwhichwewanttosaysomething
l Theitemtype attributespecifiesthesubject’stype
<divitemscope itemtype="http://schema.org/Movie"><h1>Avatar</h1><span>Director:JamesCameron(born1954)</span><span>Sciencefiction</span><ahref=”avatar-trailer.html">Trailer</a></div>
[ ] a schema:Movie .
![Page 12: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/12.jpg)
Anexample:itemprop
l Anitemscope attributeidentifiesacontentsubtree thatisthesubjectaboutwhichwewanttosaysomething
l Theitemtype attributespecifiesthesubject’stypel Anitemprop attributegivesapropertyofthattype
<divitemscope itemtype="http://schema.org/Movie"><h1itemprop="name">Avatar</h1><span>Director:JamesCameron(born1954)</span><spanitemprop="genre">Sciencefiction</span><ahref=”avatar-trailer.html”itemprop="trailer">Trailer</a></div>
![Page 13: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/13.jpg)
Anexample:itemprop
l Anitemscope attributeidentifiesacontentsubtree thatisthesubjectaboutwhichwewanttosaysomething
l Theitemtype attributespecifiesthesubject’stypel Anitemprop attributegivesapropertyofthattype
<divitemscope itemtype="http://schema.org/Movie"><h1itemprop="name">Avatar</h1><span>Director:JamesCameron(born1954)</span><spanitemprop="genre">Sciencefiction</span><ahref=”avatar-trailer.html”itemprop="trailer">Trailer</a></div>
[ ] a schema:Movie ;schema:genre "Science fiction" ;schema:name "Avatar" ;schema:trailer <avatar-trailer.html> .
![Page 14: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/14.jpg)
Anexample:embeddeditems
l Anitemprop immediatelyfollowedbyanotheritemscopemakesthevalueanobject
<divitemscope itemtype="http://schema.org/Movie"><h1itemprop="name">Avatar</h1><divitemprop="director"
itemscope itemtype="http://schema.org/Person">Director:<spanitemprop="name">JamesCameron</span>(born<spanitemprop="birthDate">1954</span>)
</div><spanitemprop="genre">Sciencefiction</span><ahref="avatar-trailer.html"itemprop="trailer">Trailer</a></div>
![Page 15: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/15.jpg)
Anexample:embeddeditems
l Anitemprop immediatelyfollowedbyanotheritemcope makesthevalueanobject
<divitemscope itemtype="http://schema.org/Movie"><h1itemprop="name">Avatar</h1><divitemprop="director"
itemscope itemtype="http://schema.org/Person">Director:<spanitemprop="name">JamesCameron</span>(born<spanitemprop="birthDate">1954</span>)
</div><spanitemprop="genre">Sciencefiction</span><ahref="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 16: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/16.jpg)
schema.org vocabulary
lFulltypehierarchyinonefilel619classes,876properties(Nov‘17)lDatatypes:Boolean,Date,DateTime,Number,Text,Time
lObjects:RootedatThingwithtwo‘metaclasses’(ClassandProperty)andeightsubclasses
lSeegithubrepo forexamplesandcode
![Page 17: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/17.jpg)
http://www.schema.org/Recipe
![Page 18: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/18.jpg)
TestingStructuredDatainHTML
![Page 19: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/19.jpg)
TestingStructuredDatainHTML
![Page 20: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/20.jpg)
TestingStructuredDatainHTML
![Page 21: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/21.jpg)
MicrodataasaKRlanguage
lMorethanRDF,lessthanRDFSlPropertieshaveanexpected type(range)
– Canbealistoftypes,any ofwhichareOK– Mightbeastringformanyproperties(“somedatabetterthannone”)
lPropertiesattached≥1types(domain)lClassescanhavemultipleparentsandinherit(properties)fromallofthem
lNoaxioms(e.g.,disjointness,cardinality,etc.)lNorelationlikesubPropertyOf
![Page 22: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/22.jpg)
Mixingvocabularies
lMicrodataisintendedtoworkwithjustonevocabulary:theoneatschema.org
lAdvantages:simpleandcontrolled– Simple,organized,welldesigned– Controlledbytheschema.org people
lDisadvantages:toosimple,toocontrolled– Toosimple,narrow,mono-lingual– Controlledbytheschema.orgpeople
![Page 23: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/23.jpg)
Extendingschema.orgontology
lExtensions:hostedvs.external– Hosted:managed& publishedbyschema.orgproject
lYoucansubclassexistingclasses– Person/Engineer– Person/Engineer/ElectricalEngineer
lSubclassexistingproperties– musicGroupMember/leadVocalist– musicGroupMember/leadGuitar1– musicGroupMember/leadGuitar2
Hosted Extensions 11/17• auto.schema.org• bib.schema.org• health-lifesci.schema.org• iot.schema.org• meta.schema.org• pending.schema.org
![Page 24: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/24.jpg)
ExtensionProblems
lHardtoestablishagreeduponmeaning– Throughaxiomssupportedbythelanguage(e.g.,equivalence,disjointness,etc.)
– Noplacefordocumentation(annotations,labels,comments)
lWithoutanamespacemechanism,yourPerson/Engineerandminecanbeconfusedandmightmeandifferentthings– IsaComputerScientistanengineer?
![Page 25: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/25.jpg)
Serialization
lSchema.orghasadatamodel andserializations– Microdataistheoriginal,nativeserialization– RDFaismoreexpressiveandworkswiththeRDFstack– EveryoneagreesthatRDFaLiteisagoodencoding:assimpleasMicrodatabutmoreexpressive
– JSON-LDisanincreasinglypopularacceptedencoding
lSearchengineslookforMicrodata,RDFaandJSON-LD
lSchema.orgconsidersRDFatobethe“canonicalmachinerepresentationofschema.org”
![Page 26: Microdata and schema - csee.umbc.eduHTML5 lStarted by WHATWG as an alternative to XHTML, joined by W3C –HTML5recommendation,October 2014 –HTML5.1recommendation, November 2016 –WHATWG](https://reader034.vdocuments.mx/reader034/viewer/2022042303/5ece4f64265e064ba52744d4/html5/thumbnails/26.jpg)
lMicrodataisaneffortbyagroupofsearchcompaniestouseasimplesemanticlanguage
lThesemanticsispragmatic– e.g.,expectedtypes:astringisacceptedwhereathingisexpected– “somedataisbetterthannone”
lTherealvalueisin– thesupportedvocabulariesand– theirusebySearchcompanies
=> Immediatemotivationforusingsemanticmarkup
Conclusions