fix: OPTIONAL filter triples in inline where + EXISTS scope fix#37
Merged
fix: OPTIONAL filter triples in inline where + EXISTS scope fix#37
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.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 ahobbytriple).every()and.some()quantifier filters are now emitted inside the EXISTS pattern instead of the outer query scope, fixing incorrect results fromwhereEverywhereOr,whereAnd,whereEvery,whereSequences,countEquals,selectBirthDate, and others now verify exact result counts, inclusion/exclusion, and type coercionwhereFriendsNameEqualsChainedfor.where().propertyaccess patternAbortSignal.timeout()withAbortController+setTimeoutin test helpersTest plan
@_linked/coretests pass (81 Fuseki integration)@_linked/reacttests pass (7 Fuseki integration)🤖 Generated with Claude Code