2015-06-02 37 views
2

當文章的作者和出版者是同一個,用微有可能通過以下方式來標記:兩個屬性,一個類型

<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" 
}, 

回答

1

JSON-LD中沒有相應的功能。根據您的實體是否有標識符,您可能可以利用反向屬性來實現相同的目標。然而,一般來說,我不會建議使用這種「黑客」。

{ 
    "@context": [ 
    "http://schema.org/", 
    { "publisherOf": { "@reverse": "publisher", "@type": "@id" } } 
    ], 
    "@id": "/book", 
    "author" : { 
    "@type" : "Organization", 
    "name" : "Name of the Organization", 
    "publisherOf": "/book" 
    } 
} 
+0

我想也許這可能是這種情況。非常感謝您花時間回覆Markus,感謝您的幫助。 –

相關問題