2017-03-02 63 views
7

我目前正在致力於在/about-page-中添加Web應用程序的結構化數據。我想添加一個屬性。在下面的代碼中,我使用了namevalue(正如我在schema.org中看到的)。JSON-LD:是必需的值的名稱?

問:難道我只有value使用沒有name,並設置如Modularityvalue拖放說明?

<script type="application/ld+json"> 
{ 
"@context": "http://schema.org", 
"@type": "product", 
"name":"Product_name", 
"additionalProperty": 
    { 
    "@type":"propertyValue", 
    "name":"Main features", 
    "value": 
     [ 
      { 
      "@type":"propertyValue", 
      "name": "Detailed documentation", 
      "value": "description_of_the_documentation" 
      }, 
      { 
      "@type":"propertyValue", 
      "name": "Fully responsive", 
      "value": "description_of_the_responsiveness" 
      } 
     ], 

    "@type":"propertyValue", 
    "name":"Other features", 
    "value": 
     [ 
      { 
      "@type":"propertyValue", 
      "name": "Modularity", 
      "value": "description_of_the_modularity" 
      }, 
      { 
      "@type":"propertyValue", 
      "name": "Frequent updates", 
      "value": "description_of_the_updates" 
      } 
     ] 
    } 
} 
</script> 
+1

(1)請注意,Schema.org類型是區分大小寫的。所以你必須使用'PropertyValue'而不是'propertyValue'等。(2)你必須爲'additionalProperty'值使用一個數組。 – unor

+0

(1)它是,但如果你使用JSON-LD,你可能會留下第一個字母不是大寫字母。 –

+0

是什麼讓你覺得呢?如果使用「@type」:「propertyValue」,則術語URI是「http:// schema.org/propertyValue」,它與「http:// schema.org/PropertyValue」不同(後者是有效的Schema.org類型,前者不)。 – unor

回答

3

您可以使用爲value屬性Boolean值。

{ 
    "@type": "PropertyValue", 
    "name": "Modularity", 
    "value": true 
} 

如果要描述該功能,請另外使用description屬性。

相關問題