当文章的作者和出版商是同一个人时,使用Microdata可以通过以下方式进行标记:
<span itemprop="author publisher" itemscope="" itemtype="http://schema.org/Organization">
<span itemprop="name">Name of the Organization</span>
</span>
使用JSON-LD时是否还有以下选项?
"author" : {
"@type" : "Organization",
"name" : "Name of the Organization"
},
"publisher" : {
"@type" : "Organization",
"name" : "Name of the Organization"
},
答案 0 :(得分:1)
JSON-LD中没有等效的功能。根据您是否具有实体的标识符,您可以利用反向属性来实现相同的功能。但是,一般来说,我不建议使用这种“黑客”。
{
"@context": [
"http://schema.org/",
{ "publisherOf": { "@reverse": "publisher", "@type": "@id" } }
],
"@id": "/book",
"author" : {
"@type" : "Organization",
"name" : "Name of the Organization",
"publisherOf": "/book"
}
}