Skip to content

Conversation

SarahGrand
Copy link

@SarahGrand SarahGrand commented Jul 30, 2025

#GH5327

Briefly describe the changes proposed in this PR:

Added RDF 1.2 testsuite files for Turtle, TriG, NTriples, NQuads.

Refactored test suite code to run RDF 1.2 and 1.1 test suites.

RDF 1.2 tests are commented out to pass integration tests, but should be uncommented once RDF 1.2 is merged in.

Includes small changes in NTriplesUtil and TurtleUtil to throw error for numeric escape strings that were not being rejected as defined in the Turtle 1.1 spec and were causing RDF 1.1 test failures.


PR Author Checklist (see the contributor guidelines for more details):

  • my pull request is self-contained
  • I've added tests for the changes I made
  • I've applied code formatting (you can use mvn process-resources to format from the command line)
  • I've squashed my commits where necessary
  • every commit message starts with the issue number (GH-xxxx) followed by a meaningful description of the change

@SarahGrand SarahGrand changed the title GH-5327 RDF test data files, refactoring of test suite code to include RDF 1.2 tests GH-5327 Added RDF test data files, refactoring of test suite code to include RDF 1.2 tests Jul 30, 2025
@hmottestad
Copy link
Contributor

You're hitting our backwards compatibility checks. If you can rewrite this so that we don't need to break backwards compatibility then that would really be the best. I can't say for sure how many projects depend on these specific tests, but I know that when we've previously made breaking changes to our test suite code then I've ended up helping out to update other people's code.

If this change is essential then we can start by deprecating the current methods/classes so that we warn our users before this change goes live in the next major release.

@SarahGrand SarahGrand force-pushed the GH-5327-RDF-test-suites branch from abc3434 to d952063 Compare August 13, 2025 18:33
@SarahGrand
Copy link
Author

SarahGrand commented Aug 13, 2025

@hmottestad In the existing test code, the files TurtleParserTestCase, TriGParserTestCase, AbstractNTriplesParserTest, and AbstractNQuadsParserTest all have variations on almost identical code copied across the four files. I refactored the code to remove these four files and put the identical functionality into AbstractParserTestSuite.

The backwards compatibility tests are failing because of the removal of these four classes, and dropping/renaming of methods from those files which I converted to general methods in the abstract class (e.g., switching from createTurtleParser() and createNTriplesParser() to abstract createRDFParser() and createRDFBaseParser()).

Would it still be preferable to go back to four separate base classes with repetitive functionality? The reason I refactored things in the first place was that the existing functionality was hard to extend to incorporate the RDF 1.2 test suites.

I’m not sure exactly how people might be using the existing code, but it shouldn’t be too different to base code on the new AbstractParserTestSuite rather than on the existing implementations per serialization format. Let me know what you think.

@SarahGrand SarahGrand force-pushed the GH-5327-RDF-test-suites branch from 24a4433 to d952063 Compare August 14, 2025 14:21
…NTriples, NQuads, and refactored testsuite code to run RDF 1.2 and 1.1 test suites
@SarahGrand SarahGrand force-pushed the GH-5327-RDF-test-suites branch from 9aa87af to 4e4f208 Compare August 14, 2025 21:06
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