Skip to content
All articles

How to use @id in JSON-LD for entity identification

guide // , 6 min read, by Darthwares

The @id property in JSON-LD provides a unique identifier for an entity so search engines and consuming applications can link data points together. Setting @id to a stable URL allows you to reference the same entity across different structured data blocks on a page without re-declaring all its attributes. Schema.org syntaxes provide built-in representations for web URLs, making @id the primary mechanism for entity node linking. Using persistent identifiers ensures that search parsers can disambiguate your organization, products, and media assets correctly.

A diagram showing JSON-LD code blocks connecting organization, recipe, and video entity nodes together using matching @id URL references.
On this page // 6 sections
  1. 01What is @id in JSON-LD and how does it work?
  2. 02How search engines use @id to connect and disambiguate items
  3. 03What rules govern stable identifiers for entity markup?
  4. 04How do you inspect context definitions and terms?
  5. 05How to audit and fix entity linking issues in JSON-LD
  6. 06Common questions

The short version

  • The @id property serves as the built-in URL identifier for entity node objects in JSON-LD.
  • Omitted identifiers create blank nodes prefixed with _: that cannot be referenced from outside the local graph.
  • Search engines use @id references to link related items on a page, such as connecting a video to a recipe.
  • Domain rules for specific schema types like book actions require the domain in @id values to be owned by your organization.

What is @id in JSON-LD and how does it work?

Schema.org syntaxes provide built-in representations for URIs and URLs. In JSON-LD, this built-in representation is @id, whereas Microdata uses itemid and RDFa 1.1 uses resource. Schema.org documentation notes that it is generally preferable to use these built-in representations unless there is a specific requirement to state the exact kind of identifier or to provide additional or alternative identifiers like DOIs.

When a JSON-LD object does not include an explicit identifier, W3C specifications explain that it becomes a blank node. Parsers assign a blank node an identifier starting with the prefix _:. A blank node does not contain a de-referenceable identifier because it is either ephemeral in nature or does not contain information that needs to be linked to from outside of the linked data graph.

W3C documents also define an id map as a map value of a term defined with @container set to @id. In an id map, the values must be node objects, and its keys are interpreted as IRIs representing the @id of the associated node object. This mapping structure connects identifiers directly to node objects.

How search engines use @id to connect and disambiguate items

Google Search understands multiple items on a page, whether you nest the items or specify each item individually. If there are items that are more helpful when they are linked together, such as a recipe and a video, Google documents using @id in both the recipe and video items to specify that the video is about the recipe on the page.

Adding organization structured data to your home page can help Google better understand your organization's administrative details and disambiguate your organization in search results. Providing the website URL of your organization helps Google uniquely identify your organization. Some properties, like iso6523 and naics, are used behind the scenes to disambiguate your organization, while others influence visual elements in search results, such as which logo is shown and your knowledge panel.

Google documents that there are no required properties for organization schema; instead, Google recommends adding as many properties as are relevant to your organization. To make sure Google Search understands the main purpose of the page, include the main type of structured data that reflects the main focus of the page.

What rules govern stable identifiers for entity markup?

For book actions structured data, Google documents that an @id value must be a globally unique ID for the book that is stable over time and unique to your organization. Google notes that URL format is suggested though not required for book action IDs. When a URL format is used, the domain used for the @id value must be owned by your organization.

External signals work alongside identifiers when search engines process feeds. In book actions structured data, Google uses the ISBN as the main reconciliation signal when matching feed data to Google's data.

Entity roles must also be clear when managing structured data pages. Schema.org notes that whereas the sameAs property emphasizes well known pages, the mainEntityOfPage property serves more to clarify which of several entities is the main one for that page.

How do you inspect context definitions and terms?

Schema.org is typically deployed in JSON-LD 1.0, but the location of the context file is exposed via JSON-LD 1.1 conventions as an HTTP link header. Developers can inspect this context header using commandline tools like curl with the -I and -i arguments.

Machine-readable definitions of individual terms are available as JSON-LD, embedded into the term page HTML. Schema.org encourages consuming applications to accept both representations and generates downloads in both flavours as a convenience.

The schemaorg-all-https file contains the definition of all terms in all sections of the vocabulary, plus terms retired from the vocabulary in the attic section. For non-URL values, Schema.org states that the identifier property and its sub-properties are primarily useful in cases where content is expressed as a textual string.

How to audit and fix entity linking issues in JSON-LD

All structured data must follow general guidelines in order to be eligible for appearance as a rich result in Google Search. For navigation elements, Google Search uses breadcrumb markup in the body of a web page to categorize information in search results. A breadcrumb trail indicates position in the site hierarchy, requiring a BreadcrumbList containing at least two ListItems. If the last item in the trail omits an item property, Google uses the URL of the containing page.

  1. 01Check whether book action @id values use a stable ID and a domain owned by your organization.
  2. 02Connect related items on a page by adding identical @id values to both items, such as linking a video to a recipe.
  3. 03Verify that breadcrumb markup defines a BreadcrumbList containing at least two ListItems.
  4. 04Confirm whether omitting the item property on the final breadcrumb ListItem correctly relies on the URL of the containing page.
  5. 05Check structured data implementation against Google general guidelines to maintain rich result eligibility.
Common JSON-LD entity symptoms and fixes
SymptomDiagnostic checkResolution
Entities remain unlinked blank nodesCheck if entity node objects rely on implicit blank nodes prefixed with _:Add an explicit @id IRI key or map value to uniquely identify the node object
Video object is not linked to recipeCompare @id values across the video item and recipe itemUse matching @id values in both items to specify that the video is about the recipe
Breadcrumb trail triggers validation errorCount the number of ListItem elements inside the BreadcrumbListEnsure the BreadcrumbList contains at least two ListItems
Final breadcrumb item lacks target linkCheck if item property is missing on the last ListItemAllow Google to use the URL of the containing page automatically when item is omitted for the last item

Common questions

What is a blank node in JSON-LD?

A blank node is a node object without a de-referenceable identifier, prefixed with _: in JSON-LD. It is used when an entity is ephemeral in nature or does not contain information that needs to be linked from outside the graph.

When should you use the identifier property instead of @id?

Schema.org syntaxes have built-in representations for URIs and URLs, such as @id in JSON-LD. Use the identifier property or its sub-properties primarily when the identifier is expressed as a textual string or when stating specific alternative identifiers like DOIs.

How does @id help connect multiple items on a page?

Google Search understands multiple items whether nested or specified individually. Adding matching @id values to related items, such as a recipe and a video, specifies to search engines that the video is about the recipe on the page.

What rules apply to @id values for book actions?

For book actions structured data, Google requires a globally unique ID for the book that is stable over time. URL format is suggested though not required, and if a URL is used, the domain must be owned by your organization.

Primary sources and further reading

This article was researched and written by an AI model and published automatically. It was written from sentences that were checked to appear on the pages below, but a person has not reviewed the text. If something is wrong, tell us at chibivikramathithan@darthwares.com and we will correct it.