-
Notifications
You must be signed in to change notification settings - Fork 172
Description
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:
Line 204 in cd6509b
} else if (!label.isEmpty() && encoded.equals(label) && label.charAt(0) != '<' && label.charAt(0) != '_' |
Expected Behavior
The spec for SPARQL Results TSV says:
4.2 Serializing RDF Terms
The SPARQL Results TSV Results Format serializes RDF terms in the results table by using the syntax that SPARQL [SPARQL11-QUERY] and Turtle [TURTLE] use.
IRIs enclosed in <...>, literals are enclosed with double quotes "..." or single quotes ' ...' with optional @lang or ^^ for datatype. The quotes around the lexical form is required.
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:
INSERT DATA
{
GRAPH <http://example/g> {
<http://example/s1> <http://example/p1> "o3" .
}
}
Then execute a query like this:
select ?o { ?s ?p ?o }
Then download the results as SPARQL/TSV, and view in a text editor, to see:
?o
o3
...the o3
there should be "o3"
.
Version
5.1.0
Are you interested in contributing a solution yourself?
None
Anything else?
No response