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

Browseable recommendations and Children conformance class #229

Merged
merged 34 commits into from
Jan 5, 2022
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
67bfa4b
merge and initial catalogs and browseable
philvarner Oct 25, 2021
a7cfb08
finish browseable
philvarner Nov 8, 2021
84bc36c
add template mention
philvarner Nov 8, 2021
f12c2ad
Add Children conformance class
philvarner Nov 8, 2021
7981ce3
Merge branch 'dev' into catalogs-and-browseable
philvarner Dec 3, 2021
5beb369
fix bad merge in CHANGELOG
philvarner Dec 6, 2021
969d125
catalog graphs are not specifically acyclic
philvarner Dec 6, 2021
369ae52
remove bit about aligning with OGC standards
philvarner Dec 6, 2021
9abae23
add Children to root README
philvarner Dec 6, 2021
b568773
Merge branch 'dev' into catalogs-and-browseable
philvarner Dec 7, 2021
a40b9de
add Browseable conformance class
philvarner Dec 10, 2021
c0cda8b
update changelog with STAC API - Browseable
philvarner Dec 16, 2021
d7fbd6d
remove unused openapi file, update order of summary items in children…
philvarner Dec 16, 2021
f8d3d10
updates
philvarner Dec 16, 2021
7b6bd6f
clarify what should be returned by children
philvarner Dec 16, 2021
788be5e
update children openapi example
philvarner Dec 16, 2021
3bcf17b
clarify browseable and children
philvarner Dec 16, 2021
be01abb
wordsmithing
philvarner Dec 16, 2021
c128863
claify browseable vs. search
philvarner Dec 16, 2021
966d433
add mention of single canonical link to Item
philvarner Dec 16, 2021
491af9c
remove mention of search in the browseable landing page example
philvarner Dec 20, 2021
b6d4379
wordsmithing
philvarner Dec 20, 2021
0c8829a
wordsmithing
philvarner Dec 20, 2021
5a694d5
updates
philvarner Dec 20, 2021
5bd2d2e
Merge branch 'dev' into catalogs-and-browseable
philvarner Jan 5, 2022
caa5ef1
Update browseable/README.md
philvarner Jan 5, 2022
03200a5
add link about items link rel in features
philvarner Jan 5, 2022
4443078
add link about items link rel in features
philvarner Jan 5, 2022
d6581b4
Update core/README.md
philvarner Jan 5, 2022
f112c01
clarify browseable example
philvarner Jan 5, 2022
2a54b6a
Update core/README.md
philvarner Jan 5, 2022
435fb5a
remove sub-collection
philvarner Jan 5, 2022
8cc1642
Update core/README.md
philvarner Jan 5, 2022
5353b53
update items lang in core
philvarner Jan 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Added `STAC API - Browseable` conformance class
- Added `STAC API - Children` conformance class
- Added description of how to support both search and browse in an API.
- The paging mechanism via a Link with rel `next` or `prev` as defined for Item Search can also be used
for the STAC API - Features endpoint `/collections/{collection_id}/items`, as described in OAFeat.
- The paging mechanism via a Link with rel `next` or `prev` as defined for items can also be used
Expand Down Expand Up @@ -56,7 +59,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Support binding Sort, Fields, and Context Extensions to STAC Features items resource
endpoint (`/collections/{collection_id}/items`)
endpoint (`/collections/{collectionId}/items`)
- In Collections, added `canonical` rel type, added `/` and `/api` to list of endpoints
- In Item Search, added endpoint table

