-
Notifications
You must be signed in to change notification settings - Fork 39
Collections endpoint #386
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
base: develop
Are you sure you want to change the base?
Collections endpoint #386
Changes from 8 commits
120cf12
4adae80
d9312fe
abccba0
8308a50
9172374
38c46de
c7a00dd
e817790
614bc76
5e3dc8a
ad271ed
a60c4a7
8c2c7c8
f449350
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1079,6 +1079,7 @@ Example: | |
| }, | ||
| "available_endpoints": [ | ||
| "structures", | ||
| "collections", | ||
| "calculations", | ||
| "info", | ||
| "links" | ||
|
|
@@ -2799,6 +2800,86 @@ structure\_features | |
|
|
||
| - A structure having implicit atoms and using assemblies: :val:`["assemblies", "implicit_atoms"]` | ||
|
|
||
| Collections Entries | ||
| ------------------- | ||
|
|
||
| Collections entries are used to define a set of Entries of any types. | ||
| For example, a collection of Structure entries can be used to indicate that they are conceptually related, such as structures representing aluminium unit cells with point defects. | ||
| The set of entries that belong to the collection is defined using a :val:`contents` relationship (see the `Relationships`_ section). | ||
|
rartino marked this conversation as resolved.
Outdated
|
||
| A collection can contain other collections. | ||
| Furthermore, implementations are suggested to add database-specific properties for additional metadata they want to store about the collections. | ||
| An OPTIMADE response representing a collection with all referenced entries included via the JSON API field :field:`included` (or equivalent in other response formats) can be used as a universal format for storage or transfer of a subset of (or all) data in an OPTIMADE database. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have some concerns about pagination of
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I thought we intended for clients to generally just get the list of ids from the relationship and then request entry data by further queries using the endpoint + id format. (Or, for efficiency when there are many, perhaps via
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I understand that this is the intention, but I am a bit nervous that we have a field that can now grow unboundedly in a response if requested (or even if not, you cannot disable I think the larger comment now addressed in #420 would be the best mechanism around this (if we are going to support it anyway).
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Are you talking about Possibly repeating myself a bit, but to be clear: I don't see a problem with The situation is more tricky with huge Hence, I think we have to look at this list of IDs as a single "datum" where our default OPTIMADE JSON:API output format isn't equipped to handle arbitrary large data. This is echo:ed by our recommendation for other output formats to simply encode relationships alongside other data. If we are concerned about this limitation, I don't see any other way to address it than to implement an alternative output format that can handle pagination on individual properties, including the relationships.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Understood
I think my concern is that some of the intended use cases for
I'm leaning towards this being the correct approach. The relationships can be included as a
Let's see how the discussion in #419 goes...
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
You seem to be right - excluding the |
||
|
|
||
| The following example shows how the :val:`contents` relationship from a collection to other entries defines the contents of a collection: | ||
|
rartino marked this conversation as resolved.
Outdated
|
||
|
|
||
| .. code:: jsonc | ||
|
|
||
| { | ||
| "data": { | ||
| "type": "collections", | ||
| "id": "example.com:collections:42", | ||
|
rartino marked this conversation as resolved.
Outdated
|
||
| "attributes": { | ||
| "name": "Results set for vacancies in FCC Al" | ||
| "category": "results_set" | ||
| }, | ||
| "relationships": { | ||
| "structures": { | ||
|
rartino marked this conversation as resolved.
|
||
| "data": [ | ||
| { "type": "structures", "id": "example.com:structures:4711" }, | ||
| { "type": "structures", "id": "example.com:structures:4712" }, | ||
| { "type": "structures", "id": "example.com:structures:4713" } | ||
| { "type": "calculations", "id": "example.com:calculations:1899" } | ||
| ] | ||
| } | ||
| } | ||
| }, | ||
|
ml-evs marked this conversation as resolved.
|
||
| } | ||
|
|
||
| Collections entries have the properties described above in section `Properties Used by Multiple Entry Types`_, as well as the following additional properties: | ||
|
|
||
| name | ||
| ~~~~ | ||
|
|
||
| - **Description**: A name for the collection | ||
| - **Type**: String | ||
| - **Requirements/Conventions**: | ||
|
|
||
| - **Support**: OPTIONAL support in implementations, i.e., MAY be :val:`null`. | ||
| - **Query**: Support for queries on this property is OPTIONAL. | ||
|
|
||
| - **Examples**: | ||
|
|
||
| - :val:`"Results set for vacancies in FCC Al"` | ||
|
rartino marked this conversation as resolved.
|
||
|
|
||
| description | ||
| ~~~~~~~~~~~ | ||
|
|
||
| - **Description**: A longer text that describes the collection | ||
| - **Type**: String | ||
| - **Requirements/Conventions**: | ||
|
|
||
| - **Support**: OPTIONAL support in implementations, i.e., MAY be :val:`null`. | ||
| - **Query**: Support for queries on this property is OPTIONAL. | ||
|
|
||
| - **Examples**: | ||
|
|
||
| - :val:`"This collection contains structures used in an investigation into point defects in Al"` | ||
|
rartino marked this conversation as resolved.
|
||
|
|
||
| category | ||
| ~~~~~~~~ | ||
|
|
||
| - **Description**: A free-form text categorizing the collection. | ||
| It is suggested that individual collections with similar purposes are assigned the same category to aid browsing and searching. | ||
| - **Type**: String | ||
| - **Requirements/Conventions**: | ||
|
|
||
| - **Support**: OPTIONAL support in implementations, i.e., MAY be :val:`null`. | ||
| - **Query**: Support for queries on this property is OPTIONAL. | ||
|
|
||
| - **Examples**: | ||
|
|
||
| - :val:`"results_set"` | ||
|
rartino marked this conversation as resolved.
|
||
|
|
||
| Calculations Entries | ||
| -------------------- | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.