Report类型Schema的JSON-LD正确语法及示例代码正确性确认
结论
你的核心判断完全正确,Report确实是Schema.org中Article类型的子类,headline、description、author、publisher等Article的通用属性在Report下可正常使用,你新增的reportNumber也属于Report类型的合法专属属性,给出的JSON-LD语法整体没有原则性错误。
可优化的细节
如果要让标记的兼容性更好,可以做两处小调整:
- 所有资源链接使用完整的绝对路径,不要用相对路径或者省略协议的写法,比如
img.jpg、example.com、logo.svg都建议补充为带https协议的完整URL,避免搜索引擎解析时出现歧义。 - 可根据报告实际类型补充
reportType可选属性,比如"reportType": "SurveyReport",能让结构化数据的语义更精准。
参考代码示例
调整后的代码参考如下:
<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "Report", "reportNumber": "1234", "reportType": "SurveyReport", "headline": "Report Headline", "description": "Report Description", "image": "https://example.com/img.jpg", "author": { "@type": "Organization", "name": "Org. Name", "url": "https://example.com" }, "publisher": { "@type": "Organization", "name": "Org. Name", "logo": { "@type": "ImageObject", "url": "https://example.com/logo.svg" } }, "datePublished": "2021-11-24", "dateModified": "2021-11-24" } </script>
验证建议
你可以直接用Schema官方的结构化数据测试工具导入你的代码片段,即可直接检查是否存在语法错误。
内容的提问来源于stack exchange,提问作者Mentalist
相关产品推荐
相关产品推荐

