JSON-LD 是一種以 JSON 為基礎的連結資料格式,簡單易用,可定義 context
的概念,指定型別和屬性的詞彙。Gmail 支援內嵌在 HTML 文件中的 JSON-LD 資料,並使用 @context
標記 schema.org
,如下列範例所示:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Person",
"name": "John Doe",
"jobTitle": "Graduate research assistant",
"affiliation": "University of Dreams",
"additionalName": "Johnny",
"url": "http://www.example.com",
"address": {
"@type": "PostalAddress",
"streetAddress": "1234 Peach Drive",
"addressLocality": "Wonderland",
"addressRegion": "Georgia"
}
}
</script>
如要查看 JSON-LD 語法的完整規格和規定,請前往 json-ld.org。您也可以使用 Schema Validator 工具試用 JSON-LD,並偵錯標記。