JSON-LD

JSON-LD 是一種簡單易用的 JSON 連結資料格式,可定義 context 的概念,指定型別和屬性的詞彙。Gmail 支援內嵌在 HTML 文件中的 JSON-LD 資料,如以下範例所示:@contextschema.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,並偵錯標記。