Nesting schema Markup (@id và @graph)
Đó deep-dive on connecting JSON-LD entities với @id và @graph — ổn định identifiers, đó hai canonical node patterns (WebSite→Bài viết→Tác giả, Sản phẩm→Offer→Organization), đó three mistakes đó break đó graph, và đó honest limits of điều gì Google tài liệu xác nhận.
Ngôn ngữ
Nesting connects của bạn JSON-LD entities thay vì dumping them as disconnected chặn. @id là một ổn định, unique URI (thường một canonical URL plus một #fragment) đó names an entity so other entities có thể reference điều này — an Bài viết tác giả pointing tại một Person node, một Sản phẩm Offer pointing tại an Organization/seller — thay vì re-declaring đó đầy đủ entity mọi nơi. @graph là một từ khóa đó bundles những connected entities vào một script block. Google tài liệu xác nhận cả hai nesting và riêng lẻ items hoạt động, và đó @id là cách bạn tell Google hai items là linked, nhưng they không bao giờ xác nhận liệu @id resolves trên các trang — so đó safe default là consistent @id các giá trị plus đó hoàn tất entity graph on mỗi trang đó cần điều này. Hai patterns để learn: WebSite → WebPage → Bài viết → Tác giả cho xuất bản, Sản phẩm → Offer → Organization cho ecommerce. Three ways điều này breaks hoặc costs bạn: inconsistent/non-unique @id các giá trị, orphaned references (an @id cited nhưng không bao giờ declared — một semantic khoảng trống, không hợp lệ JSON-LD), và duplicating một đầy đủ entity declaration mọi nơi thay vì referencing điều này (một maintenance trap; giống nhau-entity repeats hợp nhất thay vì theo nghĩa đen break, nhưng một genuinely conflicting reused @id là một real break). đây là an entity-understanding tool, không một xếp hạng hoặc rich-kết quả lever by itself.
Evidence for this claim JSON-LD supports connected nodes via nesting or @id references, allowing multiple related entities to form one graph. Scope: JSON-LD graph model. Confidence: high · Verified: W3C JSON-LD 1.1 Evidence for this claim Google requires structured data to represent visible page content and follow each feature's specific nesting and property guidelines; extra valid nodes do not create eligibility by themselves. Scope: Current Google structured-data general guidelines. Confidence: high · Verified: Google Search Central: Structured data general guidelinesTóm tắt — Nesting là Cách bạn connect của bạn schema markup thay vì leaving nó as pile của disconnected chặn.
@idlà unique name (thường của bạn trang URL plus#tag) bạn cho entity — của bạn organization, tác giả — so khác entities có thể point tại nó thay vì repeating all của nó details.@graphlets bạn put several connected entities trong một code block. payoff: declare của bạn organization sau khi, reference nó mọi nơi, và không sao chép và dán giống nhau block onto mỗi trang.
vấn đề nesting solves
Chẳng hạn của bạn trang web có Organization — name, logo, links để của bạn social
profiles. và mỗi blog post có Article với tác giả và publisher.
không có nesting, bạn end lên writing out của bạn đầy đủ organization details — name,
logo, mỗi social link — bên trong mỗi single post markup. Thay đổi của bạn logo,
và hiện tại bạn có để cập nhật nó trong forty places.
Nesting các cách sửa đó. bạn declare organization sau khi, cho nó ổn định name, và mọi nơi khác bạn chỉ reference đó name. điều này assumes bạn đã know Điều gì schema markup và JSON-LD là — nếu bạn không, bắt đầu với dữ liệu có cấu trúc hub đầu tiên, sau đó come lại ở đây.
@id — name bạn cho entity
@id là chỉ unique identifier cho một entity. convention là để sử dụng của bạn
thực trang URL plus fragment, như điều này:
{
"@type": "Organization",
"@id": "https://example.com/#organization",
"name": "Example Co",
"logo": "https://example.com/logo.png"
}Đó "@id": "https://example.com/#organization" là hiện tại đó entity name.
Anywhere khác bạn cần để chẳng hạn “the publisher is Example Co,” (bản dịch) «đó publisher là Ví dụ Co,» bạn không rewrite all
of đó — bạn chỉ point tại đó name:
{
"@type": "Article",
"publisher": { "@id": "https://example.com/#organization" }
}Một nhỏ nhưng quan trọng điều: @id là liên kết nội bộ mechanism, không trang
bạn’re xuất bản. nó không có để là thực, fetchable URL — sử dụng fragment
on của bạn own domain là tiêu chuẩn, và đó chính xác fragment không cần để load as
trang. (đó khác từ url thuộc tính, mà làm mô tả thực
trang.)
@graph — putting connected entities together
@graph lets bạn list several entities trong một code block thay vì scattering
them trên nhiều. thay vì three tách biệt <script> chặn, bạn ghi một:
{
"@context": "https://schema.org",
"@graph": [
{ "@type": "Organization", "@id": "https://example.com/#organization", "name": "Example Co" },
{ "@type": "WebSite", "@id": "https://example.com/#website", "publisher": { "@id": "https://example.com/#organization" } }
]
}bạn ghi @context sau khi tại top, và entities bên trong reference mỗi khác
by @id. nó tidier và easier để maintain sau khi bạn có một vài connected pieces.
điều để nhận right
Hai rules cover phần lớn của nó:
- là consistent. sử dụng giống nhau
@idstring cho giống nhau entity mọi nơi. nếu của bạn organization là#organizationon một trang và#orgon một, tìm kiếm engines có thể’t tell họ’re giống nhau điều. - không point tại không có gì. nếu
Article’s tác giả references{"@id": "#author-jane"}, hãy đảm bảo#author-janelà thực ra declared nơi nào đó với@typevà details. reference để entity bạn không bao giờ được định nghĩa chỉ fails silently.
và giữ của bạn expectations honest: nesting well helps các công cụ tìm kiếm understand của bạn entities và tránh duplicated dữ liệu — nó không, by itself, làm bạn xếp hạng cao hơn hoặc unlock rich kết quả.
Muốn đầy đủ Cách-để — hai tiêu chuẩn patterns với sao chép và dán các ví dụ, three mistakes đó break graph, và Điều gì tài liệu củ Google thực ra xác nhận (và leave silent)? Chuyển để Nâng cao tab.
Audit JSON-LD graph không có inventing entities
Audit the JSON-LD below as a graph.
1. Inventory every declared node: @id, @type, and where it is declared.
2. Inventory every @id reference made by another node.
3. Flag exact orphan references, duplicate full declarations, case/fragment drift,
unstable-looking IDs, and relationships that point at the wrong entity type.
4. Distinguish a reference-only object ({"@id":"..."}) from a full declaration.
5. Do not assume an @id resolves across pages and do not invent missing facts.
6. Return (a) a findings table, (b) a minimal corrected graph using the existing
facts only, and (c) questions for facts that cannot be verified from the input.
JSON-LD:
[PASTE SCRIPT CONTENT]cho template so sánh, cung cấp hai được kết xuất graphs và ask model để list
IDs đó thay đổi unexpectedly giữa them. Ổn định entities chẳng hạn như publisher
nên retain giống nhau case-sensitive @id; trang-cụ thể entities nên vẫn
unique để của họ canonical trang.
tìm orphaned và duplicate IDs trong được kết xuất JSON-LD
Chạy điều này trong DevTools Console. nó parses mỗi JSON-LD block, walks arrays và
@graph, và separates đầy đủ declarations từ reference-chỉ @id objects.
const documents = [...document.querySelectorAll('script[type="application/ld+json"]')]
.flatMap((script, scriptIndex) => {
try {
return [{ scriptIndex, value: JSON.parse(script.textContent) }];
} catch (error) {
console.warn(`Invalid JSON-LD in script ${scriptIndex + 1}`, error);
return [];
}
});
const declarations = new Map();
const references = [];
function walk(value, path, scriptIndex) {
if (Array.isArray(value)) {
value.forEach((item, i) => walk(item, `${path}[${i}]`, scriptIndex));
return;
}
if (!value || typeof value !== 'object') return;
if (typeof value['@id'] === 'string') {
const keys = Object.keys(value).filter((key) => key !== '@id');
if (keys.length) {
const rows = declarations.get(value['@id']) ?? [];
rows.push({ script: scriptIndex + 1, path, keys: keys.join(', ') });
declarations.set(value['@id'], rows);
} else {
references.push({ id: value['@id'], script: scriptIndex + 1, path });
}
}
Object.entries(value).forEach(([key, child]) =>
walk(child, `${path}.${key}`, scriptIndex));
}
documents.forEach(({ value, scriptIndex }) => walk(value, '$', scriptIndex));
console.table(references.filter(({ id }) => !declarations.has(id)));
console.table([...declarations.entries()]
.filter(([, rows]) => rows.length > 1)
.map(([id, rows]) => ({ id, declarations: rows.length, locations: rows })));rỗng orphan bảng là hữu ích, nhưng nó không prove graph là semantically đúng. Review case-sensitive IDs, entity types, canonical các URL, và liệu hoàn tất graph needed by điều này trang là thực ra present.
Evidence for this claim JSON-LD supports connected nodes via nesting or @id references, allowing multiple related entities to form one graph. Scope: JSON-LD graph model. Confidence: high · Verified: W3C JSON-LD 1.1 Evidence for this claim Google requires structured data to represent visible page content and follow each feature's specific nesting and property guidelines; extra valid nodes do not create eligibility by themselves. Scope: Current Google structured-data general guidelines. Confidence: high · Verified: Google Search Central: Structured data general guidelinesTóm tắt — Nesting connects JSON-LD entities qua
@id( ổn định, unique URI — thường canonical URL plus#fragment) so bạn reference entity thay vì re-declaring nó, và@graph( từ khóa bundling connected entities vào một script block). tài liệu củ Google xác nhận cả hai nesting và riêng lẻ items hoạt động, và đó bạn sử dụng@idđể link related items — nhưng họ không bao giờ xác nhận liệu@idresolves trên các trang, so safe default là consistent@idcác giá trị plus hoàn tất entity graph on mỗi trang đó cần nó. Learn hai patterns:WebSite → WebPage → Article → Author(xuất bản) vàProduct → Offer → Organization/seller(ecommerce). Three thất bại modes để watch cho: inconsistent/non-unique@idcác giá trị, orphaned references (@idcited nhưng không bao giờ declared — semantically incomplete, không hợp lệ JSON-LD), và duplicate đầy đủ declarations của giống nhau entity ( maintenance trap; giống nhau-entity repeats hợp nhất dưới JSON-LD’s node rules, nhưng reusing một@idcho genuinely khác entities là thực conflict). nó entity-understanding tool — disambiguation và de-duplication — không xếp hạng hoặc rich-kết quả lever by itself.
Phạm vi: Đây là deep-dive, không intro
điều này bài viết assumes bạn đã know Điều gì JSON-LD là và Vì sao nó được khuyến nghị
format — schema markup
trang covers đó, và nó introduces @id/@graph tại glance. điều này trang là
deferred deep-dive: thực tế mechanics, tiêu chuẩn node patterns, và
cụ thể mistakes đó âm thầm break graph. nếu bạn muốn format basics hoặc
nơi để place <script> block, JSON-LD
là sibling cho đó.
@id — ổn định identifier, không fetchable URL
@id assigns unique URI để JSON-LD entity so khác entities có thể point tại nó by
reference. convention — consistent trên mỗi credible nguồn I’ve checked —
là absolute canonical URL plus descriptive fragment:
"@id": "https://example.com/#organization"
"@id": "https://example.com/#website"
"@id": "https://example.com/team/jane-doe/#person"Hai điều mọi người nhận sai ở đây:
- Điều này không có để resolve. Theo đó JSON-LD spec,
@id’s job là node identification — một unique, ổn định “name” cho an entity — không fetchability. Dùng một fragment on của bạn own domain là tiêu chuẩn practice và không require đó fragment URL để independently load as một trang. Sitebulb node-identifiers hướng dẫn frames điều này well: một node identifier là “a unique ‘name’ for an entity, which is publicly accessible and can be looked up or linked to.” (bản dịch) «một unique ‘name’ cho an entity, mà là publicly accessible và có thể là looked lên hoặc linked để.» @idkhông phảiurl. họ là khác nhau properties đang làm khác nhau jobs.@ididentifies đó node trong đó graph;urlmô tả một real, fetchable trang về đó entity. AnOrganizationcó thể (và thường nên) có cả hai — an@idofhttps://example.com/#organizationvà mộturlofhttps://example.com/.
và @id các giá trị là case-sensitive — #Organization và #organization là
hai khác entities. Pick convention và không bao giờ drift từ nó.
@graph — bundling connected entities vào một block
@graph là JSON-LD từ khóa đó lets bạn put multiple top-cấp độ entities vào một
array bên trong single <script type="application/ld+json"> block, với entities
cross-referencing mỗi khác by @id:
{
"@context": "https://schema.org",
"@graph": [
{ "@type": "Organization", "@id": "https://example.com/#organization", "...": "..." },
{ "@type": "WebSite", "@id": "https://example.com/#website", "...": "..." },
{ "@type": "WebPage", "@id": "https://example.com/post/#webpage", "...": "..." }
]
}@graph là một container, không một requirement. Bạn có thể absolutely dùng tách biệt
<script> chặn cho riêng lẻ items — Google tài liệu xác nhận cả hai approaches
hoạt động. Đó reason để reach cho @graph là maintainability: khi bạn có three hoặc
hơn cross-referencing entities, bạn ghi @context khi tại đó top thay vì
repeating điều này trong mỗi block, và mọi thứ đó references mọi thứ khác lives trong
một place. Này là đó pattern Yoast dùng trong production — của nó
schema architecture tài liệu
giải thích đó một shared graph lets them “avoid having to duplicate or repeat shared
properties, and to reduce the amount of code/processing/overhead required.” (bản dịch) «tránh có để duplicate hoặc repeat shared properties, và để reduce đó amount of code/processing/overhead bắt buộc.»
Vì sao nest tại all — và Điều gì Google thực ra nói
One Organization identified as hash organization is referenced as publisher by the WebSite and Article. The WebPage belongs to the WebSite and is connected to the Article. Each entity is declared once, and the same stable at-id string is reused for every reference.
Google documents hai structural options và xác nhận điều này understands cả hai. Từ đó Chung Dữ liệu có cấu trúc Guidelines: “Google Search understands multiple items on a page, whether you nest the items or specify each item individually.” (bản dịch) «Google Search understands multiple items on một trang, liệu bạn nest đó items hoặc specify mỗi item individually.» Điều này defines them plainly — nesting là “when there is one main item, and additional items are grouped under the main item” (bản dịch) «khi có một main item, và additional items là grouped dưới đó main item», và riêng lẻ items là “when each item is a separate block on the same page.” (bản dịch) «khi mỗi item là một tách biệt block on đó cùng trang.»
Đó một paragraph đó là đó closest điều để an chính thức rationale cho @id là
này: “If there are items that are more helpful when they are linked together (for
example, a recipe and a video), use @id in both the recipe and the video items to
specify that the video is about the recipe on the page. If you didn’t link the items
together, Google Search may not know that it can show the video as a Recipe rich
result.” (bản dịch) «Nếu có items đó là hơn helpful khi they là linked together (ví dụ, một recipe và một video), dùng @id trong cả hai đó recipe và đó video items để specify đó video là về đó recipe on đó trang. Nếu bạn đã không link đó items together, Google Search có thể không know đó điều này có thể cho thấy đó video as một Recipe rich kết quả.» đó là đó mechanism trong Google own words — @id là cách bạn tell Google
hai items belong together.
Worth honest note: tài liệu củ Google state điều này principle trong prose nhưng không ship
worked @graph+@id đoạn mã mẫu demonstrating nó — của họ code các ví dụ hiển thị
nested Recipe và hai riêng lẻ top-cấp độ items, neither của mà thực ra
cross-references by @id. các ví dụ dưới fill đó khoảng trống.
điều này connects trực tiếp để schema hai jobs ( cách diễn đạt từ
schema markup trang):
nesting well là squarely entity-understanding move — disambiguation và
avoiding contradictory/duplicated dữ liệu — không rich-kết quả trigger on của nó own.
Linking của bạn Article cleanly để của nó Author không unlock new SERP feature; nó
chỉ làm relationships unambiguous.
Pattern 1 — trang web → WebPage → Bài viết → Tác giả
canonical xuất bản pattern. Một Organization ( publisher), một WebSite,
sau đó theo-trang WebPage và Article on nó, với author và publisher
resolved by @id thay vì re-declared:
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "Organization",
"@id": "https://example.com/#organization",
"name": "Example Media",
"url": "https://example.com/",
"logo": "https://example.com/logo.png",
"sameAs": [
"https://www.linkedin.com/company/example-media/",
"https://en.wikipedia.org/wiki/Example_Media"
]
},
{
"@type": "WebSite",
"@id": "https://example.com/#website",
"url": "https://example.com/",
"name": "Example Media",
"publisher": { "@id": "https://example.com/#organization" }
},
{
"@type": "WebPage",
"@id": "https://example.com/nesting-schema/#webpage",
"url": "https://example.com/nesting-schema/",
"name": "Nesting Schema Markup",
"isPartOf": { "@id": "https://example.com/#website" }
},
{
"@type": "Person",
"@id": "https://example.com/team/jane-doe/#person",
"name": "Jane Doe",
"url": "https://example.com/team/jane-doe/",
"sameAs": ["https://www.linkedin.com/in/jane-doe/"]
},
{
"@type": "Article",
"@id": "https://example.com/nesting-schema/#article",
"mainEntityOfPage": { "@id": "https://example.com/nesting-schema/#webpage" },
"headline": "Nesting Schema Markup",
"author": { "@id": "https://example.com/team/jane-doe/#person" },
"publisher": { "@id": "https://example.com/#organization" }
}
]
}Note Điều gì happening: author và publisher là một-line references.
Person và Organization là declared sau khi mỗi. Article hangs off
WebPage (mainEntityOfPage), mà là isPartOf WebSite, mà là
publisher-ed by Organization. đó connected graph, không five islands.
Pattern 2 — Sản phẩm → Offer → Organization (seller)
ecommerce tương đương, và nơi nesting earns của nó giữ tại quy mô: thay vì
re-declaring của bạn merchant Organization on mỗi một của thousands của sản phẩm
các trang, declare nó sau khi và reference nó as seller:
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "Organization",
"@id": "https://shop.example.com/#organization",
"name": "Example Shop",
"url": "https://shop.example.com/",
"logo": "https://shop.example.com/logo.png"
},
{
"@type": "Product",
"@id": "https://shop.example.com/widget/#product",
"name": "Deluxe Widget",
"sku": "WIDGET-001",
"brand": { "@type": "Brand", "name": "Example" },
"offers": {
"@type": "Offer",
"price": "29.99",
"priceCurrency": "USD",
"availability": "https://schema.org/InStock",
"seller": { "@id": "https://shop.example.com/#organization" }
}
}
]
}Offer’s seller points tại shared Organization node. giống nhau seller
entity, một declaration, referenced từ mỗi sản phẩm. (cho rất lớn
variant sets, giống nhau shared-@id ý tưởng extends để ProductGroup với variant
Products — đó specialization của điều này pattern, không khác mechanism.)
three mistakes đó break graph
Này là đó practical heart of an audit. Khi nesting “doesn’t work,” (bản dịch) «không hoạt động,» đây là gần như luôn một of những three.
1. Inconsistent hoặc non-unique @id các giá trị
giống nhau entity được cho khác @id strings trên các trang (hoặc trên
replatform/migration), so các công cụ tìm kiếm và các validator see them as unrelated
entities thay vì một. hoặc opposite — reusing một @id cho hai genuinely
khác entities. khắc phục là strict, được ghi lại convention (e.g.
{base-url}/#organization, {page-url}/#webpage, {profile-url}/#person) applied
mechanically. Case được tính; #author ≠ #Author.
2. Orphaned references
An @id là referenced nhưng không bao giờ declared. Bạn ghi
"author": {"@id": "https://example.com/#person-jane"}, nhưng không node anywhere trong đó
tested document thực ra declares đó @id với một @type và properties. Worth
đang precise ở đây: một bare {"@id": "..."} object — điều gì đó
JSON-LD spec calls một node reference (“a node
object used to reference a node having only the @id key” (bản dịch) «một node object được dùng để reference một node có chỉ đó @id key») — là hợp lệ JSON-LD syntax
on của nó own; điều này không một parse lỗi. Đó vấn đề là semantic và consumer-cụ thể:
đó dự kiến connection — “this Article’s author is that Person” (bản dịch) «này Bài viết tác giả là đó Person» — không bao giờ resolves để
bất cứ điều gì hữu ích, so bất kỳ feature hoặc reader đó needed đó tác giả thực tế name, URL,
hoặc sameAs dữ liệu xuất hiện lên empty. Này là đó sneaky một: các validator thường vẫn parse
mỗi declared item không có erroring, so không có gì screams tại bạn. Bạn ship an
incomplete graph và không bao giờ notice. Momentic
@id hướng dẫn
catalogs này as một of đó hầu hết phổ biến thực tế nesting failures.
3. Duplicate đầy đủ declarations của giống nhau entity
opposite của orphaning: re-declaring hoàn tất Organization/Person object
inline on mỗi trang thay vì referencing nó sau khi. Hai khác điều có thể happen
ở đây, và nó worth telling them apart:
- Repeated declarations of đó genuinely giống nhau entity. Theo đó
JSON-LD spec, “the properties of a
node in a graph may be spread among different node objects within a document. When
that happens, the keys of the different node objects need to be merged to create the
properties of the resulting node.” (bản dịch) «đó properties of một node trong một graph có thể là spread among khác nhau node objects trong một document. Khi đó happens, đó keys of đó khác nhau node objects cần để là đã hợp nhất để tạo đó properties of đó resulting node.» So repeating đó giống nhau
@idvới đó giống nhau (hoặc compatible) dữ liệu không một parse failure — processors hợp nhất điều này. Đó không làm điều này một good ý tưởng: đây là vẫn điều gì nesting tồn tại để ngăn, và điều này bloats markup và tạo một maintenance trap — cập nhật của bạn address hoặc logo trong một template, forget đó other forty, và đó entity hiện tại contradicts itself trên đó site. Cả hai Ahrefs’ schema coverage và Schema App independently làm đó giống nhau “change one and forget the others” (bản dịch) «thay đổi một và forget đó others» point. - Đó giống nhau
@idreused cho hai thực ra khác nhau entities. Này là đó real break: hai node objects share an identifier nhưng mô tả conflicting điều (một khác nhau name, một khác nhau logo, một khác nhau@type). đó là một semantic conflict, không một harmless hợp nhất — pick một distinct@idcho mỗi genuinely tách biệt entity.
Declare sau khi, reference mọi nơi — maintenance case cho đang làm so holds either
way, mặc dù giống nhau-entity repeat sẽ không technically break graph way
orphaned reference hoặc genuinely conflicting @id sẽ.
unresolved câu hỏi: làm @id resolve trên các trang?
Ở đây đó honest limit đó separates một real câu trả lời từ đó confident-nhưng-sai
version. Google tài liệu không bao giờ explicitly trạng thái liệu @id references
resolve trên các trang — e.g., một sản phẩm trang Offer.seller pointing tại an
Organization node đó là declared chỉ on đó homepage. Không Google Search Central
document dùng “cross-trang” hoặc “across pages” (bản dịch) «trên các trang» trong relation để @id.
Đó một nearby tín hiệu points toward self-contained các trang: Google khuyến nghị, cho
duplicate nội dung, “placing the same structured data on all page duplicates, not
just on the canonical page” (bản dịch) «placing đó giống nhau dữ liệu có cấu trúc on all trang duplicates, không chỉ on đó canonical trang» — mà implies dữ liệu có cấu trúc là evaluated theo trang,
không fetched từ elsewhere. Và có không on-đó-record statement từ một named
Google hoặc Bing rep (Mueller, Illyes, Splitt) cụ thể resolving đó cross-trang
@id câu hỏi đó I có thể verify. Bing, cho của nó part, có
JSON-LD validation trong Quản trị viên web Tools
nhưng không published @id/@graph-cụ thể hướng dẫn tại all — một genuine tài liệu
khoảng trống, không một position I’m going để invent cho them.
So, as of July 2026, treat “Google follows @id links across pages” (bản dịch) «Google follows @id links trên các trang» as an
ngành inference, không một confirmed behavior. Đó safe default — mà Yoast, Momentic, và Schema App all
converge on independently — là: giữ @id các giá trị consistent cho đó giống nhau entity
mọi nơi, nhưng vẫn output đó hoàn tất entity graph on mỗi trang đó cần điều này.
không assume Google sẽ fetch một referenced entity từ một khác nhau URL. Yoast
production lựa chọn là chính xác này: điều này emits đó đầy đủ graph on mỗi trang thay vì
relying on cross-trang resolution.
Cách validate nested schema
Hai tools:
- Rich Kết quả Kiểm thử — trong
practitioner kiểm thử as của July 2026, nó parses
@grapharrays và resolves@idreferences trong tested document: Khi entity references B by@idvà B là declared trong giống nhau graph, họ hiển thị as connected; Khi referenced@idlà không bao giờ declared trong tested markup, tool vẫn parses declared items individually không có erroring, nhưng có thể’t hiển thị connection. Google không document điều này UI behavior explicitly anywhere I có thể tìm, so treat nó as observed, reproducible tool behavior thay vì chính thức đặc tả — và re-kiểm tra nó nếu tool UI thay đổi. đó behavior là chính xác Vì sao orphaned references slip qua — không lỗi, chỉ bị thiếu link. - Schema Markup Validator — schema.org own vocabulary validator, ít hơn opinionated về Google supported rich-kết quả types.
Kiểm thử được kết xuất trang, không chỉ của bạn template nguồn — nếu JSON-LD là injected qua JavaScript, xác nhận nó thực ra present. Google documents reading JSON-LD đó dynamically injected by JavaScript, nhưng đó cụ thể để Google — JavaScript-execution behavior varies by crawler và sản phẩm, và có không blanket rule đó mỗi AI crawler renders JS giống nhau way (hoặc tại all). Shipping JSON-LD trong ban đầu HTML thay vì assuming nó’ll là executed là conservative lựa chọn — đó schema-markup-cho-AI concern.
Myths worth killing
- “
@idneeds to be a real, live, fetchable URL.” (bản dịch) «@idcần để là một real, trực tiếp, fetchable URL.» Không — by convention đây là một canonical URL plus một fragment, nhưng của nó function là identification, không fetchability. Đó fragment không cần để resolve để của nó own trang. - “Same
@idon different pages auto-merges those entities in Google’s index, like a canonical tag consolidates pages.” (bản dịch) «Giống nhau@idon khác nhau các trang auto-merges những entities trong Google chỉ mục, như một canonical tag consolidates các trang.» Không confirmed by bất kỳ Google doc. Consistent@idlà good hygiene, không một proven cross-trang consolidation mechanism. - “You must use
@graph; separate script blocks are wrong.” (bản dịch) «Bạn phải dùng@graph; tách biệt script chặn là sai.» Sai. Google understands cả hai.@graphlà một maintainability lựa chọn. - “More nesting always improves entity understanding.” (bản dịch) «Hơn nesting luôn improves entity understanding.» Chỉ nếu đó entities là
genuinely related. Nesting unrelated items (Schema App ví dụ: an unrelated
Eventdưới mộtRecipe) không help và có thể muddy các tín hiệu. - “
@id/@graphstructure is a ranking or rich-result factor.” (bản dịch) «@id/@graphstructure là một xếp hạng hoặc rich-kết quả factor.» Không. Của nó giá trị là disambiguation và reduced duplication — consistent với schema không đang một xếp hạng factor tại all. - “An undeclared
@idis harmless; engines just ignore it.” (bản dịch) «An undeclared@idlà harmless; engines chỉ bỏ qua điều này.» đó là đó orphaned-reference failure — đó dự kiến connection silently không form, và tools thường không lỗi, so bạn ship điều này unnoticed.
nơi điều này sits
Đây là Cách-để layer dưới
dữ liệu có cấu trúc hub, deeper sibling của
schema markup (mà
introduces @id/@graph) và JSON-LD
( format). nó leans on giống nhau entity-understanding thinking as
entities và
schema markup cho AI — well-được xây dựng
graph là entity infrastructure, liệu consumer là Google Knowledge Graph hoặc
LLM. toàn bộ sub-cluster lives bên trong on-trang SEO.
AI summary
condensed take on Nâng cao version:
- Điều gì điều này là. Nesting connects JSON-LD entities thay vì leaving disconnected
chặn.
@id= một ổn định, unique URI (thường canonical URL +#fragment) đó names an entity so others reference điều này by@idthay vì re-declaring điều này.@graph= một từ khóa bundling connected entities vào một<script>block, cross-referencing qua@id. @id≠url, và@idneedn’t resolve. Theo đó JSON-LD spec,@idlà node identification, không fetchability;urlmô tả một real trang.@idlà case-sensitive.- Google confirmed position: điều này understands cả hai nesting và riêng lẻ
items, và bạn dùng
@idđể tell Google hai items là linked. Điều này làm không document cross-trang@idresolution — treat “Google follows@idacross pages” (bản dịch) «Google follows@idtrên các trang» as an ngành inference, không confirmed. Nearest tín hiệu (“duplicate the same schema on all duplicate pages” (bản dịch) «duplicate đó giống nhau schema on all duplicate các trang») points toward theo-trang/self-contained evaluation. - Hai patterns:
WebSite → WebPage → Article → Author(xuất bản, vớiauthor/publisherby@id) vàProduct → Offer → Organization/seller(ecommerce, một seller node referenced từ mỗi sản phẩm). - Three các chế độ lỗi: (1) inconsistent/non-unique
@idcác giá trị; (2) orphaned references — an@idcited nhưng không bao giờ declared (semantically incomplete, không hợp lệ JSON-LD; silent failure since các validator thường không lỗi); (3) duplicate đầy đủ declarations of đó giống nhau entity (maintenance trap — giống nhau-entity repeats hợp nhất dưới JSON-LD’s node rules, nhưng reusing một@idcho genuinely khác nhau entities là một real conflict). - Safe default: consistent
@idmọi nơi plus đó hoàn tất entity graph on mỗi trang đó cần điều này — không rely on cross-trang fetching. (Yoast, Momentic, Schema App all converge ở đây.) - Validate với đó Rich Kết quả Kiểm thử (resolves
@idtrong đó tested doc) và đó schema.org validator; kiểm thử đó được kết xuất trang. - Không một xếp hạng hoặc rich-kết quả lever by itself — đây là entity understanding (disambiguation + de-duplication).
Tài liệu chính thức
Chính-nguồn tài liệu và specs.
- Chung Dữ liệu có cấu trúc Guidelines — đó một trang nơi Google documents nesting so với. riêng lẻ items và đó
@id-linking principle (cuối cùng đã cập nhật July 10, 2026, confirmed trực tiếp). Cũng đó “duplicate the same structured data on all page duplicates” (bản dịch) «duplicate đó giống nhau dữ liệu có cấu trúc on all trang duplicates» hướng dẫn. - Intro để Cách Đánh dấu dữ liệu có cấu trúc Hoạt động — format context và đó tính đầy đủ/độ chính xác rules.
- Rich Kết quả Kiểm thử — parses
@graphvà resolves@idreferences trong đó tested document.
schema.org / W3C
- W3C JSON-LD 1,1 Khuyến nghị — spec đó defines
@id,@graph, node objects, và graph objects. - Schema Markup Validator — schema.org vocabulary validator (ít hơn tied để Google rich-kết quả hỗ trợ list).
Bing / Microsoft
- Introducing JSON-LD Hỗ trợ trong Bing Quản trị viên web Tools — Bing Markup Validator hỗ trợ JSON-LD; note có không published Bing hướng dẫn cụ thể để
@id/@graphnesting mechanics.
Quotes từ nguồn
On—record statements từ Google. mỗi link là deep link đó jumps để quoted passage.
Google — nesting so với. riêng lẻ items
- “Google Search understands multiple items on a page, whether you nest the items or specify each item individually.” (bản dịch) «Google Search understands multiple items on một trang, liệu bạn nest đó items hoặc specify mỗi item individually.» — Google Search Central, Chung Dữ liệu có cấu trúc Guidelines. Nhảy đến trích dẫn
Google — Vì sao @id tồn tại ( linking principle)
- “…use
@idin both the recipe and the video items to specify that the video is about the recipe on the page. If you didn’t link the items together, Google Search may not know that it can show the video as a Recipe rich result.” (bản dịch) «…dùng@idtrong cả hai đó recipe và đó video items để specify đó video là về đó recipe on đó trang. Nếu bạn đã không link đó items together, Google Search có thể không know đó điều này có thể cho thấy đó video as một Recipe rich kết quả.» — cùng trang. Nhảy đến trích dẫn
Google — treat mỗi trang as self-contained ( nearest cross-trang tín hiệu)
- “If you have duplicate pages for the same content, we recommend placing the same structured data on all page duplicates, not just on the canonical page.” (bản dịch) «Nếu bạn có duplicate các trang cho đó giống nhau nội dung, we khuyến nghị placing đó giống nhau dữ liệu có cấu trúc on all trang duplicates, không chỉ on đó canonical trang.» — cùng trang. Nhảy đến trích dẫn
On Điều gì không on record
Google tài liệu không bao giờ explicitly xác nhận liệu @id references resolve trên
các trang, và I không thể verify bất kỳ on-đó-record statement từ một named Google hoặc Bing
rep resolving đó câu hỏi. Nơi này bài viết says “the safe default is consistent
@id plus the full graph per page,” (bản dịch) «đó safe default là consistent @id plus đó đầy đủ graph theo trang,» đó là practitioner consensus (Yoast, Momentic,
Schema App converging independently), không một Google quote — I’ve labeled điều này as such
trong đó Advanced tab thay vì dressing điều này lên as chính thức.
@id/@graph không phải xếp hạng factor follows từ Google
rộng hơn, repeatedly-stated position đó dữ liệu có cấu trúc không phải trực tiếp xếp hạng
tín hiệu — nó không phải verbatim @id-cụ thể quote. Nested schema — bảng tra nhanh
@id so với. url so với. @graph
| Điều | Điều gì nó là | phải nó resolve để trang? |
|---|---|---|
@id | Unique identifier cho entity (node trong graph) | Không — identification, không fetchability |
url | entity thực, fetchable trang | Có — nó thực tế URL |
@graph | Array bundling connected entities trong một <script> block | N/ — nó container từ khóa |
@id conventions
- Absolute URL + descriptive fragment:
https://example.com/#organization. - Case-sensitive —
#Author≠#author. Pick một, không bao giờ drift. - giống nhau entity → giống nhau
@idmọi nơi. khác entities → khác@id. - không bao giờ bare arbitrary string (
"id1").
** hai patterns**
| Pattern | Chain | Reference by @id |
|---|---|---|
| Xuất bản | WebSite → WebPage → Article | author → Person, publisher → Organization |
| Ecommerce | Product → Offer | seller → Organization |
Three điều để watch cho
| Mistake | Điều gì happens |
|---|---|
Inconsistent / non-unique @id | giống nhau entity seen as hai (hoặc hai entities collapsed vào một) |
| Orphaned reference | @id cited nhưng không bao giờ declared → connection silently fails (hợp lệ JSON-LD, nhưng semantically incomplete; thường không validator lỗi) |
| Duplicate đầy đủ declarations | Bloat + maintenance trap (giống nhau-entity repeats hợp nhất dưới JSON-LD’s rules; reusing một @id cho khác entities là thực conflict) |
Fast facts
- Google xác nhận cả hai nesting và riêng lẻ items hoạt động;
@graphlà tùy chọn. - Google làm không document cross-trang
@idresolution — assume theo-trang. - Safe default: consistent
@id+ hoàn tất graph on mỗi trang đó cần nó. - không xếp hạng hoặc rich-kết quả lever — nó entity understanding.
- Validate với Rich Kết quả Kiểm thử (resolves
@idtrong-document) và schema.org validator; kiểm thử được kết xuất trang.
Nesting anti-patterns
cụ thể ways nested schema goes sai — và khắc phục cho mỗi.
Drifting @id conventions trên templates
của bạn blog template emits #organization, của bạn sản phẩm template emits #org, và
migrated section emits #company. Three strings, một thực entity — hiện tại seen as
three. khắc phục: một được ghi lại convention, applied mechanically (ideally generated
từ single config, way plugin làm nó).
Referencing entity bạn không bao giờ declared (orphan)
"author": {"@id": "#person-jane"} với không #person-jane node anywhere trong
document. link resolves để không có gì và connection fails — và Rich
Kết quả Kiểm thử thường sẽ không lỗi, nó chỉ sẽ không hiển thị connection. khắc phục: mỗi
@id bạn reference phải là declared sau khi, trong tested markup, với @type.
Re-declaring đầy đủ entity on mỗi trang
Copy-pasting hoàn tất Organization (name, logo, mỗi sameAs) inline vào
mỗi bài viết và sản phẩm. Hoạt động, nhưng nó maintenance trap: thay đổi logo sau khi,
forget forty các trang, và của bạn entity hiện tại contradicts itself. khắc phục: declare sau khi,
reference by @id mọi nơi khác.
Nesting unrelated entities để “add more schema” (bản dịch) «thêm hơn schema»
Bundling một Recipe, an unrelated Event, và một JobPosting dưới một graph
vì “more markup is better.” (bản dịch) «hơn markup là tốt hơn.» Relatedness có để là real — co-location không một
mối quan hệ. Cách sửa: chỉ connect entities đó genuinely relate.
Assuming cross-trang @id resolution
Declaring Organization chỉ on homepage và referencing nó by @id từ
sản phẩm các trang, expecting Google để fetch nó. tài liệu củ Google không xác nhận điều này hoạt động.
khắc phục: giữ @id consistent, nhưng bao gồm hoàn tất entity on mỗi trang đó
references nó.
@id đó thực sự meant để là url (hoặc vice versa)
sử dụng @id nơi bạn cần fetchable trang reference, hoặc expecting url để link
graph nodes. họ’re khác jobs. khắc phục: @id cho graph identity, url cho
thực trang; entity có thể có cả hai.
Case và trailing-slash inconsistency
https://example.com/#Org on một trang, https://example.com/#org on một, hoặc
.../post/#article so với .../post#article. All được xem như distinct. khắc phục: normalize
chính xác — case, slashes, giao thức, host.
Worked các ví dụ
Sao chép và dán starting points cho hai patterns và đúng reference.
Xuất bản: trang web → WebPage → Bài viết → Tác giả
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "Organization",
"@id": "https://example.com/#organization",
"name": "Example Media",
"url": "https://example.com/",
"logo": "https://example.com/logo.png",
"sameAs": ["https://www.linkedin.com/company/example-media/"]
},
{
"@type": "WebSite",
"@id": "https://example.com/#website",
"url": "https://example.com/",
"name": "Example Media",
"publisher": { "@id": "https://example.com/#organization" }
},
{
"@type": "WebPage",
"@id": "https://example.com/post/#webpage",
"url": "https://example.com/post/",
"isPartOf": { "@id": "https://example.com/#website" }
},
{
"@type": "Person",
"@id": "https://example.com/team/jane-doe/#person",
"name": "Jane Doe",
"url": "https://example.com/team/jane-doe/"
},
{
"@type": "Article",
"@id": "https://example.com/post/#article",
"mainEntityOfPage": { "@id": "https://example.com/post/#webpage" },
"headline": "Example headline",
"author": { "@id": "https://example.com/team/jane-doe/#person" },
"publisher": { "@id": "https://example.com/#organization" }
}
]
}Ecommerce: Sản phẩm → Offer → Organization (seller)
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "Organization",
"@id": "https://shop.example.com/#organization",
"name": "Example Shop",
"url": "https://shop.example.com/"
},
{
"@type": "Product",
"@id": "https://shop.example.com/widget/#product",
"name": "Deluxe Widget",
"offers": {
"@type": "Offer",
"price": "29.99",
"priceCurrency": "USD",
"availability": "https://schema.org/InStock",
"seller": { "@id": "https://shop.example.com/#organization" }
}
}
]
}đúng reference so với. orphaned reference
đúng — referenced node là declared trong giống nhau graph:
{
"@context": "https://schema.org",
"@graph": [
{ "@type": "Person", "@id": "https://example.com/#jane", "name": "Jane Doe" },
{ "@type": "Article", "author": { "@id": "https://example.com/#jane" } }
]
}Hỏng (orphan) — #jane là referenced nhưng không bao giờ declared, so author resolves để
không có gì:
{
"@context": "https://schema.org",
"@graph": [
{ "@type": "Article", "author": { "@id": "https://example.com/#jane" } }
]
} Nested schema audit — checklist
truyền để xác nhận của bạn graph là connected, consistent, và self-contained:
- Một
@idconvention, được ghi lại và applied mọi nơi (e.g.{base}/#organization,{page}/#webpage,{profile}/#person). - giống nhau entity → giống nhau
@idtrên mỗi trang và template (không#orgso với.#organizationdrift; case và trailing slashes normalized). - Không orphaned references — mỗi
@idbạn reference là thực ra declared, trong tested document, với@typevà properties. - Không duplicate đầy đủ declarations — shared entities (
Organization,Person) là declared sau khi và referenced by@id, không re-pasted inline. -
@idso với.urlđược sử dụng correctly —@ididentifies node;urlpoints tại thực trang; entity có thể có cả hai. - chỉ genuinely related entities là connected — không unrelated items bundled chỉ để thêm markup.
- Hoàn tất graph on mỗi trang đó cần nó — không rely on cross-trang
@idresolution; bao gồm referenced entities theo trang. - Validated trong Rich Kết quả Kiểm thử (connections hiển thị as linked) và schema.org validator.
- Tested on được kết xuất trang, không chỉ template nguồn (xác nhận JS-injected JSON-LD là thực ra present; máy chủ-render cho AI các crawler).
- Consistent markup trên canonical + duplicate các trang — giống nhau structured dữ liệu on all versions.
Tự kiểm tra: Nesting Schema Markup
Five nhanh các câu hỏi on @id, @graph, và mistakes đó break nested graph.
Pick câu trả lời cho mỗi, sau đó kiểm tra.
các tài nguyên worth của bạn time
My related writing
- Dữ liệu có cấu trúc: Điều gì nó là và Cách sử dụng nó — my Ahrefs hướng dẫn để schema types, implementation các phương thức, validation tools, và
sameAsentity-disambiguation risk ( entity-understanding job@id/@graphphục vụ). - Người mới bắt đầu Hướng dẫn để kỹ thuật SEO — nơi dữ liệu có cấu trúc sits trong bigger kỹ thuật picture.
My speaking
- Cách Tìm kiếm Hoạt động (SlideShare) — my walkthrough of crawling, kết xuất, lập chỉ mục, và xếp hạng, cho đó context dữ liệu có cấu trúc feeds vào. (My standing disclaimer áp dụng: “This is my understanding of systems… not going to be 100% complete or accurate.” (bản dịch) «Này là my understanding of các hệ thống… không going để là 100% hoàn tất hoặc chính xác.»)
Chính thức
- Google Chung Dữ liệu có cấu trúc Guidelines — nesting so với. riêng lẻ items và
@id-linking principle. - W3C JSON-LD 1,1 Khuyến nghị — spec defining
@id,@graph, và node/graph objects. - Rich Kết quả Kiểm thử và schema.org validator — hai tools cho kiểm tra nested graph.
Từ khoảng đó ngành
- We Tracked 1 885 Các trang Thêm Schema. AI Citations Barely Moved. (Louise Linehan & Xibeijia Guan, Ahrefs) — an Ahrefs nghiên cứu on schema và AI citations, hữu ích cho calibrating expectations đó sạch markup, including nesting, là entity infrastructure thay vì một citation cheat code.
- Node Identifiers: Từ Dữ liệu có cấu trúc để Linked Dữ liệu (Patrick Hathaway, Sitebulb) — đó clearest “what a node identifier actually is” (bản dịch) «điều gì một node identifier thực ra là» explainer, với một worked distinct-
@idví dụ và đó case-sensitivity warning. - Điều gì là an @id trong Dữ liệu có cấu trúc? (Mark van Berkel, Schema App) — cites đó JSON-LD spec definition và đó hữu ích “entity home” cách diễn đạt (đó trang nơi an entity đầy đủ definition lives).
- Điều gì là Nesting trong Schema Markup? (Jasmine Drudge-Willson, Schema App) — nesting-cho-hierarchy so với. -convenience, và vì sao nesting unrelated entities là một mistake.
- Schema: Technology và approach (Yoast nhà phát triển tài liệu) — một real production
@grapharchitecture, của nó@idtemplate, và đó candid “we output the full graph on every page rather than rely on cross-page resolution” (bản dịch) «we output đó đầy đủ graph on mỗi trang thay vì rely on cross-trang resolution» lựa chọn. - Dùng @id trong Schema.org Markup cho SEO, LLMs & Knowledge Graphs (Tyler Einberger, Momentic) — một sạch catalog of phổ biến
@idmistakes (orphaned references, không ổn định IDs, inconsistent các giá trị).
Nhật ký thay đổi
Đã cập nhật 8 thg 8, 2026.
Tóm tắt biên tập và chi tiết thay đổi đã ghi nhận.Chi tiết thay đổi
-
Ghi chú thay đổi chi tiết hiện chỉ có bằng tiếng Anh.
Không thể so sánh đầy đủ — không có bản lưu trước đó cho lần sửa đổi này.
Đã cập nhật 21 thg 7, 2026.
Tóm tắt biên tập và chi tiết thay đổi đã ghi nhận.Chi tiết thay đổi
-
Ghi chú thay đổi chi tiết hiện chỉ có bằng tiếng Anh.
Không thể so sánh đầy đủ — không có bản lưu trước đó cho lần sửa đổi này.
Đã cập nhật 18 thg 7, 2026.
Tóm tắt biên tập và chi tiết thay đổi đã ghi nhận.Chi tiết thay đổi
-
Ghi chú thay đổi chi tiết hiện chỉ có bằng tiếng Anh.
-
Ghi chú thay đổi chi tiết hiện chỉ có bằng tiếng Anh.
-
Ghi chú thay đổi chi tiết hiện chỉ có bằng tiếng Anh.
Không thể so sánh đầy đủ — không có bản lưu trước đó cho lần sửa đổi này.