Skip to content

RDF1.2 and RDF Messages support, and well-tested spec compliance - #46

Merged
pietercolpaert merged 22 commits into
masterfrom
feat-rdf12
Jun 2, 2026
Merged

pietercolpaert merged 22 commits into
masterfrom
feat-rdf12

Conversation

@pietercolpaert

@pietercolpaert pietercolpaert commented Jun 2, 2026 •

Copy link
Copy Markdown
Owner

Working on a PR that:

…ction

- Modified getLiteralDirection() regex to allow language tags like @en without mandatory direction
- Changed regex from '/^".*"(?:@[^@"]+--(ltr|rtl)|\^\^[^"]+)?$/is' to '/^".*"(?:@[^@"]+(?:--(ltr|rtl))?|\^\^[^"]+)?$/is'
- This allows language-tagged literals without base direction to parse correctly
- Fixes 5 RDF 1.1 N-Triples test failures:
  - nt-syntax-string-02 (language tag @en)
  - nt-syntax-string-03 (language tag @en-uk)
  - lantag_with_subtag (language tag @en-UK)
  - comment_following_triple (comments after triples)
  - nt-syntax-subm-01 (comprehensive submission test)
…ndling

- Implements parseNegative() method alongside parse() for proper negative test support
- parseNegative() expects the parser to reject invalid input (non-zero exit code)
- Allows rdf-test-suite to explicitly handle positive vs negative tests
- Changed greedy [^@"]+ to non-greedy [^@"]+? to prevent consuming the direction part
- Now correctly captures RTL/LTR from patterns like @en--rtl without consuming it in the language tag
- Fixes testUtilUnderstandsDirectionalLanguageLiterals unit test
@pietercolpaert

Copy link
Copy Markdown
Owner Author

@k00ni This is ready - do you want to take a look?

I’d like to release this as 0.6.0: it’s backwards compatible and adds RDF1.2 support, fixes long-standing regex problems with unicode, and now proves it’s spec compliant

* First implementation and tests

* First RDFM support

* Fix messages tests

* Added tests cfr spec

* Proofreadinf README.md

* README.md tweaks
@pietercolpaert pietercolpaert changed the title RDF1.2 support and spec compliance RDF1.2 and RDF Messages support, and well-tested spec compliance Jun 2, 2026
@pietercolpaert

Copy link
Copy Markdown
Owner Author

I’ll just release this so that it can be used: it fixes serious problems, proves spec compliance, is backwards compatible, and adds support for RDF1.2 and messages.

@pietercolpaert
pietercolpaert merged commit 68c11ca into master Jun 2, 2026
11 checks passed
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.

Add support for RDF Messages Add RDF1.2 support Limitations and usage Test spec compliance

1 participant