In short. Use @graph with an array of node objects for a shared context, and add @id when the graph needs an explicit name.
Definition:
@graphgroups node objects in a JSON-LD document. With an@id, it expresses a named graph; in a top-level object containing@graphand an optional@context, it collects nodes in the default graph.
Key facts
- The W3C JSON-LD 1.1 specification says that
@graphgroups a set of nodes and can be paired with@idto name the graph. - The JSON-LD grammar permits the value of
@graphto be one node object or an array of zero or more node objects. - A top-level
@graphobject can give several nodes one shared context. - Properties of one node may be spread across node objects and merged when they carry the same identity.
- Schema.org says its vocabulary can be used with JSON-LD to add information to web content, alongside Microdata and RDFa.
What does @graph mean in a named graph?
The W3C specification uses a named graph for a linked data graph identified by an IRI or a blank node. In JSON-LD, a graph object contains @graph and can contain @id, @index, and @context. The @id value supplies the graph name, while the objects inside @graph describe nodes in that graph.
This structure can carry metadata about the graph itself. The specification's example gives the graph the identifier http://example.org/foaf-graph, adds a generatedAt property to that identifier, and places two Person node objects in @graph.
{
"@context": {
"@vocab": "http://xmlns.com/foaf/0.1/"
},
"@graph": [
{
"@id": "http://manu.sporny.org/about#manu",
"@type": "Person",
"name": "Manu Sporny"
}, {
"@id": "https://greggkellogg.net/foaf#me",
"@type": "Person",
"name": "Gregg Kellogg"
}
]
}
The full named-graph form adds an @id beside @graph. A graph object without @id is a simple graph object, which still has an implicitly allocated graph name in the data model.
How does one @graph wrapper share a context?
When the top-level map contains no keys other than @graph and an optional @context, the specification treats @graph as the otherwise implicit default graph. Its array collects the nodes, so the context appears once for the group. This form is useful when the nodes are unrelated and therefore do not form one embedded tree.
The same specification shows an alternative in which several node objects form a top-level array and each object repeats the context. The @graph wrapper removes that repetition. Each object in the array remains a separate node object, identified by its own @id when an identity is needed.
Are the objects in the array separate entities?
Yes. A node object represents properties of a node in the graph. The properties of a node may be distributed across different node objects in one document; processing merges their keys to form the resulting node. Reusing an @id therefore lets separate pieces describe the same node, while different @id values describe different nodes.
The W3C grammar permits @graph to contain a single node object or an array of node objects. The array is a grouping mechanism. JSON-LD arrays are unordered by default, so the position of an entity in the @graph array does not express an order. An ordered sequence uses a list object with @list.
The processing specification describes expansion as a normalization step: context definitions are removed, terms and compact IRIs become IRIs, and JSON-LD values are represented in arrays in expanded form. A processor can therefore read the same group through its expanded representation even when the compact document uses a single object for one value.
How does this relate to website structured data?
Schema.org describes its vocabulary as a collection of shared vocabularies for marking up web pages, and says that publishers use the vocabulary with JSON-LD, Microdata, or RDFa. A website can therefore put several identified Schema.org entities in one JSON-LD script and use @graph to give them a shared context. The entity types and properties still come from the chosen vocabulary, while @graph supplies the JSON-LD grouping structure.
Related terms
FAQ
Does @graph itself identify a graph?
@graph expresses the group of nodes. Add @id beside it when the graph needs an explicit name. Without @id, the graph object has an implicitly allocated graph name in the data model.
Can @graph contain one node?
Yes. The JSON-LD grammar allows a node object as the value and also allows an array of node objects. An array is useful when the group contains several entities.
Does array order define entity order?
No. JSON-LD arrays are unordered by default. Use @list when the data needs an ordered sequence.
Sources
- W3C, "JSON-LD 1.1", 16 July 2020
- W3C, "JSON-LD 1.1 Processing Algorithms and API", 16 July 2020
- Schema.org, "Getting started with schema.org using Microdata", 16 September 2026
Check how a page reads to answer engines. Open the GEO score analyzer