如果“publisher”和“author”属性具有相同的值,该怎么办?

问题描述 投票:0回答:1

我正在将结构化数据实施到我的网站中。当我考虑Schema.org的Article时,publisherauthor是相同的Organization

在两个属性中复制它是一个好习惯吗?我正在使用JSON-LD来实现它。

schema.org json-ld
1个回答
3
投票

在JSON-LD中(与Microdata和RDFa相比),除了复制它之外别无选择。

但是,您不一定要在两个地方都提供完整的Organization项目。使用Organization@id提供URI,然后在其他位置引用此URI:

"author": {
  "@type": "Organization",
  "@id": "/#org",
  "url": "/",
  "name": "Nosek Inc.",
  "description": "Great organization"
},
"publisher": {"@id": "/#org"}

提供/复制至少一些属性通常是有意义的,例如,像@typenameurl等重要的属性:

"publisher": {
  "@type": "Organization",
  "@id": "/#org",
  "name": "Nosek Inc."
}
© www.soinside.com 2019 - 2024. All rights reserved.