Page MenuHomePhabricator

SPARQL query result contains unexpected invisible unicode character FEFF
Open, MediumPublicBUG REPORT

Description

List of steps to reproduce:

What happens?:

Observe the unexpected character FEFF between " and Entity:
[{"wl":"<feff>Entity[\"Mountain\", \"1839MetreSummit::wqr44\"]"}]

What should have happened instead?:
There should be no character between " and Entity.

Observation:
When inspecting the JSON file of the affected item (http://www.wikidata.org/entity/Q4554510.json) then the invisible character is not there.

Event Timeline

Looks like the U+FEFF (ZERO WIDTH NO-BREAK SPACE) is in the RDF data as well (i.e. this isn’t a bug in the UI’s JSON download):

$ curl -s -H 'Accept: application/json' -d 'query=select * where { wd:Q4554510 wdt:P4839 ?wl }' https://query.wikidata.org/sparql | jq -r .results.bindings[0].wl.value | hexdump -C
00000000  ef bb bf 45 6e 74 69 74  79 5b 22 4d 6f 75 6e 74  |...Entity["Mount|
00000010  61 69 6e 22 2c 20 22 31  38 33 39 4d 65 74 72 65  |ain", "1839Metre|
00000020  53 75 6d 6d 69 74 3a 3a  77 71 72 34 34 22 5d 0a  |Summit::wqr44"].|
00000030
Lydia_Pintscher subscribed.

Thanks, Lucas! Then I'm declining this here in favor of someone cleaning up the underlying data.

@Lydia_Pintscher: I tried to edit the value in the user interface, but had no success. Whenever adding the current value the invisible character re-appears; it does not appear when entering some other test value.

No, the data is correct in Wikidata, only broken in the query service.

Ahhhh ok. Sorry. I misunderstood you then, Lucas.

Gehel triaged this task as Medium priority.Jun 27 2022, 3:35 PM
Gehel moved this task from Incoming to Blazegraph on the Wikidata-Query-Service board.