Page MenuHomePhabricator

[Bug] WDQS scatterplot behaves strangely when third column is a COUNT()
Open, LowPublic


If I write a query with columns X, Y, COUNT(), the WDQS scatterplot display mode appears to utterly garble these values.

Event Timeline

Jheald created this task.Mar 13 2017, 10:01 AM
Restricted Application added a project: Discovery. · View Herald TranscriptMar 13 2017, 10:01 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Example query (view in query editor):

SELECT  ?int_lon ?int_lat (COUNT(?item) AS ?count)   WHERE {
        ?item wdt:P3616 [].

        ?item p:P625/psv:P625 ?coords .
        ?coords wikibase:geoLatitude ?lat .
        ?coords wikibase:geoLongitude ?long .

        BIND(floor(?lat) AS ?int_lat) .
        BIND(floor(?long) AS ?int_lon) .
        FILTER(?int_lon < 5)

      } GROUP BY ?int_lat ?int_lon
    ORDER BY DESC (?count)

Switching to scatterplot display, the points plotted bear little relation to the values that were in the columns.

Mousing over the points, one gets triples like:

`int_lon: -5,  int_lon: -45, int lat: 267`  (plotted at -45, 267)

The first value of the triple may be correct, but is being ignored. Goodness knows where the second value is coming from. And -- while of similar size to some of the counts -- comparison shows that the third value does not match any of the counts in the third column.

Indeed, I still get the same behaviour even if I dispense with the third column entirely, and SELECT just the first two (query) -- so the issue may not involve the counts at all.

Jheald added a comment.EditedMar 13 2017, 10:40 AM

As an aside, what I really wanted to do was to plot the values on a map.

But there seems to be no way to cast variables to a geo:wktLiteral.

I've written this up as a separate ticket: T160335

This comment was removed by Jheald.
Lydia_Pintscher triaged this task as Low priority.Mar 23 2017, 2:16 PM
Lydia_Pintscher moved this task from incoming to ready to go on the Wikidata board.