zazuko / query-rdf-data-cube

Explore or query RDF Data Cubes with a JavaScript API, without writing SPARQL.
https://zazuko.github.io/query-rdf-data-cube/
9 stars 2 forks source link

qb:dataSet is missing from sparql #1

Closed ktk closed 5 years ago

ktk commented 5 years ago

qb:dataSet is not added in the generated SPARQL query that fetches the observations. As a result one gets way too many results back in case there are other DataSets with the same dimensions.

vhf commented 5 years ago

I would need a before/after to fix it.

ktk commented 5 years ago

Right, we have:

SELECT ?raum ?zeit ?bew FROM <https://linked.opendata.swiss/graph/zh/statistics>
WHERE {
  ?observation <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.org/linked-data/cube#Observation>.
  ?observation <https://ld.stadt-zuerich.ch/statistics/property/RAUM> ?raum.
  ?observation <https://ld.stadt-zuerich.ch/statistics/property/ZEIT> ?zeit.
  ?observation <https://ld.stadt-zuerich.ch/statistics/measure/BEW> ?bew.
  FILTER(?raum = <https://ld.stadt-zuerich.ch/statistics/code/R30000>)
}

and I expect:

PREFIX qb: <http://purl.org/linked-data/cube#>
SELECT ?raum ?zeit ?bew FROM <https://linked.opendata.swiss/graph/zh/statistics>
WHERE {
  ?observation <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.org/linked-data/cube#Observation>.
  ?observation <https://ld.stadt-zuerich.ch/statistics/property/RAUM> ?raum.
  ?observation <https://ld.stadt-zuerich.ch/statistics/property/ZEIT> ?zeit.
  ?observation <https://ld.stadt-zuerich.ch/statistics/measure/BEW> ?bew;
  qb:dataSet <https://ld.stadt-zuerich.ch/statistics/dataset/BEW-RAUM-ZEIT>. 
  FILTER(?raum = <https://ld.stadt-zuerich.ch/statistics/code/R30000>)
} 

Search for hardcode in the document I wrote.

vhf commented 5 years ago

Fixed in e53d801