Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
Microdataandschema.org
Basics
lMicrodata isasimplesemanticmarkupschemethat’sanalternativetoRDFa
lDevelopedbyWHATWG* andsupportedbymajorsearchcompanies(Google,Microsoft,Yahoo,Yandex)
l LikeRDFa,itusesHTMLtagattributestohostmetadata
lVocabulariesarecontrolledandhostedatschema.org
* Web Hypertext Application Technology Working Group
WhatisWHATWG?
lWebHypertextApplicationTechnologyWorkingGroup– CommunityinterestedinevolvingtheWebwithfocusonHTMLandWebAPIdevelopment
– IanHickson isakeyperson,nowatGoogle
lFoundedin2004byindividualsfromApple,MozillaandOperaafteraW3Cworkshop– ConcernaboutW3C'sembraceofXHTML
lWorkedonHTML5,developedMicrodata spec
HTML5
lStartedbyWHATWGasanalternativetoXHTML,joinedbyW3C– HTML5 recommendation, October2014– HTML5.1 recommendation,November2016– WHATWGwillevolveitasa“livingstandard”
lHTML5≈HTML+CSS+jslNativesupportforgraphics,video,audio,speech,semanticmarkup,…
lCurrentsupportinmajorbrowsers
Microdata
lThemicrodata efforthastwoparts:– Amarkupscheme– A setofvocabularies/ontologies
lThemarkupissimilartoRDFainprovidingwaystoidentifysubjects,types,properties&objectsAlsoastandardwaytoencodeMicrodataasRDFa
lSanctionedvocabulariesatschema.org andincludeasmallnumberofveryusefulones:people,movies,events,recipes,etc.
Anexample
<div><h1>Avatar</h1><span>Director:JamesCameron(born1954)</span><span>Sciencefiction</span><ahref=”avatar-trailer.html">Trailer</a></div>
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>
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>
Microdata<->RDF
http://rdf-translator.appspot.com/
Microdata<->RDF
http://rdf-translator.appspot.com/
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 .
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>
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> .
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>
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> .
schema.org vocabulary
lFulltypehierarchyinonefilel619classes,876properties(Nov‘17)lDatatypes:Boolean,Date,DateTime,Number,Text,Time
lObjects:RootedatThingwithtwo‘metaclasses’(ClassandProperty)andeightsubclasses
lSeegithubrepo forexamplesandcode
http://www.schema.org/Recipe
TestingStructuredDatainHTML
TestingStructuredDatainHTML
TestingStructuredDatainHTML
MicrodataasaKRlanguage
lMorethanRDF,lessthanRDFSlPropertieshaveanexpected type(range)
– Canbealistoftypes,any ofwhichareOK– Mightbeastringformanyproperties(“somedatabetterthannone”)
lPropertiesattached≥1types(domain)lClassescanhavemultipleparentsandinherit(properties)fromallofthem
lNoaxioms(e.g.,disjointness,cardinality,etc.)lNorelationlikesubPropertyOf
Mixingvocabularies
lMicrodataisintendedtoworkwithjustonevocabulary:theoneatschema.org
lAdvantages:simpleandcontrolled– Simple,organized,welldesigned– Controlledbytheschema.org people
lDisadvantages:toosimple,toocontrolled– Toosimple,narrow,mono-lingual– Controlledbytheschema.orgpeople
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
ExtensionProblems
lHardtoestablishagreeduponmeaning– Throughaxiomssupportedbythelanguage(e.g.,equivalence,disjointness,etc.)
– Noplacefordocumentation(annotations,labels,comments)
lWithoutanamespacemechanism,yourPerson/Engineerandminecanbeconfusedandmightmeandifferentthings– IsaComputerScientistanengineer?
Serialization
lSchema.orghasadatamodel andserializations– Microdataistheoriginal,nativeserialization– RDFaismoreexpressiveandworkswiththeRDFstack– EveryoneagreesthatRDFaLiteisagoodencoding:assimpleasMicrodatabutmoreexpressive
– JSON-LDisanincreasinglypopularacceptedencoding
lSearchengineslookforMicrodata,RDFaandJSON-LD
lSchema.orgconsidersRDFatobethe“canonicalmachinerepresentationofschema.org”
lMicrodataisaneffortbyagroupofsearchcompaniestouseasimplesemanticlanguage
lThesemanticsispragmatic– e.g.,expectedtypes:astringisacceptedwhereathingisexpected– “somedataisbetterthannone”
lTherealvalueisin– thesupportedvocabulariesand– theirusebySearchcompanies
=> Immediatemotivationforusingsemanticmarkup
Conclusions