Skip to content

Wrong Local Authority values or labels when using sorted map data in Standalone Chart Builder #175

@charlesons

Description

@charlesons

Using the following SPARQL query in the standalone chart builder gives incorrect values or labels on the output map. The same issue does not seem to occur in the Volto integrated version of Chart Builder.

PREFIX qb: <http://purl.org/linked-data/cube#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX geo: <http://statistics.data.gov.uk/def/statistical-geography#>
PREFIX data: <http://gss-data.org.uk/data/gss_data/climate-change/beis-2005-to-2019-local-authority-carbon-dioxide-co2-emissions#>
PREFIX dim: <http://gss-data.org.uk/data/gss_data/climate-change/beis-2005-to-2019-local-authority-carbon-dioxide-co2-emissions#dimension/>
PREFIX meas: <http://gss-data.org.uk/def/climate-change/measure/>

SELECT ?geography_uri ?label  (ROUND((SUM(xsd:float(?val)) * 100) / 100) AS ?values)
WHERE {
  ?obs qb:dataSet data:dataset ;
       dim:year <http://reference.data.gov.uk/id/year/2019> ;
       dim:local-authority-code ?geography_uri ;
       meas:territorial-emissions ?val .

       FILTER(?geography_uri != <http://statistics.data.gov.uk/id/statistical-geography/N92000002>)

    OPTIONAL { ?geography_uri geo:officialname ?label }
}
GROUP BY ?geography_uri ?label
ORDER BY ASC(?geography_uri)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions