Implement SPARQL 1.2 grammar support#1
Open
rybesh wants to merge 2 commits into
Open
Conversation
Add support for SPARQL 1.2 features including:
- Triple terms: <<( :s :p :o )>>
- Reified triples: << :s :p :o >>
- Annotations: {| :prop :value |}
- VERSION declaration
- Language direction: @en--ltr
- New built-in functions: TRIPLE, SUBJECT, PREDICATE, OBJECT, ISTRIPLE,
LANGDIR, HASLANG, HASLANGDIR, STRLANGDIR
- Codepoint escapes in strings
All 212 W3C SPARQL 1.2 tests pass.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add test runners for SPARQL 1.0 and 1.1 W3C test suites
- Create shared test runner module to reduce code duplication
- Fix grammar to support keywords with digits (MD5, SHA1, etc.)
- Add property path quantifiers {n}, {n,}, {n,m}, {,m}
- Add unicode escape support (\u, \U) in IRIs
All three test suites now pass with 0 failures:
- SPARQL 1.0: 464 passed
- SPARQL 1.1: 551 passed
- SPARQL 1.2: 214 passed
Co-Authored-By: Claude Opus 4.5 <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
Test plan
npm test- 7 unit tests passnpm run test:w3c- 212 W3C SPARQL 1.2 tests passnpm run build🤖 Generated with Claude Code