OpenGovIntelligence / json-qb

A JSON API for accessing data in RDF Data Cube format
Other
5 stars 1 forks source link

Explicitly specifying all dimensions #2

Open RickMoynihan opened 7 years ago

RickMoynihan commented 7 years ago

Below text written by Guy:

One of the things i learned implementing the existing cube dive would definitely be that for slices it is both useful and sensible to be able to constrain dimension values not just to a single value, but potentially to be able to express (at least) multiple values -

ie implicitly the spec as written permits two values for a dimension parameter:

can i suggest that it might be better to require that ALL dimensions are fully specified rather than the wildcard behaviour? (what the right behaviours should be in the case of missing dimensions is not so obvious - perhaps safest to generate an error)

so what im suggesting is that it would be very useful to allow multiple values - so a request might be for

http://statistics.gov.scot/def/dimension/outcome => killed // ie require observations to have this unique value for inclusion in slice http://statistics.gov.scot/def/dimension/gender => * // ie observations can take any value for inclusion in slice http://statistics.gov.scot/def/dimension/age => [0-19, 20-39] // ie select observations with any of several specified values for inclusion in slice

and optionally

http://purl.org/linked-data/sdmx/2009/dimension#refPeriod => ![1997] // ie exclude observations with any of specified values from inclusion in slice http://purl.org/linked-data/sdmx/2009/dimension#refArea => (http://statistics.data.gov.uk/def/statistical-entity#code => http://statistics.gov.scot/id/statistical-entity/S92) // ie constrain by a value not of the observation, but a property of the observation

The latter would allow eg filtering by geography type... though i concede it adds a lot of complexity.

Talking of which, it might also be nice to do eg ranges [1997..2001] and patterns [^[ab]] etc... ok maybe getting science fictional now, but my bigger point is that

I'll leave you all alone now. Sorry! :-)

zeginis commented 7 years ago

I agree with Rick, this functionality will be very useful. Actually it will enable to define "dices" instead of "slices".

In my opinion the wildcard could be left out. We need to specify only restrictions to the dimension values.