-
Notifications
You must be signed in to change notification settings - Fork 179
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
Add type field to Collection & Catalog #971
Conversation
Ok, this is up for discussion, feedback welcome. I think it's in line with what we discussed.
Thoughts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still needs JSON Schema changes.
Also, the "How to Differentiate STAC Files" part could probably be a bit simplified.
I'll work on it.
Oh, yeah, apologies - I meant to mention that I'd really like your help on the schema changes. Thanks @m-mohr! And thanks for help on differentiating STAC files. Also our linter forced me to pick a 'language' for the code blocks, but I think you just wrote it in pseudo-code? If you've got better formatting ideas then go for it. Could just do it in python or javascript, and people will get the idea. |
best-practices.md
Outdated
|
||
Any tool that crawls a STAC implementation or encounters a STAC file in the wild needs a clear way to determine if it is an Item, | ||
Collection, Catalog or [ItemCollection](https://github.com/radiantearth/stac-api-spec/tree/v1.0.0-beta.1/fragments/itemcollection) | ||
(part of the [STAC API spec](https://github.com/radiantearth/stac-api-spec/tree/v1.0.0-beta.1). As of 1.0.0 this is done primarily with the `type` field, and secondarily in Items with `stac_version`, or optionally the `rel` of the link to it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this challenge is less pronounced in API settings than static catalog settings, since the OpenAPI spec for the API tells you what to expect at each endpoint (and also catalogs don't live anywhere in the API). That said if someone saves off an ItemCollection
and then refers to it from a static catalog, I guess all bets are off, so I think I've talked myself into this inclusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sharing your thoughts, even if you talked yourself into it. And I agree with both points - some people may save the itemcollection out in the wild.
One question that came up during the JSON Schema update: Collection inherits from Catalog. A Catalog has type set to Catalog. I can't simply override that in Collection if I inherit from Catalog. I could make it work as an array ( Opinions? |
We discussed this on the call, and the consensus seemed to be that we should do something where the collection type includes the catalog in it, so that a client can check for 'catalog' with a regex and match both, or can check for the specific. We should do a bit more research on options, but the one idea was to look to media types for what they do, with like geo+json. The obvious proposal based on what we have would be |
I'm fine with |
Using just "Collection" you can't use the Catalog JSON Schema to validate the Collection, which should be possible as it states that a Collection is a Catalog. |
It seems then that the core issue here is that JSONSchema doesn't support true inheritance? In a fuller language like Python/JS, you could presumably subclass |
And just for posterity, the favorite idea from the STAC call was |
@kylebarron Although Python and JS would probably allow that (as they can't restrict the values returned by a method), it's not strictly correct inheritance. That got longer than I planned it to be 😅 |
I think there's a little bit of ambiguity around inheritance.
(emphasis mine) But also
(admittedly there's much more backing up the second point, but the first is the third sentence in the collection readme) One thing that I've never been clear about is whether it's important for every collection to be a valid catalog, or whether that's something incidental that's been carried over for a long time. Is that desire from OGC data type relationships? Or can we break it without going out on a limb? |
It's definitely not from OGC data type relationships, and I don't think we need to worry about that. To me the important thing is to be able to crawl catalogs and collections in a hierarchy and be able to expect them to operate the same way. But I don't know that it's important that it truly is a valid catalog. Just that it has all the same link / field requirements. But I think I'm ok with changing how we talk about it to just say that they have the same core fields and clients can crawl them equally. But it does make some intuitive sense to me to explain that a collection is a catalog with some extras. I do think the other option might just be to drop trying to add the type field. I was imagining we could just have a simple type and it'd work well, but now I'm less sure it's really worth the effort given the constraints. |
we sure don't have a lot of example catalogs 🤔
Co-authored-by: Matthias Mohr <[email protected]>
Co-authored-by: Matthias Mohr <[email protected]>
Co-authored-by: Matthias Mohr <[email protected]>
Co-authored-by: Matthias Mohr <[email protected]>
Co-authored-by: Matthias Mohr <[email protected]>
Co-authored-by: Matthias Mohr <[email protected]>
Co-authored-by: Phil Varner <[email protected]>
# Conflicts: # examples/extensions-collection/collection.json
Related Issue(s): #889
Proposed Changes:
type
field to catalog and collection specPR Checklist: