Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle unset optional properties #47

Merged
merged 15 commits into from
Jun 13, 2019
Binary file added .DS_Store
Binary file not shown.
25 changes: 25 additions & 0 deletions optimade.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
        [3.3.1. Response Format](#h.3.3.1)
        [3.3.2. JSON API Response Schema: Common Fields](#h.3.3.2)
        [3.3.3. HTTP Response Status Codes](#h.3.3.3)
        [3.3.4. Unset optional properties](#h.3.3.4)
    [3.4. Index Meta-Database](#h.3.4)

[4. API endpoints](#h.4)
Expand Down Expand Up @@ -377,6 +378,30 @@ the next course of action SHOULD be to fetch the resource objects under the
to the corresponding database ID that was originally queried, using the object's
`base_url` value.

### <a name="h.3.3.4">3.3.4. Unset optional properties</a>

Unset optional properties in a database are properties that exist and have a specific value within a database for some materials entries, but are undefined for other entries, e.g. have the value `null` within a JSON file.

Unset properties MUST NOT be returned in the response, unless explicitly requested in the search query.

Any comparisons involving unset properties MUST be evaluated as `false`,
i.e. by definition the value of `null` is outside of any defined search range.

If a property is explicitly requested in a search query without value range filters,
then all entries otherwise satisfying the query SHOULD be returned, including those with `null` values for this property.
These properties MUST be set to `null` in the response.

Entries with unset or set property values can be filtered out of the response using:
```
identifier IS KNOWN
identifier IS UNKNOWN
```
respectively, as specified in section [5.2. The Filter Language Syntax](#h.5.2).

The text in this section describes how the API handles properties that are `null`.
It does not regulate the handling of values inside property data structures that can be `null`.
The use of `null` values inside property data structures are described in the definitions of those data structures elsewhere in the specification.

## <a name="h.3.4">3.4. Index Meta-Database</a>

The main purpose of this "index" is to allow for automatic discoverability
Expand Down