Expand Down
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ The SpatioTemporal Asset Catalog (STAC) family of specifications aim to standard
A 'spatiotemporal asset' is any file that represents information about the earth captured in a certain space and
time. The core STAC specifications live in the GitHub repository [radiantearth/stac-spec](https://github.com/radiantearth/stac-spec).


A STAC API is the dynamic version of a SpatioTemporal Asset Catalog. It returns a STAC [Catalog](stac-spec/catalog-spec/catalog-spec.md),
[Collection](stac-spec/collection-spec/collection-spec.md), [Item](stac-spec/item-spec/item-spec.md),
or a STAC API [ItemCollection](fragments/itemcollection/README.md), depending on the endpoint.
Expand Down Expand Up @@ -57,17 +56,25 @@ The **[Overview](overview.md)** document describes all the various parts of the
The *[core](core/)* folder describes the core STAC API specification that enables browsing catalogs and
retrieving the API capabilities. This includes the OpenAPI schemas for STAC Item, Catalog and Collection objects.

**STAC API - Item Search Specification:**
The *[item-search](item-search)* folder contains the Item Search specification, which enables
cross-collection search of STAC Item objects at a `search` endpoint, as well as a number of extensions.
**STAC API - Collections:**
The *[collections](collections)* folder describes how a STAC API Catalog can advertise the Collections it contains.

**STAC API - Features:**
The *[ogcapi-features](ogcapi-features)* folder describes how a STAC API can fully implement [OGC API -
Features](http://docs.opengeospatial.org/is/17-069r3/17-069r3.html) to expose individual `items` endpoints for search of
each STAC collection. It also includes extensions that can be used to further enhance OAFeat.
philvarner marked this conversation as resolved.
Show resolved Hide resolved

**STAC API - Collections:**
The *[collections](collections)* folder describes how a STAC API can advertise the Collections it contains.
**STAC API - Item Search Specification:**
The *[item-search](item-search)* folder contains the Item Search specification, which enables
cross-collection search of STAC Item objects at a `search` endpoint, as well as a number of extensions.

**STAC API - Children:**
The *[children](children)* folder describes how a STAC API Catalog can advertise the children (sub-catalogs or sub-collections)
it contains.

**STAC API - Browseable:**
The *[browseable](browseable)* folder describes how a STAC API Catalog can advertise that all Items can be accessed
by following through `child` and `item` link relations.

**Extensions:**
The *[extensions](extensions.md) document* describes how STAC incubates new functionality, and it links to the existing
Expand Down
101 changes: 101 additions & 0 deletions browseable/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# STAC API - Browseable Specification

- [STAC API - Browseable Specification](#stac-api---browseable-specification)
- [Link Relations](#link-relations)
- [Endpoints](#endpoints)
- [Example Landing Page for STAC API - Browseable](#example-landing-page-for-stac-api---browseable)
- [Extensions](#extensions)

- **OpenAPI specification:** none
- **Conformance URIs:**
- <https://api.stacspec.org/v1.0.0-beta.5/browseable>
- <https://api.stacspec.org/v1.0.0-beta.5/core>
- **Extension [Maturity Classification](../extensions.md#extension-maturity):** Pilot
- **Dependencies**: [STAC API - Core](../core)

A STAC API conforming to the `STAC API - Browseable` conformance class must be structured such that all
all Items in the catalog can be accessed by following `child` and `item` link relations. This is a more significant
constraint than a STAC API without this conformance class or a STAC Catalog that is available over HTTP but does not
implement STAC API, neither of which have any guarantee regarding the reachability of Items.
philvarner marked this conversation as resolved.
Show resolved Hide resolved

Recommendations for structuring Catalogs hierarchically can be found in
[Structuring Catalog Hierarchies](../core/README.md#structuring-catalog-hierarchies) from the `STAC API - Core` specification.

## Link Relations

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

Additionally, `child` relations must exist to child Catalogs and Collections and `item` relations to Items, such that
every Item in the Catalog can be accessed by traversing these relations.

| **rel** | **href** | **From** | **Description** |
| ------- | -------- | --------- | -------------------------------------- |
| `child` | various | STAC Core | The child STAC Catalogs & Collections. |
| `item` | various | STAC Core | The child STAC Items. |

Note that there is a different link relation `items` (plural)
used by the `STAC API - Features` conformance class that links from a collection to the items in
that collection.
philvarner marked this conversation as resolved.
Show resolved Hide resolved

## Endpoints

This conformance class also requires for the endpoints in the [STAC API - Core](../core) conformance class to be implemented.

This conformance class adds no additional endpoints.

## Example Landing Page for STAC API - Browseable

This JSON is what would be expected from an API that implements `STAC API - Browseable`.

This particular catalog provides both the ability to browse down to child Catalog objects through its
`child` links, which then will eventually reach Items through `item` link relations.
Copy link
Collaborator

Choose a reason for hiding this comment

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

The example below doesn't seem particularly meaningful. Could be good to try to illustrate the point more, since usually the example helps show that. Perhaps a little diagram, that shows a non-browsable catalog vs a browsable one? Or perhaps just explain after the example that a catalog not implementing browsable would not have the 'child' links, but it would have them in the 'data' rel link. I think it'd be good to just provide more context, and to help make it clear to existing implementations what they need to do.


```json
{
"stac_version": "1.0.0",
"id": "example-stac",
"title": "A simple STAC API Example, implementing STAC API - Browseable",
"description": "This Catalog aims to demonstrate the a simple landing page",
"type": "Catalog",
"conformsTo" : [
"https://api.stacspec.org/v1.0.0-beta.5/core",
"https://api.stacspec.org/v1.0.0-beta.5/browseable"
],
"links": [
{
"rel": "self",
"type": "application/json",
"href": "https://stacserver.org"
},
{
"rel": "root",
"type": "application/json",
"href": "https://stacserver.org"
},
{
"rel": "service-desc",
"type": "application/vnd.oai.openapi+json;version=3.0",
"href": "https://stacserver.org/api"
},
{
"rel": "service-doc",
"type": "text/html",
"href": "https://stacserver.org/api.html"
},
{
"rel": "child",
"type": "application/json",
"href": "https://stacserver.org/catalogs/sentinel-2",
},
{
"rel": "child",
"type": "application/json",
"href": "https://stacserver.org/catalogs/landsat-8",
}
]
}
```

## Extensions

None.
214 changes: 214 additions & 0 deletions children/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
# STAC API - Children

Choose a reason for hiding this comment

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

Are catalogs returned by this endpoint allowed to implement item search (i.e. can they have a /search endpoint)?

Copy link

@geospatial-jeff geospatial-jeff Nov 27, 2021

Choose a reason for hiding this comment

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

The landing page is just a catalog, and itself implements /search, so I'm guessing this is allowed. And the /search response would only return items that are contained by the catalog (potentially across many collections).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, any (sub) Catalog can implement a search endpoint.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for bringing this up. I thought I'd explicitly mentioned this, but I can't find it, so I'll make sure to add something.


- [STAC API - Children](#stac-api---children)
- [Link Relations](#link-relations)
- [Endpoints](#endpoints)
- [Pagination](#pagination)
- [Example](#example)

- **OpenAPI specification:** [openapi.yaml](openapi.yaml) ([rendered version](https://api.stacspec.org/v1.0.0-beta.5/children))
- **Conformance URIs:**
- <https://api.stacspec.org/v1.0.0-beta.5/children>
- <https://api.stacspec.org/v1.0.0-beta.5/core>
- **Extension [Maturity Classification](../extensions.md#extension-maturity):** Pilot
- **Dependencies**: [STAC API - Core](../core)

A STAC API Landing Page (a Catalog) can return information about the Catalog and Collection child objects
it contains using the link relation `children` to an endpoint `/children`. The purpose of this endpoint is
to present a single resource from which clients can retrieve
all the immediate child objects of a Catalog, which may be Catalog or Collection objects.
The `child` link relations in a Catalog already allow for describing these
relationships, but require a client to retrieve each resource URL to find any information about the children
(e.g., title, description), which can cause significant performance issues in user-facing applications.

It is recommended that the Catalog and Collection objects returned by the `/children` endpoint are the same
as those referenced by `child` link relations in the STAC API Landing Page. Following these semantics, it should
return the immediate children of the root Catalog, rather than all descendant catalogs or collections.

## Link Relations

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

The following Link relations shall exist in the Landing Page (root).

| **rel** | **href** | **From** | **Description** |
| ---------- | ----------- | --------------- | -------------------------------- |
| `children` | `/children` | STAC API - Children | List of children of this catalog |

The following Link relations shall exist in the `/children` endpoint response.

| **rel** | **href** | **From** | **Description** |
| ------- | ----------- | ------------------- | --------------- |
| `root` | `/` | STAC Core | The root URI |
| `self` | `/children` | STAC API - Children | Self reference |

## Endpoints

This conformance class also requires for the endpoints in the [STAC API - Core](../core) conformance class to be implemented.

| Endpoint | Returns | Description |
| ----------- | -------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `/children` | JSON | Object with a list of child Catalogs and Collections |

STAC APIs implementing the `STAC API - Children` conformance class must support HTTP GET operation at
`/children`, with the return JSON document consisting of an array of all child Catalogs and Collections in a field `children` and an
array of Links in a field `links`.

## Pagination

The `/children` endpoint supports a pagination mechanism that aligns with pagination as described in the
OGC API - Common - Part 2: Geospatial Data specification. This is described in detail in
the [STAC - Features Collection Pagination section](../ogcapi-features/README.md#collection-pagination).
To the greatest extent possible, the catalog should be structured such that all children can be
retrieved from the endpoint in a single call.

## Example

Below is a minimal example, but captures the essence. Each object in the `children` array
philvarner marked this conversation as resolved.
Show resolved Hide resolved
must be a valid STAC [Collection](../stac-spec/collection-spec/README.md) or [Catalog](../stac-spec/catalog-spec/README.md),
and each must have a `self` link that communicates its canonical location. And then
the links section must include a `self` link, and it must also link to alternate representations
(like html) of the collection.

The STAC API Landing Page should look like the following (note the `child` link relations):

```json
{
"stac_version": "1.0.0",
"id": "example-stac",
"title": "A simple STAC API Example, implementing STAC API - Children",
"description": "This Catalog aims to demonstrate the a simple landing page",
"type": "Catalog",
"conformsTo" : [
"https://api.stacspec.org/v1.0.0-beta.5/core",
"https://api.stacspec.org/v1.0.0-beta.5/children",
"https://api.stacspec.org/v1.0.0-beta.5/browseable"
],
"links": [
{
"rel": "self",
"type": "application/json",
"href": "https://stacserver.org"
},
{
"rel": "root",
"type": "application/json",
"href": "https://stacserver.org"
},
{
"rel": "service-desc",
"type": "application/vnd.oai.openapi+json;version=3.0",
"href": "https://stacserver.org/api"
},
{
"rel": "service-doc",
"type": "text/html",
"href": "https://stacserver.org/api.html"
},
{
"rel": "children",
"type": "application/json",
"href": "https://stacserver.org/children",
},
{
"rel": "child",
"type": "application/json",
"href": "https://stacserver.org/catalogs/cool-data",
},
{
"rel": "child",
"type": "application/json",
"href": "https://stacserver.org/catalogs/some-other-data",
}
]
}
```

The `/children` endpoint response object should look as follows:

```json
{
"children": [
{
"stac_version": "1.0.0",
"stac_extensions": [ ],
"id": "cool-data",
"title": "Cool Data from X Satellite",
"description": "A lot of awesome words describing the data",
"type": "Catalog",
"license": "CC-BY",
"extent": {
"spatial": {
"bbox": [[-135.17, 36.83, -51.24, 62.25]]
},
"temporal": {
"interval": [["2009-01-01T00:00:00Z",null]]
}
},
"links": [
{
"rel": "root",
"type": "application/json",
"href": "https://stacserver.org"
},
{
"rel": "parent",
"type": "application/json",
"href": "https://stacserver.org"
},
{
"rel": "self",
"type": "application/json",
"href": "https://stacserver.org/catalogs/cool-data"
}
],
},
{
"stac_version": "1.0.0",
"stac_extensions": [ ],
"id": "some-other-data",
"title": "Some Other Data from Y Satellite",
"description": "More awesome words describing the data",
"type": "Catalog",
"license": "CC-BY",
"extent": {
"spatial": {
"bbox": [[-135.17, 36.83, -51.24, 62.25]]
},
"temporal": {
"interval": [["2009-01-01T00:00:00Z",null]]
}
},
"links": [
{
"rel": "root",
"type": "application/json",
"href": "https://stacserver.org"
},
{
"rel": "parent",
"type": "application/json",
"href": "https://stacserver.org"
},
{
"rel": "self",
"type": "application/json",
"href": "https://stacserver.org/catalogs/some-other-data"
}
],
}
],
"links": [
{
"rel": "root",
"type": "application/json",
"href": "https://stacserver.org"
},
{
"rel": "self",
"type": "application/json",
"href": "https://stacserver.org/children"
}
]
}
```
Loading