Skip to content

Adding the dimension_slices query parameter and associated metadata#481

Merged
rartino merged 78 commits into
Materials-Consortia:developfrom
JPBergsma:JPBergsma/property_ranges
Sep 19, 2025
Merged

Adding the dimension_slices query parameter and associated metadata#481
rartino merged 78 commits into
Materials-Consortia:developfrom
JPBergsma:JPBergsma/property_ranges

Conversation

@JPBergsma
Copy link
Copy Markdown
Contributor

@JPBergsma JPBergsma commented Jun 29, 2023

This PR introduces the ability for a client to request a specific subset, or "slice", of items from list properties. This is primarily achieved through the addition of a new query parameter, dimension_slices, and associated metadata fields to describe slicing capabilities and reflect the requested slices in the response.
Note this new feature is distinct from the existing protocol for large property values (see #467 and follow-up PRs), as slicing is initiated by the client, not the server. This means that even when slicing is requested by the client, the server can still decide whether to return the whole data in line, or via the partial data protocol.

1. dimension_slices query parameter

  • Purpose: Request only specific parts of list properties.
  • Syntax: dimension_slices=dim_xxx[start:stop:step],...
    • The slice defaults are as follows: start=0, step=1, stop=null (meaning upto the last value in the list).
    • Note that, at variance with Python, stop is inclusive.

2. Metadata enhancements in the response

A new list_axes list of dictionaries describing each list dimension. Each dict must contain dimension_name (required).
Optional keys: length, sliceable (bool), available_slice (index range), requested_slice (returned in list_axes for each sliced property, reflecting the exact slice requested).

3. Shared dimensions

  • A slice on a dimension name applies to all properties that use that same name.

Result: Clients can fetch only needed portions of list data, with servers clearly describing slicing capabilities and confirming applied slices in the response.

Note that it surpersedes the original proposal #452.

@JPBergsma JPBergsma marked this pull request as ready for review June 29, 2023 16:32
@blokhin blokhin changed the title Property_Ranges Querry Parameter Property_Ranges Query Parameter Jun 29, 2023
Comment thread optimade.rst Outdated
@rartino
Copy link
Copy Markdown
Member

rartino commented Jun 30, 2023

Thanks for writing this up!

Why did you move the whole section "Transmission of large property values"? It makes it tricky to see what has changed. Can you move it back?

Also, my interpretation of the workshop discussions was to make the property_ranges query parameter completely separate from, and orthogonal to, the mechanism for "Transmission of large property values" (this was a strong point of @sauliusg). Hence, it isn't clear to me why anything has to change in the "Transmission of large property values". Why can't we keep all documentation about this feature in the definition of the property_ranges query parameter?

@rartino rartino mentioned this pull request Jun 30, 2023
5 tasks
@JPBergsma
Copy link
Copy Markdown
Contributor Author

It seemed more logical to place the metadata section before the "Transmission of large property values" section, as the "Transmission of large property values" section depends on the metadata section but not the other way round. So it is more useful to read the metadata section before the "Transmission of large property values" section.

@JPBergsma
Copy link
Copy Markdown
Contributor Author

You are right, I could still separate the property ranges query parameter and the extra metadata fields from the transmission of large data section, as each could still be used separate from the other. I'll try to do this next week.

Comment thread optimade.rst Outdated
@ml-evs ml-evs force-pushed the JPBergsma/property_ranges branch from d2a18b7 to a84c72e Compare December 19, 2023 14:08
@ml-evs ml-evs added the blocking-release This is a PR or issue that presently blocks the release of next version of the spec. label Dec 19, 2023
ml-evs
ml-evs previously requested changes Dec 19, 2023
Copy link
Copy Markdown
Member

@ml-evs ml-evs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly formatting changes and suggesting rewordings -- I think I can go through and force most of them in if there are no objections

Comment thread optimade.rst Outdated
Comment thread optimade.rst Outdated
Comment thread optimade.rst Outdated
Comment thread optimade.rst Outdated
Comment thread optimade.rst Outdated
Comment thread optimade.rst Outdated
Comment thread optimade.rst Outdated
Comment thread optimade.rst Outdated
Comment thread optimade.rst Outdated
Comment thread optimade.rst Outdated
@ml-evs ml-evs changed the title Property_Ranges Query Parameter Adding the property_ranges query parameter and associated metadata Dec 19, 2023
@rartino
Copy link
Copy Markdown
Member

rartino commented Jan 9, 2024

This PR appears a bit stalled and is important. @JPBergsma do you plan to continue working on this, or are you ok with me (or someone else) starting to merge changes into it?

rartino
rartino previously approved these changes Sep 19, 2025
giovannipizzi
giovannipizzi previously approved these changes Sep 19, 2025
Copy link
Copy Markdown
Contributor

@giovannipizzi giovannipizzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am very happy with this final version. If there are minor textual changes, feel free to apply and merge as if these are also approved by me!

Comment thread optimade.rst Outdated
Comment thread optimade.rst Outdated
Comment thread optimade.rst Outdated
Comment thread optimade.rst
Comment thread optimade.rst Outdated
Comment thread optimade.rst Outdated
Comment thread optimade.rst Outdated
@rartino rartino dismissed stale reviews from giovannipizzi and themself via d2f8644 September 19, 2025 07:40
Comment thread optimade.rst Outdated
rartino
rartino previously approved these changes Sep 19, 2025
sauliusg
sauliusg previously approved these changes Sep 19, 2025
@rartino rartino dismissed stale reviews from sauliusg and themself via 697b2c1 September 19, 2025 07:47
@ml-evs ml-evs dismissed their stale review September 19, 2025 07:49

I don't remember anything about it

rartino
rartino previously approved these changes Sep 19, 2025
@rartino rartino dismissed merkys’s stale review September 19, 2025 07:51

@merkys asks me to dismiss this

sauliusg
sauliusg previously approved these changes Sep 19, 2025
Comment thread optimade.rst Outdated
Co-authored-by: Daniel Beltrán <44979434+d-beltran@users.noreply.github.com>
@rartino rartino dismissed stale reviews from sauliusg and themself via 310ea6e September 19, 2025 07:54
Copy link
Copy Markdown
Contributor

@giovannipizzi giovannipizzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, great work! Let's get it merged!

@rartino rartino merged commit 0736bb8 into Materials-Consortia:develop Sep 19, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR/requires-discussion status/has-concrete-suggestion This issue has one or more concrete suggestions spelled out that can be brought up for consensus.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants