Skip to content

Commit 13d3dac

Browse files
authored
refactor link relation tables, make parent not a required field (#407)
* refactor link relation tables, make parent not a required field
1 parent 5dd781d commit 13d3dac

File tree

4 files changed

+52
-59
lines changed

4 files changed

+52
-59
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
## Changed
1111

1212
- Browseable has been moved to an extension, now located at <https://github.com/stac-api-extensions/browseable>
13+
- Link relation `parent` is no longer a required link for Collections or Items
1314

1415
## Added
1516

core/README.md

+9-15
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,16 @@ While the STAC definition of Link does not require the `type` field,
6767
*STAC API - Core* requires all Links to have this field.
6868
If the target of a Link's `type` is unknown, `type` SHOULD be set to `application/octet-stream` or `text/plain`.
6969

70-
The following Link relations must exist in the Landing Page (root).
70+
The following Link relations are defined for the Landing Page (root).
7171

72-
| **rel** | **href** | **Media Type** | **From** | **Description** |
73-
| -------------- | -------- | ---------------- | --------------- | ---------------------------------------------------- |
74-
| `root` | `/` | application/json | STAC API - Core | The root URI |
75-
| `self` | `/` | application/json | OAFeat | Self reference, same as root URI |
76-
| `service-desc` | `/api` | various | OAFeat | The service description in a machine-readable format |
72+
| **rel** | **href** | **Media Type** | **From** | **Description** |
73+
| -------------- | ----------- | -------------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
74+
| `root` | `/` | application/json | STAC API - Core | **REQUIRED** The root URI |
75+
| `self` | `/` | application/json | OAFeat | **REQUIRED** Self reference, same as root URI |
76+
| `service-desc` | `/api` | various | OAFeat | **REQUIRED** The service description in a machine-readable format |
77+
| `service-doc` | `/api.html` | text/html | OAFeat | A human-consumable service description. The path for this endpoint is only recommended to be `/api.html`, but may be another path. |
78+
| `child` | various | application/json | STAC API - Core | The child STAC Catalogs & Collections. |
79+
| `item` | various | application/geo+json | STAC API - Core | The child STAC Items. |
7780

7881
The path for the `service-desc` endpoint is recommended to be `/api`, but may be another path. Recommended to be
7982
OpenAPI 3.0 or 3.1 with media types `application/vnd.oai.openapi` (YAML),
@@ -85,18 +88,9 @@ page, for example, in the form of [Redoc](https://github.com/Redocly/redoc) inte
8588
, but any format is allowed. The Link `type` field should correspond to whatever format or formats are
8689
supported by this endpoint, e.g., `text/html`.
8790

88-
| **rel** | **href** | **Media Type** | **From** | **Description** |
89-
| ------------- | ----------- | -------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------- |
90-
| `service-doc` | `/api.html` | text/html | OAFeat | A human-consumable service description. The path for this endpoint is only recommended to be `/api.html`, but may be another path. |
91-
9291
Additionally, `child` relations may exist to child Catalogs and Collections and `item` relations to Items. These
9392
relations form a directed graph that enables traversal from a root catalog or collection to items.
9493

95-
| **rel** | **href** | **Media Type** | **From** | **Description** |
96-
| ------- | -------- | -------------------- | --------------- | -------------------------------------- |
97-
| `child` | various | application/json | STAC API - Core | The child STAC Catalogs & Collections. |
98-
| `item` | various | application/geo+json | STAC API - Core | The child STAC Items. |
99-
10094
While it is valid to have `item` links from the landing page, most STAC API implementations
10195
serve large numbers of features, so they will typically use several layers of intermediate `child` links to sub-catalogs and collections before
10296
getting to Item objects. These relations form a directed graph

item-search/README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -55,23 +55,23 @@ If the target of a Link's `type` is unknown, `type` SHOULD be set to `applicatio
5555

5656
This conformance class also requires implementation of the link relations in the [STAC API - Core](../core) conformance class.
5757

58-
The following Link relations must exist in the Landing Page (root).
58+
The following Link relations are defined for the Landing Page (root).
5959

60-
| **rel** | **href** | **Media Type** | **From** | **Description** |
61-
| -------- | --------- | -------------------- | ---------------------- | --------------------------- |
62-
| `search` | `/search` | application/geo+json | STAC API - Item Search | URI for the Search endpoint |
60+
| **rel** | **href** | **Media Type** | **From** | **Description** |
61+
| -------- | --------- | -------------------- | ---------------------- | ---------------------------------------- |
62+
| `search` | `/search` | application/geo+json | STAC API - Item Search | **REQUIRED** URI for the Search endpoint |
6363

6464
This `search` link relation must have a `type` of `application/geo+json`. If no `method` attribute is
6565
specified, it is assumed to represent a GET request. If the server supports both GET and POST requests, two links should be included, one with a `method` of `GET` one with a `method` of `POST`.
6666

6767
Other links with relation `search` may be included that advertise other content types the server may respond
6868
with, but these other types are not part of the STAC API requirements.
6969

70-
The following Link relations must exist in the `/search` endpoint response.
70+
The following Link relations are defined for the `/search` endpoint response.
7171

72-
| **rel** | **href** | **From** | **Description** |
73-
| ------- | -------- | ---------------------- | --------------- |
74-
| `root` | `/` | STAC API - Item Search | The root URI |
72+
| **rel** | **href** | **From** | **Description** |
73+
| ------- | -------- | ---------------------- | ------------------------- |
74+
| `root` | `/` | STAC API - Item Search | **REQUIRED** The root URI |
7575

7676
## Endpoints
7777

ogcapi-features/README.md

+34-36
Original file line numberDiff line numberDiff line change
@@ -106,37 +106,32 @@ If the target of a Link's `type` is unknown, `type` SHOULD be set to `applicatio
106106

107107
### Landing Page (/)
108108

109-
The following Link relations must exist in the Landing Page (root).
109+
The following Link relations are defined for the Landing Page (root).
110110

111-
| **rel** | **href** | **Media Type** | **From** | **Description** |
112-
| ------------- | -------------- | ---------------- | -------- | ------------------- |
113-
| `conformance` | `/conformance` | application/json | OAFeat | Conformance URI |
114-
| `data` | `/collections` | application/json | OAFeat | List of Collections |
111+
| **rel** | **href** | **Media Type** | **From** | **Description** |
112+
| ------------- | -------------- | ---------------- | -------- | -------------------------------- |
113+
| `conformance` | `/conformance` | application/json | OAFeat | **REQUIRED** Conformance URI |
114+
| `data` | `/collections` | application/json | OAFeat | **REQUIRED** List of Collections |
115115

116116
### Collections (/collections)
117117

118-
The following Link relations must exist in the `/collections` endpoint response.
118+
The following Link relations are defined for the `/collections` endpoint response.
119119

120-
| **rel** | **href** | **Media Type** | **From** | **Description** |
121-
| ------- | -------------- | ---------------- | ------------------------------------------- | --------------- |
122-
| `root` | `/` | application/json | STAC API - Features, STAC API - Collections | The root URI |
123-
| `self` | `/collections` | application/json | OAFeat | Self reference |
120+
| **rel** | **href** | **Media Type** | **From** | **Description** |
121+
| ------- | -------------- | ---------------- | ------------------------------------------- | --------------------------- |
122+
| `root` | `/` | application/json | STAC API - Features, STAC API - Collections | **REQUIRED** The root URI |
123+
| `self` | `/collections` | application/json | OAFeat | **REQUIRED** Self reference |
124124

125125
### Collection (/collections/{collectionId})
126126

127-
The following Link relations must exist in the Collection object returned from the `/collections/{collectionId}` endpoint.
127+
The following Link relations are defined for the Collection object returned from the `/collections/{collectionId}` endpoint.
128128

129-
| **rel** | **href** | **Media Type** | **From** | **Description** |
130-
| -------- | ----------------------------- | ---------------- | ------------------------------------------- | ------------------------------------------ |
131-
| `root` | `/` | application/json | STAC API - Features, STAC API - Collections | The root URI |
132-
| `parent` | `/` | application/json | OAFeat | Parent reference, usually the root Catalog |
133-
| `self` | `/collections/{collectionId}` | application/json | OAFeat | Self reference |
134-
135-
Additionally, these relations may exist for the `/collections/{collectionId}` endpoint:
136-
137-
| **rel** | **href** | **Media Type** | **From** | **Description** |
138-
| ----------- | -------- | -------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
139-
| `canonical` | various | various | STAC API - Core | Provides the preferred paths to get to STAC Collection and Item objects, if they differ from the URL that was used to retrieve the STAC object and thus duplicate other content. This can be useful in federated catalogs that present metadata that has a different location than the source metadata. |
129+
| **rel** | **href** | **Media Type** | **From** | **Description** |
130+
| ----------- | ----------------------------- | ---------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
131+
| `root` | `/` | application/json | STAC API - Features, STAC API - Collections | **REQUIRED** The root URI |
132+
| `self` | `/collections/{collectionId}` | application/json | OAFeat | **REQUIRED** Self reference |
133+
| `parent` | `/` | application/json | STAC Collection | Parent reference, usually the root Catalog |
134+
| `canonical` | various | various | STAC API - Core | Provides the preferred paths to get to STAC Collection and Item objects, if they differ from the URL that was used to retrieve the STAC object and thus duplicate other content. This can be useful in federated catalogs that present metadata that has a different location than the source metadata. |
140135

141136
Usually, the `self` link in a Collection must link to the same URL that was used to request
142137
it. However, implementations may choose to have the canonical location of the Collection be
@@ -147,26 +142,29 @@ of that Collection, rather than the API sub-path of `/collections`.
147142

148143
### Collection Items (/collections/{collectionId}/items)
149144

150-
The following Link relations must exist in the ItemCollection object returned from the `/collections/{collectionId}/items` endpoint.
145+
The following Link relations are defined for the ItemCollection object returned from the `/collections/{collectionId}/items` endpoint.
151146

152-
| **rel** | **href** | **Media Type** | **From** | **Description** |
153-
| ------------ | ----------------------------------- | -------------------- | ------------------- | -------------------- |
154-
| `root` | `/` | application/json | STAC API - Features | The root URI |
155-
| `self` | `/collections/{collectionId}/items` | application/geo+json | OAFeat | Self reference |
156-
| `collection` | `/collections/{collectionId}` | application/json | OAFeat | Collection reference |
147+
| **rel** | **href** | **Media Type** | **From** | **Description** |
148+
| ------------ | ----------------------------------- | -------------------- | ------------------- | --------------------------------- |
149+
| `root` | `/` | application/json | STAC API - Features | **REQUIRED** The root URI |
150+
| `self` | `/collections/{collectionId}/items` | application/geo+json | OAFeat | **REQUIRED** Self reference |
151+
| `collection` | `/collections/{collectionId}` | application/json | OAFeat | **REQUIRED** Collection reference |
157152

158153
### Items (/collections/{collectionId}/items/{itemId})
159154

160-
The following Link relations must exist in the Item object returned from the `/collections/{collectionId}/items/{itemId}` endpoint.
155+
The following Link relations are defined for the Item object returned from the `/collections/{collectionId}/items/{itemId}` endpoint.
161156

162-
| **rel** | **href** | **Media Type** | **From** | **Description** |
163-
| -------- | -------------------------------------------- | -------------------- | ------------------- | --------------------------------------------------- |
164-
| `root` | `/` | application/json | STAC API - Features | The root URI |
165-
| `collection` | `/collections/{collectionId}` | application/json | STAC Item | The containing Collection |
166-
| `parent` | `/collections/{collectionId}` | application/json | STAC Item | Parent reference, usually the containing Collection |
167-
| `self` | `/collections/{collectionId}/items/{itemId}` | application/geo+json | OAFeat | Self reference |
157+
| **rel** | **href** | **Media Type** | **From** | **Description** |
158+
| ------------ | -------------------------------------------- | -------------------- | ------------------- | --------------------------------------------------- |
159+
| `root` | `/` | application/json | STAC API - Features | **REQUIRED** The root URI |
160+
| `self` | `/collections/{collectionId}/items/{itemId}` | application/geo+json | OAFeat | **REQUIRED** Self reference |
161+
| `collection` | `/collections/{collectionId}` | application/json | STAC Item | **REQUIRED** The containing Collection |
162+
| `parent` | `/collections/{collectionId}` | application/json | STAC Item | Parent reference, usually the containing Collection |
168163

169-
The `parent` link for an Item may point to a Collection or a Catalog. The `collection` link for an Item will always point to the containing Collection. Links to a Collection must point to the `/collections/{collectionId}` endpoint, rather than the API sub-path of `/collections/{collectionId}/items/`.
164+
The `parent` link for an Item may point to a Collection or a Catalog. The
165+
`collection` link for an Item will always point to the containing Collection.
166+
Links to a Collection must point to the `/collections/{collectionId}` endpoint,
167+
rather than the API sub-path of `/collections/{collectionId}/items/`.
170168

171169
## Endpoints
172170

0 commit comments

Comments
 (0)