html - 您可以在 schema.org 标记中使用纯文本作为地址吗?

标签 html schema.org structured-data

我有一个 CMS,它有一个用于 Organization 的文本字段地址。数据存储非常不一致,在许多情况下,我只处理城市/州。我是 schema.org 的新手,想知道我是否可以简单地执行以下操作来处理标记:

<p itemprop="address">Some city, WY</p>

正如我所说,我对这一切都不熟悉,但我想我使用的是“微数据”格式。

最佳答案

是的,您可以使用文本作为 address 的值.虽然它的预期值是另一个项目(即 PostalAddress )而不是文本,但 Schema.org does not require this (大胆强调我的):

While we would like all the markup we get to follow the schema, in practice, we expect a lot of data that does not. We expect schema.org properties to be used with new types. We also expect that often, where we expect a property value of type Person, Place, Organization or some other subClassOf Thing, we will get a text string. In the spirit of "some data is better than none", we will accept this markup and do the best we can.

但是,如果您只指定城市和州,那么它是否真的是 Organization 的“物理地址”是值得怀疑的。

如果您使用 PostalAddress 项作为值,您可以准确指定您提供的地址部分,这样消费者就有更好的机会了解您的数据:

<p itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
  <span itemprop="addressLocality">Some city</span>, 
  <span itemprop="addressRegion">WY</span>
</p>

(术语:您正在使用语法或格式、微数据和词汇 Schema.org。)

关于html - 您可以在 schema.org 标记中使用纯文本作为地址吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28566018/

相关文章:

schema.org - 产品类别页面上的结构化数据?

网页中的 Php 提交按钮

html - 如何使用 bootstrap 将 3 个图像内联居中?

schema.org - 使用 cssSelector : "The property value is not recognized by Google for an object of type WebPageElement." 选择 mainContentOfPage 的 DOM

javascript - Schema JSON 代码及其对页面速度排名的影响

seo - Google 结构化数据和面包屑停止显示

html - 使嵌套列表显示为内联

java - HTML for Java 组件应该如何引用资源?

schema.org - 在网页的哪个位置放置多个 JSON-LD 对象?

html - 如何将 itemscope 拆分为多个 HTML 元素?