Schema.org 在 HTML 中表示网站的信息模型开源项目

我要开发同款
匿名用户2020年02月05日
18阅读
开发技术HTML/CSS
所属分类其他开源
授权协议Apache-2.0

作品详情

Schema.org是一项社区协作活动,其使命是“创建、维护和促进Internet、网页、电子邮件消息等互联网应用的结构化数据的词汇表”,旨在帮助实现“语义网”的长期愿景。网站管理员使用此共享词汇表来构建其网站上的元数据,并帮助搜索引擎理解已发布的内容,这种技术称为搜索引擎优化。

Schema.org词汇表由Google,Microsoft,Yahoo 和Yandex共同创建,因此包括Google,Bing,Yahoo!和Yandex在内的搜索引擎都会依据这些标记来优化搜索结果,让人们更容易找到正确的网页。

Schema.org基于 RDF,有许多针对RDF的语法格式。后来开发者实现了在HTML中表示RDF,因此为了提供灵活性,Schema.org支持3种不同的表示选项:Microdata、RDFaLite和JSON-LD。

示例RDFa<mainvocab="https://schema.org/"typeof="Organization"><h1property="name">GeoBookClub</h1><divproperty="member"typeof="Person"resource="ang">Foundingmember<spanproperty="name">AliceNg</span>welcomesyou!</div><divproperty="event"typeof="Event"resource="GBC_mtg_2">Pleasejoinusforournextmeetingwhereweshalldiscussthenovel<spanproperty="about"typeof="Book"><uproperty="name">ThingsFallApart</u>by<aproperty="author"typeof="Person"href="https://enwp.org/Chinua_Achebe"><spanproperty="name">ChinuaAchebe</span></a>(ISBN:<spanproperty="isbn">9780393932195</span>)</span><imgproperty="image"src="TFA_cover.jpg"></div>Wehopeyou'vebeenabletoattendourpastmeetings<ul><liproperty="event"typeof="Event"resource="GBC_mtg_1">…</li></ul></main>Microdata<mainitemscopeitemtype="https://schema.org/Organization"><h1itemprop="name">GeoBookClub</h1><divitemscopeitemprop="member"itemtype="https://schema.org/Person"id="ang">Foundingmember<spanitemprop="name">AliceNg</span>welcomesyou!</div> <divitemprop="event"itemscopeitemtype="https://schema.org/Event"id="GBC_mtg_2">  Pleasejoinusforournextmeetingwhereweshalldiscussthenovel  <spanitemprop="about"itemscopeitemtype="https://schema.org/Book">    <uitemprop="name">ThingsFallApart</u>by    <aitemprop="author"itemscopeitemtype="https://schema.org/Person"href="https://enwp.org/Chinua_Achebe">      <spanitemprop="name">ChinuaAchebe</span>    </a>(ISBN:<spanitemprop="isbn">9780393932195</span>)  </span>  <imgitemprop="image"src="TFA_cover.jpg"></div> Wehopeyou'vebeenabletoattendourpastmeetings<ul>  <liitemprop="event"itemscopeitemtype="https://schema.org/Event"id="GBC_mtg_1">    …  </li></ul> </main>JSON-LD<scripttype="application/ld+json">{"@context":"https://schema.org","@type":"Organization","name":"GeoBookClub","member":[{"@type":"Person","@id":"ang","name":"AliceNg"}],"event":[{"@type":"Event","@id":"GBC_mtg_2","about":{"@type":"Book","name":"ThingsFallApart","isbn":"9780393932195","author":{"@id":"https://enwp.org/Chinua_Achebe","@type":"Person","name":"ChinuaAchebe"},"image":{"@id":"TFA_cover.jpg"}}},{"@type":"Event","@id":"GBC_mtg_1"}]}</script>
查看全文
声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论