Skip to content
Novus Examples
json1.8 KB

JSON-LD @graph with @id cross-references

A single @graph holding four nodes wired together by @id rather than by nesting - the shape most CMS plugins emit - including a SearchAction, a breadcrumb whose last item has no URL, and one reference to a product node that lives on another page. For testing graph flattening and reference resolution.

Preview — first 50 linesjson
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "Organization",
      "@id": "https://www.example.com/#org",
      "name": "Example Outdoors",
      "url": "https://www.example.com/",
      "logo": {
        "@type": "ImageObject",
        "@id": "https://www.example.com/#logo",
        "url": "https://cdn.example.net/img/logo.png"
      }
    },
    {
      "@type": "WebSite",
      "@id": "https://www.example.com/#website",
      "url": "https://www.example.com/",
      "name": "Example Outdoors",
      "publisher": {
        "@id": "https://www.example.com/#org"
      },
      "potentialAction": {
        "@type": "SearchAction",
        "target": "https://www.example.com/search?q={search_term_string}",
        "query-input": "required name=search_term_string"
      }
    },
    {
      "@type": "WebPage",
      "@id": "https://www.example.com/catalog/boots#page",
      "url": "https://www.example.com/catalog/boots",
      "name": "Trail boots",
      "isPartOf": {
        "@id": "https://www.example.com/#website"
      },
      "about": {
        "@id": "https://www.example.com/catalog/boots#product"
      },
      "primaryImageOfPage": {
        "@id": "https://www.example.com/#logo"
      }
    },
    {
      "@type": "BreadcrumbList",
      "@id": "https://www.example.com/catalog/boots#crumbs",
      "itemListElement": [
        {
          "@type": "ListItem",
          "position": 1,
69 lines total — download for the full file.

Specifications

Seed
70400
Site
example.com (fictional)
Format
JSON-LD (schema.org)
Encoding
UTF-8
Graph Nodes
4
Cross References
4
Dangling References
1
Types
Organization, WebSite, WebPage, BreadcrumbList

Testing contract

Expected to pass
Scenario
Flatten the graph and resolve every @id reference.
Expected result
Four nodes are indexed by @id; publisher, isPartOf and primaryImageOfPage resolve to in-document nodes; the `about` reference to #product is reported as external or dangling rather than dropped, and the final breadcrumb item is valid despite having no item URL.

What is a .json file?

JSON (JavaScript Object Notation) is a lightweight, text-based data-interchange format representing objects, arrays, strings, numbers, booleans, and null. It is language-independent, human-readable, and the dominant format for web APIs and configuration. It requires a single well-formed root value.

How to use this file

Use an example JSON file to test parsers and serializers, schema validation, Unicode and number-precision handling, and API request or response processing.

How to use this file for testing

“JSON-LD @graph with @id cross-references” is a deterministic Novus Examples fixture for Web assets, JSON parsing, Schema validation, Metadata testing. Favicons, web app manifests, service workers, robots and sitemap files, Open Graph images, and .well-known resources — for testing web tooling, crawlers, PWA installers, and asset pipelines.

Documented properties for this file: seed 70400 · UTF-8 · JSON-LD (schema.org). Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Web-platform fixtures are standards-compliant samples against fictional example.com data. Test crawlers, PWA installers and manifest validators, favicon/icon pipelines, service-worker registration, or .well-known parsers against the documented structure.

Code examples

import json

with open("jsonld-graph.json") as f:
    data = json.load(f)
print(type(data), len(data))

Generated by generation/web_p7.py. Free for any use, no attribution required — license.