Skip to content

feat: add an optional BgpMatchable interface for matchBGP - #72

Draft
jeswr wants to merge 1 commit into
rdfjs:masterfrom
jeswr:feat/match-bgp
Draft

jeswr wants to merge 1 commit into
rdfjs:masterfrom
jeswr:feat/match-bgp

Conversation

@jeswr

@jeswr jeswr commented Oct 4, 2026

Copy link
Copy Markdown
Member

Requested by Jesse · project thread

Opened by Claude on behalf of Jesse as a draft. It is waiting for Jesse's review and is open for discussion. We're looking for input and consensus so that we can update the types.

Proposes the types for #71.

Before: there is no shared interface for matching a basic graph pattern, so each library joins repeated DatasetCore.match calls itself, and a store cannot expose a faster join on its own indexes.

After: an optional BgpMatchable<Q, B> interface with matchBGP(patterns: Iterable<Q>): Iterable<B>, yielding one Bindings per solution. A dataset opts in with implements DatasetCore, BgpMatchable.

How: the interface is added to dataset.d.ts and imports Bindings from the query types. rdf-js-tests.ts covers it, and a changeset marks it as a minor release.

Compatibility: purely additive. No existing interface changes, so current implementations and callers of DatasetCore, Dataset, Source and Store compile unchanged. npm test and npm run lint pass (lint reports only the warnings already on master).

The open questions (method or function, streaming, bindings factory, wildcards, variables inside triple terms, which spec) are listed in the issue. An implementation exists as n3-match-bgp (formerly rdfjs/N3.js#809).

🤖 Generated with Claude Code

https://claude.ai/code/session_016PTUEUKZE6DwmyBQbpLa9T

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016PTUEUKZE6DwmyBQbpLa9T
@changeset-bot

changeset-bot Bot commented Oct 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c8d5ade

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@rdfjs/types Minor

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

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