Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016PTUEUKZE6DwmyBQbpLa9T
🦋 Changeset detectedLatest commit: cd6e76c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This was referenced Oct 4, 2026
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.
Requested by Jesse · project thread
Proposes types for #68 (matching patterns inside quads), using arrays for the patterns instead of
Variablecomponents.Before:
matchtakes terms ornull, and aQuadpassed to it only matches exactly, so there is no way to ask for every reifier of a triple term with a given subject without scanning.After: two new types and one optional interface.
An array in the subject, object or graph position matches triple terms by their components: a missing,
nullorundefinedentry matches anything, a term must be equal, and nested arrays recurse.dataset.match(null, rdf.reifies, [s, null, null])finds every reifier of a triple term with subjects. The predicate staysTerm | null, since a predicate cannot be a triple term.Why arrays rather than
Variables inside aQuad: aQuadwhose components areVariables is already a valid term with exact-match meaning today, so giving it wildcard meaning inmatchwould change what existing calls return. An array is not a term, so no existing call can pass one, and its meaning can be defined without touchingQuad.equalsorVariable(see the concerns in rdfjs/data-model-spec#162). Joins over repeated variables stay with a bindings-level API such as #71.Compatibility: purely additive.
DatasetCoreis unchanged, so existing implementations and callers compile and behave as before, and datasets without triple-term indexes need not do anything. A dataset opts in by implementingQuadPatternDatasetCore, which is still assignable toDatasetCore.npm testandnpm run lintpass (lint reports only the warnings already onmaster).Open questions:
Source.matchandDataset.deleteMatches?matchintoDatasetCoreitself?Implementation and benchmarks: rdfjs/N3.js#811 (O(matches) lookups at 1 M quads, about 180 µs against 850 ms for a scan). That work is moving to n3-match-bgp while this is discussed: jeswr/n3-match-bgp#1
🤖 Generated with Claude Code
https://claude.ai/code/session_016PTUEUKZE6DwmyBQbpLa9T