Skip to content

RDF4J: implement a full checking parser#546

Merged
Ostrzyciel merged 1 commit intomainfrom
piotr/add-rdf4j-basic-parser-options
Sep 27, 2025
Merged

RDF4J: implement a full checking parser#546
Ostrzyciel merged 1 commit intomainfrom
piotr/add-rdf4j-basic-parser-options

Conversation

@Ostrzyciel
Copy link
Member

While implementing eclipse-rdf4j/rdf4j#5449 I noticed that the Jelly parser ignores various optional checks that you can add to every RDF4J parser, such as SKOLEMIZE_ORIGIN or VERIFY_DATATYPE_VALUES. This is because we use decoder converters, which can work outside an RDF4J parser, and therefore use a value factory directly, without any extra checks. To run these checks, you have to use the protected create* methods in AbstractRDFParser instead.

So, to solve this I wrote a second decoder converter that is internal to the RDF4J parser, where it uses these create* methods as RDF4J intended. This can be still turned off by passing a different decoder converter, or by setting the CHECKING option to false.

Note that this is a default behavior change, as JellyParserFactory.getParser() will now return a checking parser, instead of a non-checking one. But I don't think that violates any specific contract... the extra checks are disabled by default anyway.

@codecov
Copy link

codecov bot commented Sep 27, 2025

Codecov Report

❌ Patch coverage is 74.54545% with 14 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...jelly/convert/rdf4j/BaseRdf4jDecoderConverter.java 37.50% 10 Missing ⚠️
...everblink/jelly/convert/rdf4j/rio/JellyParser.java 88.23% 4 Missing ⚠️
Files with missing lines Coverage Δ Complexity Δ
...ink/jelly/convert/rdf4j/Rdf4jDecoderConverter.java 80.00% <100.00%> (+24.82%) 0.00 <0.00> (ø)
...nk/jelly/convert/rdf4j/rio/JellyParserFactory.java 75.00% <100.00%> (ø) 0.00 <0.00> (ø)
...k/jelly/convert/rdf4j/rio/JellyParserSettings.java 63.63% <100.00%> (+3.63%) 0.00 <0.00> (ø)
...everblink/jelly/convert/rdf4j/rio/JellyParser.java 85.13% <88.23%> (+17.74%) 0.00 <0.00> (ø)
...jelly/convert/rdf4j/BaseRdf4jDecoderConverter.java 37.50% <37.50%> (ø) 0.00 <0.00> (?)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@Karolina-Bogacka Karolina-Bogacka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and the tests seem sufficient to me

@Ostrzyciel Ostrzyciel merged commit d2bb381 into main Sep 27, 2025
11 of 12 checks passed
@Ostrzyciel Ostrzyciel deleted the piotr/add-rdf4j-basic-parser-options branch September 27, 2025 12:47
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