Can I add custom properties to a given @type in JSON-LD?

拜拜、爱过 提交于 2019-12-04 06:44:16

问题


I'm developing a website that allows users to explore a massive discography. All the data is currently stored in a JSON file, which I'm converting to JSON-LD in order to make it semantic and crawlable by search engines.

Schema.org has a standard type for Music Albums, which doesn't have properties for some of the data I store (and present to users) for each album. These properties are marked as errors by Google's structured data validator. My question is: does Google just ignore the custom properties or will it penalize the site for using unsupported properties?


回答1:


You can use multiple vocabularies in JSON-LD (e.g., with compact IRIs in the @context).

If the vocabulary Schema.org has no suitable properties/types, there most likely already exists a (probably domain-specific) vocabulary that does have them. See this answer about how to find vocabularies.

If you can’t reuse existing vocabularies, you can create your own. See this answer about how to create your own RDF vocabulary.

What you should of course not do is "inventing" terms in the Schema.org namespace. If it’s not defined by Schema.org, no one knows what it should mean; and the same term could be defined in the future with a different meaning than you expected.

If you only provide the structured data for SEO reasons, note that the search engines Google/Bing/Yahoo/Yandex only support the vocabulary Schema.org (they are its sponsors), so using other or your own vocabularies is currently not relevant for SEO; but it’s of course a good idea for all the other benefits structured data can provide.



来源:https://stackoverflow.com/questions/38585416/can-i-add-custom-properties-to-a-given-type-in-json-ld

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!