Skip to content

Feature/14 fix rdfxml parserserializer to pass w3c test#249

Merged
abdessamad-abdoun merged 13 commits into
feature/corese-nextfrom
feature/14-fix-rdfxml-parserserializer-to-pass-w3c-test
Dec 11, 2025
Merged

Feature/14 fix rdfxml parserserializer to pass w3c test#249
abdessamad-abdoun merged 13 commits into
feature/corese-nextfrom
feature/14-fix-rdfxml-parserserializer-to-pass-w3c-test

Conversation

@abdessamad-abdoun
Copy link
Copy Markdown
Contributor

No description provided.

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

github-actions Bot commented Dec 8, 2025

Overall Project 50.14% -0.11% 🍏
Files changed 72.99% 🍏

File Coverage
RDFXMLParser.java 85.41% -12.51% 🍏
RDFXMLStatementEmitter.java 82.1% -17.9%
RDFXMLUtils.java 77.3% -20.08% 🍏
AbstractNTriplesNQuadsListener.java 76.68% -4.66% 🍏
PrefixHandler.java 65.88% -0.2% 🍏
IRIUtils.java 56.64% -0.75% 🍏
AbstractTurtleTriGListener.java 38.39% -1.22%

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 8, 2025

Test Results

983 tests  ±0   983 ✅ +2   39s ⏱️ -6s
 72 suites ±0     0 💤 ±0 
 72 files   ±0     0 ❌  - 2 

Results for commit 048be9a. ± Comparison against base commit 104ad42.

♻️ This comment has been updated with latest results.

@MaillPierre MaillPierre added the Refactoring Issue created during the 2025 refactoring effort label Dec 10, 2025
Copy link
Copy Markdown
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.

Overall the changes look good. I’ve left a few comments that should be addressed before merging, but nothing major. Once those are fixed, it will be ready to go.

ctx.predicateStack.pop();

if (RDFXMLUtils.isDescription(localName, uri) || RDFXMLUtils.isRdfNodeElementType(uri, localName)) {
if (!ctx.subjectStack.isEmpty()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Merge this if statement with the enclosing one

public class RDFXMLParser extends AbstractRDFParser {

/** RDF/XML format identifier for this parser. */
private final RDFFormat format = RDFFormat.RDFXML;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Make this final field static too

@@ -144,20 +161,34 @@ private void handleCharacters(char[] ch, int start, int length) {
characters.append(ch, start, length);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Move this method into "RdfXmlSaxHandler"

* and special parseType attributes, updating the parsing context accordingly.
*/
private void handleStartElement(String uri, String localName, String qName, Attributes attrs) {
private void handleStartElement(String uri, String localName, String qName, Attributes attrs)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Move this method into "RdfXmlSaxHandler"

}
return Optional.empty();

switch (localName) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add a default case to this switch

case "nodeID":
case "datatype":
case "aboutEach":
case "aboutEachPrefix":
Copy link
Copy Markdown
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

case "datatype":
case "Description":
case "aboutEach":
case "aboutEachPrefix":
Copy link
Copy Markdown
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

}

// According to RDF/XML spec section 5.1
switch (localName) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add a default case to this switch

switch (parseType) {
case "Resource":
case "Literal":
case "Collection":
Copy link
Copy Markdown
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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
case "Collection":
case "Resource", "Literal", "Collection":
return; // Valid

@remiceres remiceres self-requested a review December 10, 2025 14:55
@github-actions
Copy link
Copy Markdown

Overall Project 50.14% -0.11% 🍏
Files changed 76.41% 🍏

File Coverage
RDFXMLParser.java 85.73% -12.31% 🍏
RDFXMLStatementEmitter.java 82.1% -17.9%
RDFXMLUtils.java 78.78% -18.55% 🍏
AbstractNTriplesNQuadsListener.java 76.68% -4.66% 🍏
PrefixHandler.java 65.88% -0.2% 🍏
IRIUtils.java 56.64% -0.75% 🍏
AbstractTurtleTriGListener.java 38.39% -1.22%

@github-actions
Copy link
Copy Markdown

Overall Project 50.16% -0.11% 🍏
Files changed 81.07% 🍏

File Coverage
RDFXMLParser.java 86.09% -12.49% 🍏
RDFXMLStatementEmitter.java 82.1% -17.9%
RDFXMLUtils.java 78.78% -18.55% 🍏
AbstractNTriplesNQuadsListener.java 76.68% -4.66% 🍏
PrefixHandler.java 65.88% -0.2% 🍏
IRIUtils.java 56.64% -0.75% 🍏
AbstractTurtleTriGListener.java 38.39% -1.22%

@github-actions
Copy link
Copy Markdown

Overall Project 50.16% -0.11% 🍏
Files changed 81.07% 🍏

File Coverage
RDFXMLParser.java 86.09% -12.49% 🍏
RDFXMLStatementEmitter.java 82.1% -17.9%
RDFXMLUtils.java 78.78% -18.55% 🍏
AbstractNTriplesNQuadsListener.java 76.68% -4.66% 🍏
PrefixHandler.java 65.88% -0.2% 🍏
IRIUtils.java 56.64% -0.75% 🍏
AbstractTurtleTriGListener.java 38.39% -1.22%

throw new ParsingErrorException("rdf:nodeID value '" + nodeID + "' is not a valid NCName. " +
"NCNames cannot contain colons and must start with a letter or underscore.");
}
return factory.createBNode(ParserConstants.BLANK_NODE_PREFIX + nodeID);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Use static access with "fr.inria.corese.core.next.impl.io.common.IOConstants" for "BLANK_NODE_PREFIX".

switch (parseType) {
case "Resource":
case "Literal":
case "Collection":
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
case "Collection":
case "Resource", "Literal", "Collection":
return; // Valid

@abdessamad-abdoun abdessamad-abdoun merged commit 049913c into feature/corese-next Dec 11, 2025
1 check passed
@github-actions
Copy link
Copy Markdown

Overall Project 50.16% -0.11% 🍏
Files changed 81.07% 🍏

File Coverage
RDFXMLParser.java 86.09% -12.49% 🍏
RDFXMLStatementEmitter.java 82.1% -17.9%
RDFXMLUtils.java 78.78% -18.55% 🍏
AbstractNTriplesNQuadsListener.java 76.68% -4.66% 🍏
PrefixHandler.java 65.88% -0.2% 🍏
IRIUtils.java 56.64% -0.75% 🍏
AbstractTurtleTriGListener.java 38.39% -1.22%

@abdessamad-abdoun abdessamad-abdoun deleted the feature/14-fix-rdfxml-parserserializer-to-pass-w3c-test branch January 7, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactoring Issue created during the 2025 refactoring effort

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants