Page MenuHomePhabricator

Chart views sometimes combine multiple numeric results into one
Open, Needs TriagePublic

Description

Minimal reproducer:

#defaultView:LineChart
SELECT ?x ?y ?c WHERE {
  VALUES (?x ?y ?c) {
    (1 1 "")
    (2 2 "")
  }
}

This should show a line from (1,1) to (2,2); instead it shows a single dot at (3,3).

A more realistic example, by @Fnielsen:

#defaultView:LineChart
SELECT ?year (count(distinct ?citing_work) as ?count) ?author ?authorLabel  WHERE {
  VALUES ?author { wd:Q6758402 wd:Q20980928 }
  { 
    SELECT ?author (MIN(?work_year) AS ?first_year) WHERE {
      ?work wdt:P50 ?author .
      ?work wdt:P577 ?work_publication_datetime . 
      BIND(YEAR(?work_publication_datetime) AS ?work_year)
    }
    GROUP BY ?author
  }
  ?work wdt:P50 ?author .
  ?citing_work wdt:P2860 ?work .
  ?citing_work wdt:P577 ?date .
  BIND(YEAR(?date) - ?first_year AS ?year) 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} 
GROUP BY ?author ?year ?first_year ?authorLabel
ORDER BY (?year)

This should show more than just two points connected by a straight line.