Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mojodna
Copy link
Contributor

@mojodna mojodna commented Feb 25, 2019

Motivation: allow relative links to be easily resolved without traversing up a catalog tree and to provide information on the catalog structure within a single document that would otherwise have to be determined by reading multiple documents.

Introduce href:from to indicate the path from the root to the current document.

At this point, self becomes the filename and duplicates the filename portion of href:from, so that may indicate an additional direction.

The only absolute URL in this catalog is now the root catalog's self. That, too, could be removed and stashed in a sidecar file to be used for resolution.

Inclusion of the path from a root document (rel=root), allows knowledge of the root document’s URI to be used to resolve relative links in child documents. The root document’s rel=self can be absolute or it can be provided externally, allowing all links in a catalog to be relative (including rel=self).

href:from is a proposal with no prior art; HTML 4’s rev attribute comes close to describing this relationship, but isn’t quite right (and was dropped in HTML5). It also duplicates rel=self, potentially suggested an alternative link role (to self) where the href is the path from the root document. (This breaks link crawlers, as href is expected to be relative from the current document, rather than from another.)

Refs radiantearth/stac-spec#401

"rel": "collection",
"href": "../../catalog.json"
"href": "../../collections/planet-collection.json",
"href:from": "../hurricane-harvey/0831/Houston-East-20170831-103f-100d-0f4f-RGB.json"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mojodna this should be hurricane-harvey/0831/..., right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is right. From collections/, the reverse link needs to go up a level to descend a different sibling.

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

Successfully merging this pull request may close these issues.

2 participants