Skip to content
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

Linking to specific queries? #420

Open
m-mohr opened this issue Apr 14, 2023 · 3 comments
Open

Linking to specific queries? #420

m-mohr opened this issue Apr 14, 2023 · 3 comments

Comments

@m-mohr
Copy link
Collaborator

m-mohr commented Apr 14, 2023

We'd like to link to ItemCollections that are search results, so URLs like:

https://example.com/api/search?filter=collection%20%3D%20%27landsat8_l1tp%27%20AND%20eo%3Acloud_cover%20%3C%3D%2010

or

https://example.com/api/collections/landsat8_l1tp/items?filter=eo%3Acloud_cover%20%3C%3D%2010

I'd like that clients read them similarly to how the Items are consumed. What's the best relation type for it? Can "items" be used? Or something new like "item-search-result"?

Same applies for Collection Search: Can "data" be used? Or something new like "collections-search-result"?

@gadomski
Copy link

I prefer having fewer things. Reusing items+data, instead of adding new rel types to our ecosystem, seems better to me. Can you lay out the reasons why items+data couldn't be reused?

@m-mohr
Copy link
Collaborator Author

m-mohr commented Apr 17, 2023

@gadomski I don't have very specific reasons, just a "fear" that clients may misunderstand it or not take the query parameters into account as the API spec really just specifies item and data for the "main" endpoints, I think. Also, if you want to have the "original" and specific queries side by side, how to distinguish them?

@gadomski
Copy link

if you want to have the "original" and specific queries side by side, how to distinguish them?

Yup, agreed -- I know I've written a client that looks for data to get the collections link, for example. So yeah, that changes my answer -- new rel type seems better :-P. Thanks!

As for naming, yours seem good enough, if a bit long. I didn't see anything about "search-result" in the IANA (I went looking hoping for a good analogue and came up blank).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants