HTML with JSON-LD

Based on an HTML document, this encoding uses script tags with a type="application/ld+json" attribute for embedded data using the traditional JSON-LD encoding.

Example

<html>
  <script type="application/ld+json">
    {
      "@context": "https://schema.org/",
      "@type": "WebSite",
      "name": "Named Graph",
      "url": {
        "@id": "https://www.namedgraph.com/"
      }
    }
  </script>
</html>

Technical Notes

  • Reference: JSON-LD 1.1
  • Media Type: application/xhtml+xml (or text/html, text/xhtml)
  • File Name: *.html (or *.htm)