Skip to content

Fix stable Article canonical IDs#21

Merged
ziodave merged 1 commit intomainfrom
fix/stable-article-url-ids
May 7, 2026
Merged

Fix stable Article canonical IDs#21
ziodave merged 1 commit intomainfrom
fix/stable-article-url-ids

Conversation

@ziodave
Copy link
Copy Markdown
Member

@ziodave ziodave commented May 7, 2026

Summary

  • populate context.extensions["kg_build.iri_lookup"] from the import callback URL and existing IRI so canonicalization can reuse the Knowledge Graph URL-to-IRI mapping
  • keep dependent FAQPage IRIs under the existing Article IRI when the lookup resolves the Article URL
  • bump SDK metadata/docs to 8.0.17

Why

The LendingTree duplicate FAQPage issue happens when the canonicalizer cannot see the URL-to-IRI mapping. In that case it falls back to generated IDs and can mint a different Article IRI when the title/headline differs. With the lookup in context.extensions["kg_build.iri_lookup"], the existing URL-mapped IRI wins and the FAQPage follows that canonical Article. This PR intentionally does not change the fallback ID generation policy.

Verification

  • poetry run pytest tests/kg_build/test_protocol.py tests/kg_build/postprocessors/processors/test_id_postprocessor.py tests/kg_build/postprocessors/processors/test_id_generator.py tests/kg_build/postprocessors/processors/test_id_allocator.py tests/kg_build/test_iri_lookup.py -q -> 82 passed

Coverage note: targeted coverage was previously run on the affected scope; this update removes the fallback branch and keeps the fix focused on lookup propagation.

@ziodave ziodave force-pushed the fix/stable-article-url-ids branch from ca4c5b8 to 4fab7ef Compare May 7, 2026 16:25
@ziodave ziodave force-pushed the fix/stable-article-url-ids branch from 4fab7ef to 6bafe97 Compare May 7, 2026 16:31
@ziodave ziodave marked this pull request as ready for review May 7, 2026 16:41
@ziodave ziodave merged commit c55ce99 into main May 7, 2026
12 checks passed
@ziodave ziodave deleted the fix/stable-article-url-ids branch May 7, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant