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

[WIP] Further updates to property definitions #460

Closed
Closed
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
73ea1f5
Adjustments to property definitions
rartino Feb 27, 2023
a914e15
Fix spelling error
rartino Feb 27, 2023
e9c11b7
Further adjustments to the property definition text
rartino Feb 27, 2023
2cfd324
Further adjustments to the property definition text
rartino Feb 27, 2023
9f9027c
Possible controversial change of forcing type in property definitions…
rartino Feb 27, 2023
980ec63
Apply suggestions from review
rartino Feb 27, 2023
88d391f
Correct minor grammar error from review
rartino Feb 28, 2023
422fee7
Add internal hyperlinks to be helpful in property definition cross-re…
rartino Feb 28, 2023
bc89ad7
Apply suggestions from review
rartino Mar 1, 2023
e022a82
Prepare for freestanding Unit Definitions
rartino Mar 1, 2023
7311537
Improvement of Physical Unit Definitions
rartino Mar 2, 2023
03b8d66
Formatting fixes
rartino Mar 2, 2023
0a57fa0
Formatting fixes for math expression in Physical Unit Definitions
rartino Mar 2, 2023
d6ca26a
Slight adjustment of formulation for Unit Definitions
rartino Mar 2, 2023
39d1283
Clarify example defining relation formula
rartino Mar 2, 2023
823747c
Clarify not to use defining relation for unit definitions if the rela…
rartino Mar 2, 2023
71e08bc
Apply suggestions from review
rartino Mar 2, 2023
f2c29e3
Fix defining relation formula in Physical Unit Definitions
rartino Mar 2, 2023
b477cb3
Fix Physial Unit Definitions ambiguity on optimal fields, add Propert…
rartino Mar 2, 2023
f7f0f0e
Apply suggestions from review
rartino Mar 2, 2023
790cf25
Update based on review
rartino Mar 2, 2023
1643e67
Add field approximate-relations to unit definitions
rartino Mar 8, 2023
560a0eb
Further adjust equality of property definitions
rartino Mar 13, 2023
5075796
Update references to URIs to IRIs and replace references in field nam…
rartino Mar 13, 2023
aa8bcd7
Fix formatting error
rartino Mar 16, 2023
2a66036
Allow annotations to the end of description; reorganize for less repe…
rartino Mar 17, 2023
7933505
Add a way in property definitions to express that some fields, e.g., …
rartino Mar 17, 2023
9c9ac03
Add alternate-symbols to Physical Unit Definitions
rartino Mar 19, 2023
1f3ae2d
Change unit definitions so the way we reference the standard from sch…
rartino Mar 19, 2023
e306ea3
Add fields to Property and Unit definitions, and REQUIRE it and for…
rartino Mar 19, 2023
737cfc2
Apply suggestions from review
rartino Mar 19, 2023
f2c8390
Further adjustment based on review comments
rartino Mar 19, 2023
cef9298
Reorder, clarify, and simplify meta-schema for Property Definitions a…
rartino Mar 19, 2023
08f0a1b
Adjust REQUIRED status to OPTIONAL on some fields in Unit Definitions
rartino Mar 20, 2023
47f7620
Refine compound unit expression definition
rartino Mar 20, 2023
dc5665d
Property definitions: revert parts of the unit prefix text and allow …
rartino Mar 22, 2023
9a66c5c
Property definitions: revert parts of the unit prefix text and allow …
rartino Mar 22, 2023
5c8d6fc
Apply suggestions from review
rartino Jul 14, 2023
e6d40ac
Merge upstream develop
rartino Jul 14, 2023
d653684
Merge branch 'develop' into update_to_property_defs_2
rartino Dec 22, 2023
40526eb
Further updates to match latest property definitions; be less stringe…
rartino Dec 23, 2023
01564aa
Merge branch 'develop' into update_to_property_defs_2
rartino Jan 5, 2024
cf9e468
Add pattern to string validation
rartino Jan 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .words.lst
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,4 @@ yacc
zeo
zeolites
�ngstr�m
incrementing
65 changes: 53 additions & 12 deletions optimade.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1871,6 +1871,8 @@ A Property Definition MUST be composed according to the combination of the requi

**REQUIRED keys for all levels of the Property Definition:**

.. _definition of the x-optimade-type field:

- :field:`x-optimade-type`: String
rartino marked this conversation as resolved.
Show resolved Hide resolved
Specifies the OPTIMADE data type for this level of the defined property.
MUST be one of :val:`"string"`, :val:`"integer"`, :val:`"float"`, :val:`"boolean"`, :val:`"timestamp"`, :val:`"list"`, or :val:`"dictionary"`.
Expand All @@ -1884,6 +1886,10 @@ A Property Definition MUST be composed according to the combination of the requi
- :field:`x-optimade-implementation`: Dictionary.
A dictionary describing the level of OPTIMADE API functionality provided by the present implementation.
If an implementation omits this field in its response, a client interacting with that implementation SHOULD NOT make any assumptions about the availability of these features.

This field should be seen as an annotation rather than an integral part of the Property Definition.
Two Property Definitions that only differ by the value of :field:`x-optimade-implementation` are considered the same, and as explained in the `definition of the $id field`_, they SHOULD share the same :field:`$id`.

The dictionary has the following format:

**OPTIONAL keys:**
Expand All @@ -1902,8 +1908,12 @@ A Property Definition MUST be composed according to the combination of the requi
- :val:`partial`: the defined property MUST be queryable with support for a subset of the filter language operators as specified by the field :field:`query-support-operators`.
- :val:`none`: the defined property does not need to be queryable with any features of the filter language.

Omitting the field or :val:`null` is equivalent to :val:`none`.

- :field:`query-support-operators`: List of Strings.
Defines the filter language features supported on this property.
MUST be present and not :val:`null` if and only if :field:`query-support` is :val:`partial`.

Each string in the list MUST be one of :val:`<`, :val:`<=`, :val:`>`, :val:`>=`, :val:`=`, :val:`!=`, :val:`CONTAINS`, :val:`STARTS WITH`, :val:`ENDS WITH`:, :val:`HAS`, :val:`HAS ALL`, :val:`HAS ANY`, :val:`HAS ONLY`, :val:`IS KNOWN`, :val:`IS UNKNOWN` with the following meanings:
rartino marked this conversation as resolved.
Show resolved Hide resolved

- :val:`<`, :val:`<=`, :val:`>`, :val:`>=`, :val:`=`, :val:`!=`: indicating support for filtering this property using the respective operator.
Expand All @@ -1918,14 +1928,20 @@ A Property Definition MUST be composed according to the combination of the requi

- :val:`IS KNOWN`, :val:`IS UNKNOWN`: indicating support for filtering this property on unknown values using the respective operator.

- :field:`response-default`: Boolean
rartino marked this conversation as resolved.
Show resolved Hide resolved
The value :val:`TRUE` means the implementation includes the property in responses by default, i.e., when not specifically requested.
rartino marked this conversation as resolved.
Show resolved Hide resolved
The value :val:`FALSE` means that the property is only included when requested.
Omitting the field or :val:`null` means the implementation does not declare if the property will be included in responses by default or not.
vaitkus marked this conversation as resolved.
Show resolved Hide resolved

- :field:`x-optimade-requirements`: Dictionary.
A dictionary describing the level of OPTIMADE API functionality required by all implementations of this property.
Omitting this field means the corresponding functionality is OPTIONAL.
The dictionary has the same format as :field:`x-optimade-implementation`, except that it also allows the following OPTIONAL field:
The dictionary has the same format as :field:`x-optimade-implementation`, *except that* the :field:`response-default` SHOULD NOT appear, and the following additional OPTIONAL fields are allowed:
rartino marked this conversation as resolved.
Show resolved Hide resolved

- :field:`support`: String.
Describes the minimal required level of support for the Property by an implementation.
This field SHOULD only appear in an :field:`x-optimade-requirements` that is at the outermost level of a Property Definition, as the meaning of its inclusion on other levels is not defined.
This field only has meaning for the defined property when appearing in the :field:`x-optimade-requirements` at the outermost level of the definition.
Nevertheless, it MAY appear at other places, e.g., if a nested property definition has been inserted that references its own :field:`$id`.
rartino marked this conversation as resolved.
Show resolved Hide resolved
The string MUST be one of the following:

- :val:`must`: the defined property MUST be recognized by the implementation (e.g., in filter strings) and MUST NOT be :val:`null`.
Expand All @@ -1937,6 +1953,21 @@ A Property Definition MUST be composed according to the combination of the requi
Note: the specification by this field of whether the defined property can be :val:`null` or not MUST match the value of the :field:`type` field.
If :val:`null` values are allowed, that field must be a list where the string :val:`"null"` is the second element.

- :field:`response-default-level`: String
rartino marked this conversation as resolved.
Show resolved Hide resolved
Expresses if an implementation of this property is required to include or exclude it in responses when not specifically requested.
This field only has meaning for the defined property when appearing in the :field:`x-optimade-requirements` at the outermost level of the definition.
Nevertheless, it MAY appear at other places, e.g., if a nested property definition has been inserted that references its own :field:`$id`.
rartino marked this conversation as resolved.
Show resolved Hide resolved

