2017-03-02 24 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属性。

相关问题