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

Relative vs. absolute links #160

Closed
mojodna opened this issue Aug 14, 2018 · 4 comments
Closed

Relative vs. absolute links #160

mojodna opened this issue Aug 14, 2018 · 4 comments

Comments

@mojodna
Copy link
Collaborator

mojodna commented Aug 14, 2018

Should links within a catalog hierarchy be absolute (all links fully qualified) or relative (to self, which can substituted with the URL that the document was fetched from)?

Pros / cons: portability, difficulty of resolving individual links, etc.

@jeffnaus
Copy link
Contributor

jeffnaus commented Aug 14, 2018

Discussion with sprint-3-static group:

We recommend that we support both.

Absolute links are required in order to link to external resources.
Absolute links are required for self (is self still required).

Relative links can break when end users pull the records local
The problem of updating links when moving can be overcome.

There are cases in machine learning and other processing where the desire it to copy the whole "directory" and in this case relative links are very useful.

@m-mohr
Copy link
Collaborator

m-mohr commented Sep 5, 2018

I think this has been fixed and can be closed.

@m-mohr m-mohr closed this as completed Sep 5, 2018
@60south
Copy link

60south commented Dec 27, 2018

I realize this issue is closed, but it's what popped up when I went in search for a solution...

@jeffnaus wrote:

The problem of updating links when moving can be overcome.

What do you suggest?

In brief: We are looking at implementing STAC for a large volume of near-real-time remote sensing assets. As the asset files age they will be archived from expensive (fast) storage to longer-term, cheaper storage locations. Of course, this will break any absolute links. As I see it, we have a couple options:

  • Update the links in each STAC item. This means browsing will be broken until the STAC Items have been re-crawled/re-indexed, which will need to occur continuously. Since the assets may be moved several times, this could get very messy.

  • Use permalinks that refer to the current asset (and STAC Item) locations. We'd still need to maintain these, but it's fairly easy and instantaneous. (This is what we're thinking of doing.)

Is there another approach we should look at?

Glenn

@m-mohr
Copy link
Collaborator

m-mohr commented Jan 2, 2019

The suggested solution for your use case was that you use relative links for all links except the link with the relation type self. This still allows navigation through the catalog and updating can be done later as only the reference to self needs to be updated. See also https://github.com/radiantearth/stac-spec/blob/master/item-spec/item-spec.md#relation-types
Of course, you can use permalinks for the self links (and also the other links, but that is not required).

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

4 participants