-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPARQLResultsTSVWriter writes naked/unquoted xsd:strings #5256
Comments
Related to eclipse-rdf4j#5256 Update `SPARQLResultsTSVWriter` to ensure all `xsd:string` literals are quoted in SPARQL TSV results. * Modify `writeLiteral` method to always quote `xsd:string` literals. * Remove conditions that allowed `xsd:string` literals to be written without quotes. * Ensure special characters in `xsd:string` literals are properly escaped using `encodeString` method. * Update tests in `SPARQLTSVCustomTest` to verify correct quoting of `xsd:string` literals and proper escaping of special characters. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/eclipse-rdf4j/rdf4j/issues/5256?shareId=XXXX-XXXX-XXXX-XXXX).
Related to eclipse-rdf4j#5256 Update `SPARQLResultsTSVWriter` to ensure all `xsd:string` literals are quoted in SPARQL TSV results. * Modify `writeLiteral` method to always quote `xsd:string` literals. * Remove conditions that allowed `xsd:string` literals to be written without quotes. * Ensure special characters in `xsd:string` literals are properly escaped using `encodeString` method. * Update tests in `SPARQLTSVCustomTest` to verify correct quoting of `xsd:string` literals and proper escaping of special characters. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/eclipse-rdf4j/rdf4j/issues/5256?shareId=XXXX-XXXX-XXXX-XXXX).
Can you test out #5262 to see if it fixes your issue? |
Thanks for your work on this. Is there a downloadable binary I can test, please? I'm running the SPARQL server, from the downloadable binary distribution — I'm not running it from source, and I don't have any kind of Java build process setup on my system, sorry! |
I can try to create one for you. Is it the big jar file or is it the war file? |
I use both I would imagine that I only need an updated copy of that first one though, the server itself. |
Current Behavior
Literals of type xsd:string often get written out in SPARQL TSV results without quotes.
This is because of this section of code:
rdf4j/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/text/tsv/SPARQLResultsTSVWriter.java
Line 204 in cd6509b
Expected Behavior
The spec for SPARQL Results TSV says:
So, according to this last sentence — plus the reference to Turtle just previous — in TSV SPARQL results, one would expect all xsd:string literals to be quoted, in all circumstances — and not just when they don't pass the conditions in line 204
Steps To Reproduce
From the workbench, execute a SPARQL insert like this:
Then execute a query like this:
Then download the results as SPARQL/TSV, and view in a text editor, to see:
...the
o3
there should be"o3"
.Version
5.1.0
Are you interested in contributing a solution yourself?
None
Anything else?
No response
The text was updated successfully, but these errors were encountered: