我有一个 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/