Skip to content

fix: OPTIONAL filter triples in inline where + EXISTS scope fix#37

Merged
linked-cm merged 2 commits intodevfrom
fix/optional-filter-triples
Mar 25, 2026
Merged

fix: OPTIONAL filter triples in inline where + EXISTS scope fix#37
linked-cm merged 2 commits intodevfrom
fix/optional-filter-triples

Conversation

@flyon
Copy link
Member

@flyon flyon commented Mar 25, 2026

Summary

  • Inline .where() with OR filters: Filter property triples are now wrapped in nested OPTIONALs within the filtered block, so OR conditions work correctly when some entities lack certain properties (e.g., .where(f => f.name.equals('Jinx').or(f.hobby.equals('Jogging'))) no longer excludes entities without a hobby triple)
  • EXISTS/NOT EXISTS scope fix: Property triples for .every() and .some() quantifier filters are now emitted inside the EXISTS pattern instead of the outer query scope, fixing incorrect results from whereEvery
  • Tightened test assertions: whereOr, whereAnd, whereEvery, whereSequences, countEquals, selectBirthDate, and others now verify exact result counts, inclusion/exclusion, and type coercion
  • New test fixture: whereFriendsNameEqualsChained for .where().property access pattern
  • jsdom compatibility: Replaced AbortSignal.timeout() with AbortController + setTimeout in test helpers

Test plan

  • All 994 @_linked/core tests pass (81 Fuseki integration)
  • All 33 @_linked/react tests pass (7 Fuseki integration)
  • Golden SPARQL tests updated to match new output
  • Verify no regressions in downstream consumers

🤖 Generated with Claude Code

René Verheij and others added 2 commits March 24, 2026 10:53
Supports the lincd → @_linked/core migration in downstream packages:
- rawQuery(sparql, mode?) on SparqlStore for raw SPARQL passthrough
- getAllShapeClasses() exposes registered shape class map for lincd-server

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…EXISTS filter properties correctly

Inline .where() filters with OR conditions previously failed when entities
lacked certain properties because all filter property triples were required
in the OPTIONAL block. Now each filter property triple is wrapped in its own
nested OPTIONAL, allowing SPARQL's || to short-circuit over unbound variables.

EXISTS/NOT EXISTS blocks for .every() and .some() quantifiers incorrectly
placed filter property triples in the outer query scope. They are now emitted
inside the EXISTS pattern where they belong.

Also: tightened test assertions, added whereFriendsNameEqualsChained fixture,
fixed AbortSignal.timeout jsdom compatibility in test helpers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@linked-cm linked-cm merged commit cd0be01 into dev Mar 25, 2026
3 checks passed
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