Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Links to items in other collections are stripped out of collection JSON #775

Closed
drandyziegler opened this issue Jan 8, 2025 · 1 comment

Comments

@drandyziegler
Copy link

I intended to create a collection that has links to items that sit in other collection. The "item" links are stripped out of the collection JSON when updating a collection via the stac-fastapi. Only an "item empty" collection is shown after the update.
My use case is that I have a collection for each weather recording device and each time metadata for a device changes a stac item with a full new set of metadata is created as part of the weather device collection. Each item of metadata has a start_datetime and an end_datetime except for the latest one which does not have and end_datetime. This way there is a record of every metadata change and it is clear which one the item with the latest metadata information is.
I'd like to have a collection that links to all the current/latest items across all weather device collections. I'd prefer not to duplicate items and have the same information living in two places - the weather device collection and in a "latest" collection (which would be an obvious work around).
Should this kind of "empty" collections with relative links to items in other collections be supported? Or is there another way to achieve this?
Thanks for your help and advice.

(FYI as a side issue the "rel" links for "aggregate", "aggregations", and "queryables" are automatically added the JSON each time I
(1.) load the collection JSON, (2.) add an "item" link to the collection and (3.) update the collection via an API with the new JSON. The JSON keeps growing in length each time I go through the process above.)

@vincentsarago
Copy link
Member

I'm not 💯 sure to understand, you want to create an empty collection (no Items) but have links to other items?

A collection Links array doesn't have links to all the items but has an arrays of items

in stac-fastapi-pgstac the links for a collection are set in https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/stac_fastapi/pgstac/core.py#L174-L189 and has only 4 links set https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/stac_fastapi/pgstac/models/links.py#L225-L262

Should this kind of "empty" collections with relative links to items in other collections be supported?

I don't think you can, you can maybe ask for help over https://app.gitter.im/#/room/#SpatioTemporal-Asset-Catalog_Lobby:gitter.im

(FYI as a side issue the "rel" links for "aggregate", "aggregations", and "queryables" are automatically added the JSON each time

Yeah, the links are dynamically generated by the backend. (if you have aggregate links it means you might be using ElasticSearch backend with I have no real knowledge)

@stac-utils stac-utils locked and limited conversation to collaborators Jan 16, 2025
@vincentsarago vincentsarago converted this issue into discussion #783 Jan 16, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants