tilde-lab / optimade.science

A "sky-scanner" Optimade browser-only GUI
https://optimade.science/
MIT License
8 stars 3 forks source link

Differentiate no results from invalid/unsupported filters #31

Open merkys opened 3 years ago

merkys commented 3 years ago

When searching for spacegroup="P1" on https://optimade.science, all providers but MPDS result in "No results". However, filter spacegroup="P1" is not defined in the OPTIMADE standard, thus it is nonstandard. Therefore, replies "No results" from other providers give false impressions that these databases do not contain P1 structures, which some of them do. Therefore I propose catching HTTP 4xx and 5xx from providers and reporting them as such.

blokhin commented 3 years ago

Accepted. I couldn't believe no other providers can handle such queries!

blokhin commented 3 years ago

Do you know how exactly the spacegroups can be queried?

merkys commented 3 years ago

Do you know how exactly the spacegroups can be queried?

Currently, however, the specification does not have means to query spacegroups.

I can think of two methods to detect and report invalid/unsupported queries:

  1. Send the user-typed query to each provider and then inspect the HTTP return status. This method will allow individual providers to support nonstandard queries, just like MPDS supports spacegroup.
  2. Parse the query to immediately report invalid/unsupported (as per the specification) queries. This should be more difficult to implement, but would reduce the load on the providers.
blokhin commented 3 years ago

Alright. I better remove the example with the spacegroup then. I expected this is fully valid example.

merkys commented 3 years ago

Alright. I better remove the example with the spacegroup then. I expected this is fully valid example.

It is not valid, indeed. Moreover, according to the specification, / symbols in filter strings must be percent-encoded. This is the reason why spacegroup= queries originating from https://optimade.science caught my eye in the first place. Probably percent-encoding issue should be better posted as a separate GitHub issue.

blokhin commented 3 years ago

Closed by the 2.0.2 release of https://github.com/tilde-lab/optimade-client

blokhin commented 2 years ago

Re-opening wrt https://github.com/Materials-Consortia/OPTIMADE/pull/405