+ All Categories
Home > Documents > Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme...

Microdata and schema - csee.umbc.edu · Basics l Microdata is a simple seman0c markup scheme...

Date post: 13-Jul-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
26
Microdata and schema.org
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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

l Microdataisaneffortbyagroupofsearchcompaniestouseasimpleseman0clanguage

l Theseman0csispragma0c–  e.g.,expectedtypes:astringisacceptedwhereathingisexpected–“somedataisbeJerthannone”

l Therealvalueisin–  thesupportedvocabulariesand–  theirusebySearchcompanies

l =>Immediatemo0va0onforusingseman0cmarkup

Conclusions


Recommended