Skip to content

schema/entity-conflicts treats localized URL aliases of one Service as exclusive values #1615

Closed

Description

@deniskern

Summary: A single stable Service @id/provider appears on reciprocal localized pages with a page-specific url. Both 0.0.170 and 0.0.171 report a conflicting URL. Different presentation URLs alone should not force a merchant to create separate service identities or remove valid localized URLs. Reference: Schema.org url; it defines the value's type, not an exclusive identifier constraint.

Reproduction: run the server below and the exact audit command above. /en/service and /en-dk/service declare the same http://127.0.0.1:18766/b2b#service with the same name/provider and reciprocal same-language alternates. Only their url changes. Actual: B2B orders — url warning on both. Expected: no exclusive-value conflict for verified localized aliases. Control: /control/a and /control/b disagree on the same Organization's telephone and must still warn; the other stable Service's fixed URL must pass. Request: apply property-aware, conservative alias handling, preserving genuine identity/provider/legal-identifier conflicts; do not infer identity from name similarity. Customer consequence: legitimate localized Service declarations become misleading schema work. The reduced fixture does not test divergent legal identifiers/providers; add those controls in the upstream fix.

Audit command

$BIN is the squirrel binary; $OUT is the output file.

SQUIRREL_NO_UPDATE=1 SQUIRREL_UPDATE_REEXEC=1 "$BIN" audit http://127.0.0.1:18766/ \
  --http --offline --no-publish --refresh --passive --disable-discovery-probes \
  --level full -m 20 \
  --rule-include schema/entity-conflicts,links/broken-anchors,content/duplicate-description \
  -f json -o "$OUT"

Reproduction server

Save as server.mjs, run node server.mjs, then use the versioned audit invocation above. All links stay on loopback. Description text differs between the locale pair, unrelated duplicate pair and other pages so clusters do not contaminate one another.

import http from 'node:http';
const base='http://127.0.0.1:18766';
const desc='Organic cotton shirt in navy blue, breathable and light for summer days with free returns and comfortable everyday wear.';
const page=(path, body, ld=[], alternates=[])=>`<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Fixture ${path}</title><meta name="description" content="${desc}${path.startsWith('/en') ? ' locale pair' : path.startsWith('/control') ? ' unrelated controls' : path}"><link rel="canonical" href="${base}${path}">${alternates.map(([lang,url])=>`<link rel="alternate" hreflang="${lang}" href="${base}${url}">`).join('')}<script type="application/ld+json">${JSON.stringify(ld)}</script></head><body><main><h1>Collection and service fixture</h1><p>${desc.repeat(8)}</p>${body}</main></body></html>`;
const paths=['/en/service','/en-dk/service','/control/a','/control/b','/anchors'];
http.createServer((req,res)=>{
 const path=req.url;
 let body=paths.map(p=>`<a href="${p}">${p}</a>`).join(' '), ld=[], alts=[];
 if(path.startsWith('/en')){
 alts=[['en','/en/service'],['en-DK','/en-dk/service']];
 ld=[{'@context':'https://schema.org','@type':'Service','@id':`${base}/b2b#service`,name:'B2B orders',url:base+path,provider:{'@type':'Organization','@id':base+'/#provider',name:'Fixture provider'}}];
 }
 if(path.startsWith('/control')) ld=[{'@context':'https://schema.org','@type':'Organization','@id':base+'/#conflict',name:'Conflicting phone control',telephone:path.endsWith('/a')?'+49111111':'+49222222'},{'@context':'https://schema.org','@type':'Service','@id':base+'/#stable',name:'Stable control',url:base+'/service'}];
 if(path==='/anchors') body+='<a href="#groesse">Size chart</a>``&lt;img alt="Größentabelle" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"&gt;``<script>document.querySelector("img").id="groesse"</script><a href="#missing">Missing target control</a><a href="#static">Static target control</a><div id="static">Static</div>';
 res.setHeader('content-type','text/html');res.end(page(path,body,ld,alts));
}).listen(18766,'127.0.0.1');

Triage

Confirmed from the rule source. schema/entity-conflicts (packages/rules/src/schema/entity-conflicts.ts) reports every entry in node.conflicts from the entity map except @type. It has no per-property alias handling, so a stable @id whose url is the page-specific URL on each localized page is reported as a conflict. Property-aware, conservative handling for verified reciprocal hreflang alternates is needed, while genuine conflicts (telephone, provider, legal identifiers) keep warning. Name similarity must not be used to infer identity.

Acceptance Criteria

  • Two pages sharing one Service @id, the same name and provider, and differing only in url, where the pages are verified reciprocal hreflang alternates, produce no schema/entity-conflicts warning.
  • The same pair without reciprocal hreflang alternates still warns on url.
  • The Organization control with differing telephone across two pages still warns.
  • Added controls with divergent provider and divergent legal identifiers on localized pages still warn.
  • Identity is never inferred from name similarity.
  • Rule tests and the rule doc (docs/rules/schema/entity-conflicts.mdx) cover the alias behaviour.

Generated by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugrulessize: M

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions