Skip to content

Conversation

@abdessamad-abdoun
Copy link
Contributor

No description provided.

@abdessamad-abdoun abdessamad-abdoun added this to the V5.0.0b milestone Nov 3, 2025
@abdessamad-abdoun abdessamad-abdoun self-assigned this Nov 3, 2025
@github-actions
Copy link

github-actions bot commented Nov 3, 2025

Test Results

957 tests  ±0   957 ✅ ±0   35s ⏱️ -1s
 71 suites ±0     0 💤 ±0 
 71 files   ±0     0 ❌ ±0 

Results for commit 174e581. ± Comparison against base commit ee566fc.

♻️ This comment has been updated with latest results.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove the standard format checking here ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe incorporate all your work into validateIRI into / replacing isStandardIRI ?

throw new ParsingErrorException("Undeclared prefix: " + prefix);
}

return resolveIRIAgainstBase(raw);
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: Put back the return in inline form here

public String extractAndUnescapeIRI(String text) {
String iri = text.substring(1, text.length() - 1);
return unescapeIRI(iri);
iri = unescapeIRI(iri);
Copy link
Contributor

Choose a reason for hiding this comment

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

Document the fact that validateIRI will make this function throw an exception

* @param c the character to validate
* @return true if the character is forbidden in IRIs
*/
private boolean isInvalidIRICharacter(char c) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be put in the IRIUtils class

* @param iri the IRI string to validate (after escape sequences have been processed)
* @throws ParsingErrorException if the IRI contains forbidden characters
*/
private void validateIRI(String iri) throws ParsingErrorException {
Copy link
Contributor

Choose a reason for hiding this comment

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

Make a boolean returning version or make it replace isStandardURI ?


assertNotNull(this.valueFactory.createIRI(correctIRI));
assertThrows(IncorrectFormatException.class, () -> this.valueFactory.createIRI(incorrectIRI));
// assertThrows(IncorrectFormatException.class, () -> this.valueFactory.createIRI(incorrectIRI));
Copy link
Contributor

Choose a reason for hiding this comment

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

Delete, do not comment

assertEquals("test", coreseIRI2.getLocalName());
}

@Test
Copy link
Contributor

Choose a reason for hiding this comment

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

There should still be a test for an incorrect IRI given to the constructor

@abdessamad-abdoun abdessamad-abdoun force-pushed the feature/212_Canonical_RDF branch from 6d39da7 to 951c346 Compare November 12, 2025 09:10
@github-actions
Copy link

Overall Project 49.8% -0.16% 🍏
Files changed 50.3%

File Coverage
RDFC10Canonicalizer.java 79.96% -3.9% 🍏
IRIUtils.java 60.67% -31.93%
TriGParser.java 51.1% 🍏
TurtleParser.java 44.13% 🍏
AbstractTurtleTriGListener.java 41.09% -4.13%
StatementUtils.java 40.14% -50.79%

@abdessamad-abdoun abdessamad-abdoun force-pushed the feature/212_Canonical_RDF branch from 951c346 to b4179c1 Compare November 17, 2025 10:45
@github-actions
Copy link

Overall Project 49.92% -0.16% 🍏
Files changed 50.3%

File Coverage
RDFC10Canonicalizer.java 79.96% -3.9% 🍏
IRIUtils.java 60.67% -31.93%
TriGParser.java 51.1% 🍏
TurtleParser.java 44.13% 🍏
AbstractTurtleTriGListener.java 41.09% -4.13%
StatementUtils.java 40.14% -50.79%

@abdessamad-abdoun abdessamad-abdoun force-pushed the feature/212_Canonical_RDF branch from b4179c1 to 61f9211 Compare November 18, 2025 08:20
@github-actions
Copy link

Overall Project 49.92% -0.16% 🍏
Files changed 50.3%

File Coverage
RDFC10Canonicalizer.java 79.96% -3.9% 🍏
IRIUtils.java 60.67% -31.93%
TriGParser.java 51.1% 🍏
TurtleParser.java 44.13% 🍏
AbstractTurtleTriGListener.java 41.09% -4.13%
StatementUtils.java 40.14% -50.79%

@MaillPierre MaillPierre force-pushed the feature/212_Canonical_RDF branch from 61f9211 to c6a90ca Compare November 19, 2025 10:08
@github-actions
Copy link

Overall Project 49.92% -0.26% 🍏
Files changed 53.03%

File Coverage
XSD.java 100% 🍏
RDFSerializer.java 100% 🍏
TriGSerializerOptions.java 100% 🍏
RDF.java 98.9% -1.1% 🍏
RDFS.java 96.4% -1.44% 🍏
RDFXMLSerializerOption.java 95.47% 🍏
RDFC10SerializerOptions.java 95.45% 🍏
OWL.java 94.85% -2.06% 🍏
TurtleSerializerOptions.java 93.85% 🍏
SerializerFactory.java 89.06% -4.69% 🍏
RDFXMLUtils.java 84.64% -2.51%
AbstractIRI.java 84.55% 🍏
JSONLDSerializer.java 84.38% -3.13% 🍏
JSONLDParser.java 82.33% -2.41% 🍏
RDFXMLSerializer.java 81.86% -1.36% 🍏
JSONLDOptions.java 80.37% 🍏
RDFC10Canonicalizer.java 79.96% -3.9% 🍏
RDFC10Serializer.java 79.66% 🍏
AbstractLineBasedSerializer.java 75.08% -12.04%
SerializationException.java 74.68% 🍏
NQuadsSerializer.java 71.43% 🍏
NTriplesSerializer.java 68.57% 🍏
TriGSerializer.java 63.54% 🍏
AbstractGraphSerializer.java 61.14% -6.8%
IRIUtils.java 60.67% -31.93%
TriGListerner.java 56.54% 🍏
TurtleSerializer.java 54.88% 🍏
TitaniumRDFDatasetSerializationAdapter.java 53.62% -1.28%
TriGParser.java 51.1% 🍏
IOConstants.java 46.67% -53.33%
TurtleParser.java 44.13% 🍏
AbstractTurtleTriGListener.java 41.09% -4.59%
StatementUtils.java 39.95% -51.02%
FOAF.java 25.93% -74.07%
Vocabulary.java 0%
ParserConstants.java 0% 🍏

@abdessamad-abdoun abdessamad-abdoun force-pushed the feature/212_Canonical_RDF branch from c6a90ca to 910f540 Compare November 20, 2025 09:50
@github-actions
Copy link

Overall Project 50.03% -0.16% 🍏
Files changed 50.2%

File Coverage
RDFC10Canonicalizer.java 79.96% -3.9% 🍏
IRIUtils.java 60.67% -31.93%
TriGParser.java 51.1% 🍏
TurtleParser.java 44.13% 🍏
AbstractTurtleTriGListener.java 41.09% -4.13%
StatementUtils.java 39.95% -51.02%

Copy link
Contributor

@remiceres remiceres 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 to me, thanks for the work! I left a few comments, mostly based on SonarQube findings.

Matcher matcher = matchWithTimeout(IRI_PATTERN, iri);
if (matcher == null || !matcher.matches()) {
return "";
return iri.endsWith("#") ? iri : (iri.contains("#") ? iri.substring(0, iri.lastIndexOf("#") + 1) : iri);
Copy link
Contributor

Choose a reason for hiding this comment

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

Extract this nested ternary operation into an independent statement

* @return A canonical N-Quad string with placeholder substitution.
*/
public static String quadToNQuad(Statement quad, String blankNodeToReplace, String replacement) {
StringBuilder sb = new StringBuilder();
Copy link
Contributor

Choose a reason for hiding this comment

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

Convert comments in english

.toList();

return replaced.stream()
List<Statement> sorted = replaced.stream()
Copy link
Contributor

Choose a reason for hiding this comment

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

Immediately return this expression instead of assigning it to the temporary variable "sorted".

String iri = text.substring(1, text.length() - 1);
return unescapeIRI(iri);
iri = unescapeIRI(iri);
return validateIRI(iri) ? iri : iri;
Copy link
Contributor

Choose a reason for hiding this comment

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

This conditional operation returns the same value whether the condition is "true" or "false"

}

return resolveIRIAgainstBase(raw);
String result = resolveIRIAgainstBase(raw);
Copy link
Contributor

Choose a reason for hiding this comment

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

Immediately return this expression instead of assigning it to the temporary variable "result".

case '^': // U+005E - circumflex
case '`': // U+0060 - grave accent
case '|': // U+007C - pipe
case '"': // U+0022 - quotation mark
Copy link
Contributor

Choose a reason for hiding this comment

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

Merge the previous cases into this one using comma-separated label

https://next.sonarqube.com/sonarqube/coding_rules?open=java%3AS6208&rule_key=java%3AS6208

@github-actions
Copy link

Overall Project 50.05% -0.13% 🍏
Files changed 56.27%

File Coverage
RDFC10Canonicalizer.java 79.91% -3.91% 🍏
IRIUtils.java 60.07% -32.36%
StatementUtils.java 52.68% -35.42%
TriGParser.java 51.1% 🍏
TurtleParser.java 44.13% 🍏
AbstractTurtleTriGListener.java 40.96% -4.56%

@MaillPierre MaillPierre force-pushed the feature/212_Canonical_RDF branch from eba2902 to 174e581 Compare November 24, 2025 13:38
@github-actions
Copy link

Overall Project 50.09% -0.13% 🍏
Files changed 52.61%

File Coverage
RDFC10Canonicalizer.java 79.91% -3.91% 🍏
RDFaParser.java 67.81% 🍏
IRIUtils.java 55.03% -36.69%
StatementUtils.java 52.68% -35.42%
TriGParser.java 51.1% 🍏
TurtleParser.java 44.13% 🍏
AbstractTurtleTriGListener.java 40.96% -4.56%

@MaillPierre MaillPierre merged commit f5a22e3 into feature/corese-next Nov 24, 2025
2 checks passed
@MaillPierre MaillPierre deleted the feature/212_Canonical_RDF branch November 24, 2025 13:42
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.

4 participants