Skip to content

fix(dataset-registry-client): work around LDkit count() ignoring $id filter#207

Merged
ddeboer merged 1 commit intomainfrom
fix/ldkit-count-ignores-id
Mar 6, 2026
Merged

fix(dataset-registry-client): work around LDkit count() ignoring $id filter#207
ddeboer merged 1 commit intomainfrom
fix/ldkit-count-ignores-id

Conversation

@ddeboer
Copy link
Member

@ddeboer ddeboer commented Mar 6, 2026

Summary

LDkit 2.6.0 has a bug where Lens.count() ignores the $id property in search criteria (karelklima/ldkit#169). This causes Paginator to loop forever when querying by IRI, because count() returns the total of all datasets while find() correctly returns only the matching one.

  • When $id is set, skip count() and use find() directly — IRI lookups don't need pagination
  • Return pre-fetched results in the paginator callback to avoid a redundant second find() call
  • Add test for querying a dataset by $id

The workaround should be removed once LDkit publishes a fix upstream.

…filter

- When $id is set, use find() directly instead of count() to get
  accurate totals (LDkit's countQuery() doesn't handle $id)
- Return pre-fetched results in the paginator callback for $id queries
- Add test for querying a dataset by $id
@ddeboer ddeboer enabled auto-merge (squash) March 6, 2026 10:27
@ddeboer ddeboer merged commit 4968f5b into main Mar 6, 2026
2 checks passed
@ddeboer ddeboer deleted the fix/ldkit-count-ignores-id branch March 6, 2026 10:29
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