Commit 1617126
committed
Fix SPARQLResultsTSVWriter to quote xsd:string literals
Related to #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).1 parent c931f34 commit 1617126
2 files changed
Lines changed: 23 additions & 11 deletions
File tree
- core/queryresultio/text/src
- main/java/org/eclipse/rdf4j/query/resultio/text/tsv
- test/java/org/eclipse/rdf4j/query/resultio/text/tsv
Lines changed: 5 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | 197 | | |
209 | 198 | | |
210 | 199 | | |
211 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
212 | 206 | | |
213 | 207 | | |
214 | 208 | | |
| |||
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
72 | 90 | | |
73 | 91 | | |
74 | 92 | | |
| |||
0 commit comments