The string MUST be one of the following:

- :val:`must`: the defined property MUST be included in responses unless specifically excluded.
- :val:`should`: the defined property SHOULD be included in responses unless specifically excluded.
- :val:`may`: it is OPTIONAL for the implementation to include the defined property in responses or not.
rartino marked this conversation as resolved.
Show resolved Hide resolved
- :val:`should not`: the defined property SHOULD NOT be included in responses unless specifically requested.
- :val:`must not`: the defined property MUST NOT be included in responses unless specifically requested.

Omitting the field is equivalent to :val:`may`.

Property Definition keys from JSON Schema
-----------------------------------------

Expand All @@ -1945,25 +1976,20 @@ The format described in this subsection forms a subset of the `JSON Schema Valid

**REQUIRED keys**

- :field:`type`: String or List.
- :field:`type`: List.
Specifies the corresponding JSON type for this level of the defined property and whether the property can be :val:`null` or not.
The value is directly correlated with :field:`x-optimade-type` as explained below.

It MUST be one of:
The value is directly correlated with :field:`x-optimade-type` (cf. the `definition of the x-optimade-type field`_).

- A string correlated with :field:`x-optimade-type` as follows.
If :field:`x-optimade-type` is:
It MUST be a list of one or two elements where the first element is a string correlated with :field:`x-optimade-type` as follows; if :field:`x-optimade-type` is:

* :val:`"boolean"`, `"string"`, or `"integer"` then :field:`type` is the same string.
* :val:`"dictionary"` then :field:`type` is `"object"`.
* :val:`"list"` then :field:`type` is `"array"`.
* :val:`"float"` then :field:`type` is `"number"`.
* :val:`"timestamp"` then :field:`type` is `"string"`.
rartino marked this conversation as resolved.
Show resolved Hide resolved

- A list where the first item MUST be the string described above (correlated to the field :field:`x-optimade-type` in the same way) and the second item MUST be the string :val:`"null"`.
This form specifies that the defined property can be :val:`null`.

..
If the second element is included, it MUST be the string :val:`"null"`.
This two element form specifies that the defined property can be :val:`null`.
ml-evs marked this conversation as resolved.
Show resolved Hide resolved

Implementation notes:

Expand All @@ -1977,9 +2003,12 @@ The format described in this subsection forms a subset of the `JSON Schema Valid

**OPTIONAL keys**

.. _definition of the $id field:

- :field:`$id`: String.
A static URI identifier that is a URN or URL representing the specific version of this level of the defined property.
It SHOULD NOT be changed as long as the property definition remains the same, and SHOULD be changed when the property definition changes.
The Property Definition SHOULD be regarded as the same if the only changes that have been made are to the following specific fields at any level: :field:`deprecated`, :field:`$comment`, or : field:`x-optimade-implementation`.
(If it is a URL, clients SHOULD NOT assign any interpretation to the response when resolving that URL.)

- :field:`title`: String.
Expand All @@ -1990,11 +2019,23 @@ The format described in this subsection forms a subset of the `JSON Schema Valid
The format SHOULD be a one-line description, followed by a new paragraph (two newlines), followed by a more detailed description of all the requirements and conventions of the defined property.
Formatting in the text SHOULD use Markdown in the `CommonMark v0.3 format <https://spec.commonmark.org/0.30/>`__.

- :field:`$comment`: String.
A human-readable comment relevant in the context of the raw definition data.
These comments should be omitted in formatted descriptions of the property shown to the end users.
(Comments in descriptions relevant to the end users should go into :field:`description`.)
Formatting in the text SHOULD use Markdown in the `CommonMark v0.3 format <https://spec.commonmark.org/0.30/>`__.

This field should be seen as an annotation rather than an integral part of the Property Definition.
Two Property Definitions that only differ by the value of any :field:`$comment` fields are considered the same, and as explained in the `definition of the $id field`_, they SHOULD share the same :field:`$id`.

- :field:`deprecated`: Boolean.
If :val:`TRUE`, implementations SHOULD not use the defined property, and it MAY be removed in the future.
If :val:`FALSE`, the defined property is not deprecated.
The field not being present means :val:`FALSE`.

This field should be seen as an annotation rather than an integral part of the Property Definition.
Two Property Definitions that only differ by :field:`deprecated` fields are considered the same, and as explained in the `definition of the $id field`_, they SHOULD share the same :field:`$id`.

- :field:`enum`: List.
The defined property MUST take one of the values given in the provided list.
The items in the list MUST all be of a data type that matches the :field:`type` field and otherwise adhere to the rest of the Property Description.
Expand Down