Inferensys

Glossary

Graph

A top-level JSON-LD construct used to encapsulate multiple, interconnected top-level nodes and their relationships within a single structured data block.
Developer demonstrating multi-agent tool use, agent tool selection interface on laptop, casual tech demo moment.
STRUCTURED DATA

What is Graph?

A top-level JSON-LD construct used to encapsulate multiple, interconnected top-level nodes and their relationships within a single structured data block.

In the context of Schema.org and JSON-LD, a @graph is a top-level array that acts as a container for multiple, independent top-level entities within a single structured data block. This construct allows developers to define several distinct nodes—such as an Organization, a WebSite, and a Person—and explicitly map their interrelationships using properties like @id and author without requiring separate script tags for each entity.

The @graph keyword is critical for entity linking and knowledge graph injection, as it enables the co-location of related entities in one payload, reducing ambiguity for AI parsers. By grouping a Thing and its related attributes under a single @graph array, search engines and generative models can more efficiently disambiguate the primary mainEntity of a page while simultaneously ingesting the full context of its associated nodes.

JSON-LD GRAPH ARCHITECTURE

Key Features of the @graph Construct

The @graph keyword is a top-level JSON-LD construct that enables the encapsulation of multiple, interconnected top-level nodes within a single structured data block, eliminating redundancy and defining explicit relationships.

01

Multi-Node Consolidation

The primary function of @graph is to house an array of multiple top-level entities—such as an Organization, a WebSite, and a Person—within a single <script> block. Without @graph, each entity would require its own separate JSON-LD block, leading to code duplication and fragmented data. This consolidation allows a single document to fully describe a complex entity ecosystem, such as a corporation with multiple brands and their respective CEOs, all linked through shared identifiers.

02

Explicit Relationship Definition

@graph facilitates explicit linking between nodes using the @id keyword. By assigning a unique Internationalized Resource Identifier (IRI) to each node, other nodes can reference it directly via properties like founder, publisher, or subjectOf. This transforms a flat list of entities into a connected, machine-readable knowledge graph. For example, a NewsArticle node can explicitly point to its author, which is a Person node defined in the same @graph array, using the author's @id.

03

Contextual Scoping and Reuse

The @graph construct works in tandem with the @context keyword to define shared vocabularies. A single @context at the top of the block applies to all nodes within the @graph array, ensuring consistent term mapping and reducing verbosity. This scoping allows for the reuse of common properties and type definitions across multiple entities without re-declaring them, making the structured data block more compact and efficient for parsers to process.

04

Named Graph Support

Beyond a simple array, @graph can be combined with an @id at the top level to create a named graph. This practice assigns a unique IRI to the entire set of statements, effectively making a statement about the graph itself. This is crucial for provenance tracking, allowing a publisher to assert metadata—such as dateCreated, creator, or license—about the entire structured data payload, not just the individual entities within it.

05

Top-Level Node Disambiguation

When multiple entities are present, search engines need to identify the primary subject of the page. The @graph construct is often used with the mainEntity property on a parent WebPage node. By placing the WebPage node inside the @graph and using its mainEntity property to point to the @id of the primary Article or Product node, the data block explicitly disambiguates the page's central topic from secondary entities like the site's Organization or navigation elements.

06

Schema.org Sitelinks Search Box

A canonical use case for @graph is implementing the Sitelinks Search Box rich result. This requires defining a WebSite node with a potentialAction of type SearchAction and a urlTemplate. By placing this WebSite node inside an @graph alongside the Organization node that owns it, a single JSON-LD block can simultaneously establish the brand entity and enable the powerful site-search feature directly in search engine results pages.

GRAPH STRUCTURED DATA

Frequently Asked Questions

Clear, technically precise answers to the most common questions about implementing the Schema.org Graph construct for enterprise JSON-LD deployments.

A Graph is a top-level JSON-LD construct that encapsulates multiple, interconnected top-level nodes and their relationships within a single structured data block. Instead of defining isolated, disconnected @type entities, a Graph wraps them in an array under the @graph keyword. This allows you to define an Organization, a WebSite, a WebPage, and a BreadcrumbList in one cohesive script. The mechanism relies on the @id property to establish internal links between nodes. For example, a WebPage node can reference its publisher by pointing its publisher property to the @id of the Organization node defined elsewhere in the same graph. This creates a machine-readable knowledge graph that explicitly defines the relationships between all entities on a page, providing search engines with a complete, unambiguous semantic model of your content rather than fragmented data points.

JSON-LD STRUCTURAL COMPARISON

Graph vs. Node vs. Document

Distinguishing the three fundamental structural levels within a JSON-LD structured data block, from the top-level container to the individual entity definitions.

FeatureGraphNodeDocument

Structural Role

Top-level container that encapsulates all entities

A discrete entity instance with a unique @type

The complete JSON-LD payload or script block

JSON-LD Keyword

@graph

@type

@context

Cardinality

Exactly one per structured data block

Multiple per @graph array

One per script tag or application/ld+json response

Defines Entity Identity

Contains Relationship Data

Directly Indexed by Search Engines

Example Syntax

"@graph": [ ... ]

"@type": "Organization"

<script type="application/ld+json">

Primary Function

Bundles disparate entities into a single, coherent context

Describes a single Thing with its properties

Serializes the entire structured data payload for transmission

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.