Skip to content

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

Closed

Description

@drandyziegler

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.)

Activity

  1. vincentsarago commented on Jan 16, 2025

    @vincentsarago
    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)

  2. locked and limited conversation to collaborators on Jan 16, 2025
  3. converted this issue into a discussion #783 on Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions