feat: add SingularNullable getter arity and singular error handling#18
Draft
feat: add SingularNullable getter arity and singular error handling#18
Conversation
- Add SingularNullable variant to GetterArity enum - Update getter decorator to handle SingularNullable case - Add error handling to singular() method that throws when no value found - Use iterator approach to avoid materializing all matching quads - Add tests for all new functionality Co-authored-by: jeswr <63333554+jeswr@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement more arities for selecting terms
feat: add SingularNullable getter arity and singular error handling
Feb 12, 2026
langsamu
requested changes
Feb 12, 2026
Collaborator
langsamu
left a comment
There was a problem hiding this comment.
The parts related to new branch on decorator are fine.
Others are unrelated and should be removed.
Collaborator
There was a problem hiding this comment.
Changes here are unrelated and should be removed.
NB covered by #13.
Collaborator
There was a problem hiding this comment.
Collaborator
|
This change does not fix #8, which is a stub issue for the much broader, generic concern of adding many more 'arities' (a misnomer while we come up with better terminology). |
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.
Adds more arities for selecting terms beyond
Singular, and adds proper error handling tosingular()per the approach in #13.Changes
GetterArity.SingularNullable— new enum variant enabling nullable term selection via decorators, complementing the existingsingularNullable()method onTermWrappergetterdecorator — routesSingularNullabletothis.singularNullable()singular()error handling — throws descriptive error when no matching quad exists instead of crashing onundefined. Uses iterator to avoid materializing all matching quads (relevant for lazy datasets like N3.js)Usage
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.