microdata and schema - csee.umbc.edu · basics l microdata is a simple seman0c markup scheme...
TRANSCRIPT
![Page 1: Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/1.jpg)
Microdataandschema.org
![Page 2: Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/2.jpg)
Basics
l Microdataisasimpleseman0cmarkupschemethat’sanalterna0vetoRDFa
l DevelopedbyWHATWG*andsupportedbymajorsearchcompanies(Google,MicrosoE,Yahoo,Yandex)
l LikeRDFa,itusesHTMLtagaJributestohostmetadata
l Vocabulariesarecontrolledandhostedatschema.org
* Web Hypertext Application Technology Working Group
![Page 3: Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/3.jpg)
WhatisWHATWG?
l WebHypertextApplica0onTechnologyWorkingGroup– CommunityinterestedinevolvingtheWebwithfocusonHTMLandWebAPIdevelopment
– IanHicksonisakeyperson,nowatGooglel Foundedin2004byindividualsfromApple,MozillaandOperaaEeraW3Cworkshop– ConcernaboutW3C'sembraceofXHTML
l WorkedonHTML5,developedMicrodataspec
![Page 4: Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/4.jpg)
HTML5
l StartedbyWHATWGasanalterna0vetoXHTML,joinedbyW3C– HTML5recommenda0on,October2014– HTML5.1recommenda0on,November2016– WHATWGwillevolveitasa“livingstandard”
l HTML5≈HTML+CSS+jsl Na0vesupportforgraphics,video,audio,speech,seman0cmarkup,…
l Currentsupportinmajorbrowsers
![Page 5: Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/5.jpg)
Microdata
l Themicrodataefforthastwoparts:– Amarkupscheme– Asetofvocabularies/ontologies
l ThemarkupissimilartoRDFainprovidingwaystoiden0fysubjects,types,proper0es&objectsAlsoastandardwaytoencodeMicrodataasRDFa
l Sanc0onedvocabulariesatschema.organdincludeasmallnumberofveryusefulones:people,movies,events,recipes,etc.
![Page 6: Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/6.jpg)
Anexample
<div><h1>Avatar</h1><span>Director:JamesCameron(born1954)</span><span>Sciencefic0on</span><ahref=”avatar-trailer.html">Trailer</a></div>
![Page 7: Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/7.jpg)
Anexample:itemscope
l AnitemscopeaJributeiden0fiesacontentsubtreethatisthesubjectaboutwhichwewanttosaysomething
<divitemscope><h1>Avatar</h1><span>Director:JamesCameron(born1954)</span><span>Sciencefic0on</span><ahref=”avatar-trailer.html">Trailer</a></div>
![Page 8: Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/8.jpg)
Anexample:itemtype
l AnitemscopeaJributeiden0fiesacontentsubtreethatisthesubjectaboutwhichwewanttosaysomething
l TheitemtypeaJributespecifiesthesubject’stype<divitemscopeitemtype="hAp://schema.org/Movie"><h1>Avatar</h1><span>Director:JamesCameron(born1954)</span><span>Sciencefic0on</span><ahref=”avatar-trailer.html">Trailer</a></div>
![Page 9: Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/9.jpg)
Microdata<->RDF
http://rdf-translator.appspot.com/
![Page 10: Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/10.jpg)
Microdata<->RDF
http://rdf-translator.appspot.com/
![Page 11: Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/11.jpg)
Anexample:itemtype
l AnitemscopeaJributeiden0fiescontentsubtreethatisthesubjectaboutwhichwewanttosaysomething
l TheitemtypeaJributespecifiesthesubject’stype<divitemscopeitemtype="hAp://schema.org/Movie"><h1>Avatar</h1><span>Director:JamesCameron(born1954)</span><span>Sciencefic0on</span><ahref=”avatar-trailer.html">Trailer</a></div>
[ ] a schema:Movie .
![Page 12: Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/12.jpg)
Anexample:itemprop
l AnitemscopeaJributeiden0fiesacontentsubtreethatisthesubjectaboutwhichwewanttosaysomething
l TheitemtypeaJributespecifiesthesubject’stypel AnitempropaJributegivesapropertyofthattype<divitemscopeitemtype="hAp://schema.org/Movie"><h1itemprop="name">Avatar</h1><span>Director:JamesCameron(born1954)</span><spanitemprop="genre">Sciencefic0on</span><ahref=”avatar-trailer.html”itemprop="trailer">Trailer</a></div>
![Page 13: Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/13.jpg)
Anexample:itemprop
l AnitemscopeaJributeiden0fiesacontentsubtreethatisthesubjectaboutwhichwewanttosaysomething
l TheitemtypeaJributespecifiesthesubject’stypel AnitempropaJributegivesapropertyofthattype<divitemscopeitemtype="hAp://schema.org/Movie"><h1itemprop="name">Avatar</h1><span>Director:JamesCameron(born1954)</span><spanitemprop="genre">Sciencefic0on</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.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/14.jpg)
Anexample:embeddeditems
l Anitempropimmediatelyfollowedbyanotheritemcopemakesthevalueanobject
<divitemscopeitemtype="hJp://schema.org/Movie"><h1itemprop="name">Avatar</h1><divitemprop="director"itemscopeitemtype="hAp://schema.org/Person">Director:<spanitemprop="name">JamesCameron</span>(born<spanitemprop="birthDate">1954</span>)</div><spanitemprop="genre">Sciencefic0on</span><ahref="avatar-trailer.html"itemprop="trailer">Trailer</a></div>
![Page 15: Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/15.jpg)
Anexample:embeddeditems
l Anitempropimmediatelyfollowedbyanotheritemcopemakesthevalueanobject
<divitemscopeitemtype="hJp://schema.org/Movie"><h1itemprop="name">Avatar</h1><divitemprop="director"itemscopeitemtype="hAp://schema.org/Person">Director:<spanitemprop="name">JamesCameron</span>(born<spanitemprop="birthDate">1954</span>)</div><spanitemprop="genre">Sciencefic0on</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.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/16.jpg)
schema.orgvocabulary
l Fulltypehierarchyinonefilel 590classes,>700proper0es(Nov‘16)l Datatypes:Boolean,Date,DateTime,Number,Text,Time
l Objects:RootedatThingwithtwo‘metaclasses’(ClassandProperty)andeightsubclasses
l Seegithubrepoforexamplesandcode
![Page 17: Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/17.jpg)
hAp://www.schema.org/Recipe
![Page 18: Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/18.jpg)
TesPngStructuredDatainHTML
![Page 19: Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/19.jpg)
TesPngStructuredDatainHTML
![Page 20: Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/20.jpg)
TesPngStructuredDatainHTML
![Page 21: Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/21.jpg)
MicrodataasaKRlanguage
l MorethanRDF,lessthanRDFSl Proper0eshaveanexpectedtype(range)
– Canbealistoftypes,anyofwhichareOK– Mightbeastringformanyproper0es(“somedatabe2erthannone”)
l Proper0esaJached≥1types(domain)l Classescanhavemul0pleparentsandinherit(proper0es)fromallofthem
l Noaxioms(e.g.,disjointness,cardinality,etc.)l NosubPropertyOflikerela0on
![Page 22: Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/22.jpg)
Mixingvocabularies
l Microdataisintendedtoworkwithjustonevocabulary:theoneatschema.org
l Advantages– Simple,organized,welldesigned– Controlledbytheschema.orgpeople
l Disadvantages:toosimple,controlled– Toosimple,narrow,mono-lingual– Controlledbytheschema.orgpeople
![Page 23: Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/23.jpg)
Extendingschema.orgontology
l Extensions:hostedvs.external– Hosted:managed&publishedbyschema.orgproject
l Youcansubclassexis0ngclasses– Person/Engineer– Person/Engineer/ElectricalEngineer
l Subclassexisi0ngproper0es– musicGroupMember/leadVocalist– musicGroupMember/leadGuitar1– musicGroupMember/leadGuitar2
![Page 24: Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/24.jpg)
ExtensionProblems
l Hardtoestablishagreeduponmeaning– Throughaxiomssupportedbythelanguage(e.g.,equivalence,disjointness,etc.)
– Noplacefordocumenta0on(annota0ons,labels,comments)
l Withoutanamespacemechanism,yourPerson/Engineerandminecanbeconfusedandmightmeandifferentthings
![Page 25: Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/25.jpg)
SerializaPon
l Schema.orghasadatamodelandserializa0ons– Microdataistheoriginal,na0vesteriliza0on– RDFaismoreexpressiveandworkswiththeRDFstack– EveryoneagreesthatRDFaLiteisagoodencoding:assimpleasMicrodatabutmoreexpressive
– JSON-LDisanincreasinglypopularacceptedencoding
l SearchengineslookforMicrodata,RDFaandJSON-LD
l Schema.orgconsidersRDFatobethe“canonicalmachinerepresenta0onofschema.org”
![Page 26: Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme that’s an alternave to RDFa l Developed by WHATWG* and supported by major search companies](https://reader034.vdocuments.net/reader034/viewer/2022042911/5f4444757052a7604b3c3271/html5/thumbnails/26.jpg)
l Microdataisaneffortbyagroupofsearchcompaniestouseasimpleseman0clanguage
l Theseman0csispragma0c– e.g.,expectedtypes:astringisacceptedwhereathingisexpected–“somedataisbeJerthannone”
l Therealvalueisin– thesupportedvocabulariesand– theirusebySearchcompanies
l =>Immediatemo0va0onforusingseman0cmarkup
Conclusions