Skip to content

ExtractorUtils: collectInternalLinksFromNode should recurse past a match too - #862

Open
ManasBagul23 wants to merge 1 commit into
dbpedia:masterfrom
ManasBagul23:fix-collectinternallinks-no-nested-recursion
Open

ManasBagul23 wants to merge 1 commit into
dbpedia:masterfrom
ManasBagul23:fix-collectinternallinks-no-nested-recursion

Conversation

@ManasBagul23

@ManasBagul23 ManasBagul23 commented Oct 21, 2026 •

Copy link
Copy Markdown

ExtractorUtils.collectInternalLinksFromNode is the odd one out among its three siblings in this
file (collectParserFunctionsFromNode, collectTemplateParametersFromNode,
collectTemplatesFromNodeTransitive): all three of those continue recursing into a matched
node's own children after collecting it, so a nested instance (e.g. a template inside a
template) is still found. collectInternalLinksFromNode stopped at the first match instead, so a
link nested inside another link's own label/children — for example [[A|see also [[B]]]] — only
ever yielded A, never B.

Fix: recurse into the matched node's children too, matching the established pattern of the
other three collectors in this same file.

Summary by CodeRabbit

  • Bug Fixes
    • Nested links are now included when extracting links from structured content, improving completeness for pages containing links within other links.

…tch too

Its three siblings in this file (collectParserFunctionsFromNode,
collectTemplateParametersFromNode, collectTemplatesFromNodeTransitive) all
continue recursing into a matched nodes own children after adding it, so
a nested instance (e.g. a template inside a template) is still found.
collectInternalLinksFromNode alone stopped at the first match, so a link
nested inside another links own label/children (e.g.
"[[A|see also [[B]]]]") only ever yielded A, never B.

Made it recurse into the matched nodes children too, matching the
established pattern of the other three collectors in this same file.
Copilot AI balanced review requested due to automatic review settings October 21, 2026 18:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 036b19ad-07cb-4bdc-b76e-b6e1ad353dd7
📥 Commits

Reviewing files that changed from the base of the PR and between b66cb8b and 80efe33.

📒 Files selected for processing: 1
  • core/src/main/scala/org/dbpedia/extraction/util/ExtractorUtils.scala

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

collectInternalLinksFromNode now recurses into the children of a matched internal link after collecting that link.

Changes: Internal link collection

Layer / File(s) Summary
Recursive internal link collection
core/src/main/scala/org/dbpedia/extraction/util/ExtractorUtils.scala
The collector now traverses the children of a matched internal link, so nested links are included.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: jimkont

Merge Risk: ⚪ Minimal · up to 80efe

The change is ready to merge with no actionable risk identified.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: recursive traversal continues after a matching internal link is collected.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

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.

2 participants