Simon Krughoff wanted your opinion on the behavior of the SQuaSH API when querying for specs:
On a query like this
http://squash-restful-api-demo.lsst.codes/specs?metric=validate_drp.PA1&dataset_name=validation_data_cfht&filter_name=r
I don't know in advance if the specs are chromatic or achromatic.
If they are chromatic, filter_name will be present in the query metadata and the query above will return the expected result.
Now suppose that there are only achromatic specs like in this query:
http://squash-restful-api-demo.lsst.codes/specs?metric=validate_drp.AM1&dataset_name=validation_data_cfht&filter_name=r
then nothing is returned. The constraint on filter_name=r is not satisfied because filter_name is not present in the query_metadata for achromatic specs.
In that case the following query would return the expected result:
http://squash-restful-api-demo.lsst.codes/specs?metric=validate_drp.AM1&dataset_name=validation_data_cfht
Do you think this behavior is ok?
I mean, as a procedure for retrieving specs I would do the most restrictive query first
http://squash-restful-api-demo.lsst.codes/specs?metric=validate_drp.AM1&dataset_name=validation_data_cfht&filter_name=r
and if nothing is returned I would relax the constraint on filter_name and do:
http://squash-restful-api-demo.lsst.codes/specs?metric=validate_drp.AM1&dataset_name=validation_data_cfht
Now it is possible to query specifications filtering by dataset name, filter name (as in the specification query metadata) and tag.
Retrieve all specifications for the validate_drp.AM1 metric and for the validation_data_cfht dataset:
http://localhost:5000/specs?metric=validate_drp.AM1&dataset_name=validation_data_cfht
Retrieve only the design specification from the above:
http://localhost:5000/specs?metric=validate_drp.AM1&dataset_name=validation_data_cfht&tag=design
Retrive all specifications for the validate_drp.PA1 metric, validation_data_cfht dataset, and r filter.
http://localhost:5000/specs?metric=validate_drp.PA1&dataset_name=validation_data_cfht&filter_name=r