Skip to content

Align xml-canon to previous behavior#325

Open
afs wants to merge 1 commit intomainfrom
afs/rdf11-xml
Open

Align xml-canon to previous behavior#325
afs wants to merge 1 commit intomainfrom
afs/rdf11-xml

Conversation

@afs
Copy link
Copy Markdown
Contributor

@afs afs commented Apr 20, 2026

The original test in rdf11/rdf-xml/xml-canon/test001.rdf
for rdf:XMLLiteral changed and it seems to have changed RDF/XML behaviour.

https://github.com/w3c/rdf-tests/blob/main/rdf/rdf11/rdf-xml/xml-canon/
#177 (added test002)
#206 (changes test001.nt)

The RDF 1.1 tests are included in the RDF 1.2 tst manifest so an implementation that passed at RDF 1.1 will not pass when they try RDF 1.2.

There is wider issue: w3c/rdf-xml#97
This PR is only for reverting rdf11/rdf/xml-canon behavior.

@rubensworks
Copy link
Copy Markdown
Member

I'm the one who was responsible for the xml-canon-test001 change: #206
However, this was done purely based on my understanding of the 1.1 spec (so not 1.2-related), and comparing the output with @gkellogg's implementation.
My interpretation could have been wrong though.

@afs
Copy link
Copy Markdown
Contributor Author

afs commented Apr 20, 2026

Did you have to change your implementation to get that result?

I came across this while catching up on various changes and assumed Jena was wrong but trying converter.zazuko and Sophia, I also get "<br></br>". I hunted around for an original test001.nt (RDF 1.0 generation) and it does not have unused namespaces.

w3c/rdf-xml#97 is the result of trying to determine the right answer ... which I didn't manage from the RDF 1.1 XML text.

@Tpt
Copy link
Copy Markdown
Contributor

Tpt commented Apr 20, 2026

trying converter.zazuko and Sophia, I also get "

"

Sophia last release is using an old version of my RDF/XML parser that was not including any namespaces when parsing rdf:parseType="Literal" literals. After #206 I changed it to always include all namespaces.

@rubensworks
Copy link
Copy Markdown
Member

Did you have to change your implementation to get that result?

Yes, I did: rdfjs/rdfxml-streaming-parser.js@98d6ab5
I usually document the reasoning behind changes quite well, but apparently not this time, so I don't remember the precise reason for this change...
I suspect I ran into some inconsistencies across the different spec tests (possibly the other canon test), but I'm not sure atm.
I'll need to do some deeper analysis on why the change was done.

but trying converter.zazuko and Sophia

zazuko's tool also uses my parser internally, but probably still using the older version.

@afs
Copy link
Copy Markdown
Contributor Author

afs commented Apr 21, 2026

RDF 1.1/ RDF 1.2 possibly introduced a change from RDF 1.0.

1.1/1.2 say "uses fn:serialize", but that has a one-argument and a two-argument form. The second argument being a number of parameters to the serialization process. The one argument form is "no parameters" and I think "no settting" leads to no specific default.

One such parameter is undeclare-prefixes, values "yes" or "no". The default if unset seems to be "undefined" from ...

Additional namespace nodes MAY be present in the reconstructed tree if the serialization process did not undeclare one or more namespaces, as described in 5.1.8 XML Output Method: the undeclare-prefixes Parameter, ...

The default for indent/whitespace is also "MAY".

I haven't found a connection between Canonical XML and XSLT and XQuery Serialization.

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