Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
197 commits
Select commit Hold shift + click to select a range
ef2a338
Related to Issue #373
fredliporace Mar 5, 2019
2509020
self as strongly required
fredliporace Mar 5, 2019
a38bd74
Including catalog and collection
fredliporace Mar 5, 2019
4f6a8e7
Fixing bad copy'n'paste
fredliporace Mar 5, 2019
fc31304
redefinend fields extension to allow filtering on any property in doc…
Mar 5, 2019
6ba966f
removed ide files
Mar 5, 2019
c57ae4a
Update to JSON Schema draft 07
mojodna Nov 21, 2018
d6fe93b
Remove JavaScript validator
mojodna Mar 5, 2019
9768913
Clean up validation README
mojodna Mar 5, 2019
7dac6c3
Merge pull request #360 from mojodna/json-schema-draft-07
cholmes Mar 5, 2019
a8521d4
Update item-spec/item-spec.md
mojodna Mar 5, 2019
2032fd1
Update item-spec/item-spec.md
mojodna Mar 5, 2019
17382f5
Update item-spec/item-spec.md
mojodna Mar 5, 2019
e5a189e
Update item-spec/item-spec.md
mojodna Mar 5, 2019
6754166
root as strongly recommended
fredliporace Mar 5, 2019
003f817
Merge branch 'self' of github.com:fredliporace/stac-spec into self
fredliporace Mar 5, 2019
254b6c5
Merge branch 'dev' into self
fredliporace Mar 5, 2019
4d60c3d
[STAC-417] Added href to the asset called index
jbants Mar 7, 2019
5fefb33
Fixed band schema for SAR
m-mohr Mar 8, 2019
3516e10
Updated outdated summary of the scientific extension.
m-mohr Mar 11, 2019
6e28995
Fixed descriptions.
m-mohr Mar 11, 2019
a46569d
Merge pull request #414 from fredliporace/self
cholmes Mar 12, 2019
d5d0ed4
Merge branch 'dev' into STAC-417
cholmes Mar 12, 2019
6da7706
Merge pull request #418 from jbants/STAC-417
cholmes Mar 12, 2019
fee4249
Merge branch 'dev' into sar-bands-description-fix
cholmes Mar 12, 2019
5175efc
Merge pull request #419 from radiantearth/sar-bands-description-fix
cholmes Mar 12, 2019
1ed9673
Merge branch 'dev' into dev
cholmes Mar 12, 2019
acbc643
Merge branch 'dev' into scientific-extension-desctiption
cholmes Mar 12, 2019
d38b84a
remove reference to self being required
cholmes Mar 12, 2019
21bc51e
First outline of best practice doc
cholmes Mar 12, 2019
4b48b93
Merge pull request #420 from radiantearth/scientific-extension-descti…
m-mohr Mar 13, 2019
b927b73
Updated href description
cholmes Mar 13, 2019
2524dfd
More updates
cholmes Mar 14, 2019
1773634
Add observation_direction to SAR extension (#404)
m-mohr Mar 20, 2019
5dc1fa3
SAR: Added incidence_angle (#405), replaced absolute_orbit with relat…
m-mohr Mar 20, 2019
6120495
Renamed incidence_angle_center.
m-mohr Mar 20, 2019
ed91673
SAR: Avoid array fields in favor of primitive types (#422)
m-mohr Mar 20, 2019
ed67a60
Updates
cholmes Mar 20, 2019
998408e
Merge branch 'dev' into catalog-best-practices
m-mohr Mar 20, 2019
f6ba67d
Add collection property to STAC Items (#384).
m-mohr Mar 20, 2019
6312810
Field is required if a collection rel type is present.
m-mohr Mar 20, 2019
7275ece
Added absolute_orbit back, removed off_nadir.
m-mohr Mar 21, 2019
06e5de3
Minor Spelling
and-viceversa Mar 25, 2019
31c6533
Merge branch 'dev' into dev
matthewhanson Mar 26, 2019
50aef2c
Merge branch 'dev' into master
matthewhanson Mar 26, 2019
b8a7c49
Merge pull request #431 from and-viceversa/master
matthewhanson Mar 26, 2019
b18d7d4
Merge branch 'dev' into dev
matthewhanson Mar 27, 2019
dedf054
Merge branch 'dev' into item-collection-property-384
matthewhanson Mar 27, 2019
b73cbce
Merge branch 'dev' into sar-incidence-angle-center-405
m-mohr Mar 28, 2019
6f43683
Merge branch 'dev' into sar-primitives-422
m-mohr Apr 3, 2019
86398a8
Merge branch 'dev' into sar-observcation-direction-404
m-mohr Apr 3, 2019
51d383c
Updated aboslute and relative orbit.
m-mohr Apr 3, 2019
d3194a7
Merge branch 'dev' into catalog-best-practices
cholmes Apr 17, 2019
246e82a
Updates based on feedback
cholmes Apr 17, 2019
5d1e694
added links to catalog best practices document
cholmes Apr 17, 2019
30f1f20
refactored catalog types to best practices, as its more appropriate t…
cholmes Apr 17, 2019
6466294
initial draft consolidating API documentation
matthewhanson Apr 20, 2019
07fe700
reorg API specification, remove redundancies and cleanup
matthewhanson Apr 20, 2019
4ad4e60
add in autogenerated OpenAPI spec docs for core and full (core + exte…
matthewhanson Apr 20, 2019
ad9a3bb
Merge pull request #429 from radiantearth/item-collection-property-384
cholmes Apr 20, 2019
c9b754c
Merge branch 'dev' into dev
cholmes Apr 20, 2019
7096914
Merge branch 'dev' into sar-primitives-422
cholmes Apr 20, 2019
c4117f3
Merge branch 'dev' into sar-incidence-angle-center-405
cholmes Apr 20, 2019
65df312
Merge branch 'dev' into sar-observcation-direction-404
cholmes Apr 20, 2019
51f58fd
Merge pull request #415 from joshfix/dev
matthewhanson Apr 22, 2019
8aae2ab
Merge branch 'dev' into sar-observcation-direction-404
cholmes Apr 22, 2019
7741097
Merge branch 'dev' into catalog-best-practices
cholmes Apr 22, 2019
482964b
fixed link
cholmes Apr 22, 2019
0a9d6e1
Merge pull request #425 from radiantearth/sar-observcation-direction-404
cholmes Apr 22, 2019
65ab2e8
Removed roadmap #296
cholmes Apr 22, 2019
5f9e143
Merge branch 'dev' into catalog-best-practices
cholmes Apr 22, 2019
959a218
Merge pull request #428 from radiantearth/catalog-best-practices
cholmes Apr 22, 2019
9df264b
Added HTML section to catalog best practices
cholmes Apr 22, 2019
e5f6810
Some language improvements
cholmes Apr 22, 2019
5c42541
added info about html
cholmes Apr 22, 2019
4531eef
resolve merge conflict
matthewhanson Apr 23, 2019
2822884
updated auto-generated STAC OpenAPI docs
matthewhanson Apr 23, 2019
1ade01f
some readme updates and new STAC API spec document
matthewhanson Apr 23, 2019
d3e2095
README formatting + combine STAC fragments
matthewhanson Apr 23, 2019
aa5e0db
API docs; merge WFS3 into STAC
matthewhanson Apr 23, 2019
2505134
rename WFS3-core.yaml to WFS3.yaml
matthewhanson Apr 23, 2019
4f9669a
Merge branch 'dev' into sar-primitives-422
m-mohr Apr 23, 2019
15eb0c3
Merge pull request #427 from radiantearth/sar-primitives-422
m-mohr Apr 23, 2019
dfd106a
Merge branch 'dev' into sar-incidence-angle-center-405
m-mohr Apr 23, 2019
ebfb809
Merge branch 'dev' into remove-roadmap.md
m-mohr Apr 23, 2019
0eff721
Merge pull request #435 from radiantearth/remove-roadmap.md
m-mohr Apr 23, 2019
7bd45b4
Merge branch 'dev' into sar-incidence-angle-center-405
cholmes Apr 23, 2019
8e49d5b
Merge branch 'dev' into html-practices
cholmes Apr 23, 2019
4053b83
Merge pull request #426 from radiantearth/sar-incidence-angle-center-405
m-mohr Apr 23, 2019
c4bd055
Merge branch 'dev' into html-practices
cholmes Apr 23, 2019
96fa260
cleanup README
matthewhanson Apr 24, 2019
dde4a48
update API readme and spec
matthewhanson Apr 25, 2019
c6fcbbf
add API extension readme
matthewhanson Apr 25, 2019
be60ffe
move transaction extension to api-spec folder
matthewhanson Apr 25, 2019
d896118
add folder for each API extension
matthewhanson Apr 25, 2019
a969119
add links to API extensions from README
matthewhanson Apr 25, 2019
3210737
Merge branch 'dev' of github.com:radiantearth/stac-spec into feature/…
matthewhanson Apr 25, 2019
e35a3e9
update extension readmes
matthewhanson Apr 25, 2019
2baaaa1
rename api definitions to openapi-schemas
matthewhanson Apr 25, 2019
16a9dc7
rename openapi files
matthewhanson Apr 25, 2019
b93e285
update changelog
matthewhanson Apr 25, 2019
fdc1e1f
remove unncessary info about the API in catalog and collection readmes
matthewhanson Apr 25, 2019
92dc3dd
some initial examples
matthewhanson Apr 26, 2019
cd5f843
cleaned up API spec
matthewhanson Apr 26, 2019
214f4d9
final pass through API readme
matthewhanson Apr 26, 2019
3c02e83
add info for creating fragments for new extensions
matthewhanson Apr 26, 2019
0c58b6d
fix some typos
matthewhanson Apr 26, 2019
314b951
expand API examples
matthewhanson Apr 26, 2019
93bea10
add intersects filter to core spec (it is in the core YAML doc)
matthewhanson Apr 26, 2019
94a87b7
fix typo
matthewhanson Apr 26, 2019
01f05ad
update API Query extension readme
matthewhanson Apr 26, 2019
429f466
readme typo
matthewhanson Apr 26, 2019
86aa57e
add page parameter to core STAC
matthewhanson Apr 26, 2019
c81c8cb
Edits for clarity
cholmes Apr 27, 2019
e0c48fb
Updates to language
cholmes Apr 27, 2019
76c91aa
remove prefix from API extensions header
matthewhanson Apr 27, 2019
13275fd
update transaction API ext readme
matthewhanson Apr 27, 2019
aad824d
remove code block from table
matthewhanson Apr 27, 2019
417fd6a
add link for datetime format
matthewhanson Apr 27, 2019
9de0b3a
add note about Catalog and links for API
matthewhanson Apr 27, 2019
3bc995f
add link to API extensions from content extensions
matthewhanson Apr 28, 2019
022ae4e
change openapi schema to openapi definition
matthewhanson Apr 28, 2019
e9438f4
Updated dependencies to solve vulnerabilities and fixed URL to STAC h…
m-mohr Apr 29, 2019
14006c3
Merge pull request #432 from radiantearth/feature/cleanup_api
m-mohr Apr 29, 2019
71bc2b7
Merge remote-tracking branch 'origin/dev' into feature/add_page
m-mohr Apr 29, 2019
8f777d6
References to some fragments were invalid - not sure why this didn't …
m-mohr Apr 29, 2019
0ad227b
Added search link to spec (implements #430).
m-mohr Apr 29, 2019
c603d20
changed wording to make POST /stac/search not always mandatory.
m-mohr Apr 29, 2019
13e3859
Making the Commons extension Core as optional field in the collection…
m-mohr Apr 29, 2019
52e42bd
Fixing data type errors for include/exclude for fields, fixed path er…
m-mohr Apr 29, 2019
064cf3a
Add language how to combine (standalone) collections with extensions …
m-mohr Apr 29, 2019
3c1e5ff
Merge branch 'dev' into html-practices
cholmes Apr 29, 2019
c506412
Merge pull request #441 from radiantearth/feature/search_link
cholmes Apr 29, 2019
eb34a0d
Merge branch 'dev' into commons-core
cholmes Apr 29, 2019
ddc2835
Merge branch 'dev' into api-fixes
cholmes Apr 29, 2019
8a95423
Merge pull request #443 from radiantearth/api-fixes
m-mohr Apr 29, 2019
d4a2c7b
Merge branch 'dev' into feature/add_page
m-mohr Apr 29, 2019
91e7a5b
Merge branch 'dev' into commons-core
m-mohr Apr 29, 2019
cf3a576
Fixed issues brought up by @cholmes.
m-mohr Apr 29, 2019
6bdf666
Merge pull request #442 from radiantearth/commons-core
m-mohr Apr 29, 2019
4ba6005
Merge branch 'dev' into feature/add_page
m-mohr Apr 29, 2019
9f930cd
Merge pull request #440 from radiantearth/feature/add_page
cholmes May 2, 2019
34abcb6
Merge branch 'dev' into html-practices
cholmes May 2, 2019
0ac93bd
edits on html best practices
cholmes May 2, 2019
317720e
Renamed STAC+extensions.yaml to STAC-extensions.yaml
m-mohr May 2, 2019
0c3570e
Merge pull request #437 from radiantearth/html-practices
matthewhanson May 2, 2019
21e25e8
Merge branch 'dev' into rename-stac-plus-extensions
matthewhanson May 2, 2019
0b6761d
Merge pull request #446 from radiantearth/rename-stac-plus-extensions
matthewhanson May 2, 2019
1d77d27
Adding collection to items, adding properties to Collections (not lin…
m-mohr May 2, 2019
12e2bdf
Updated link, renamed file to not include the version number.
m-mohr May 2, 2019
8439656
Merge pull request #447 from radiantearth/uml
m-mohr May 2, 2019
a99b817
added stac-validator from pip instead of github.
jbants May 2, 2019
067cde6
update schema to point to hosted copy of geojson schema
matthewhanson May 2, 2019
6534e60
Fixed small lint error reported by speccy.
m-mohr May 2, 2019
7a41f4e
Merge branch 'dev' into circleci
jbants May 2, 2019
eec26f4
Merge pull request #448 from radiantearth/geojson_schema
matthewhanson May 2, 2019
2f9cf95
Updated changelog for 0.7.0
cholmes May 2, 2019
eef95d6
Merge branch 'dev' into changelog-070
m-mohr May 2, 2019
d3a1266
Merge branch 'dev' into circleci
cholmes May 2, 2019
b8abe8f
update all geojson schema refs
matthewhanson May 2, 2019
43cb2c4
Clean up collection description formatting
mojodna May 2, 2019
1bcd9f5
Minor changes
m-mohr May 2, 2019
c88390a
Merge pull request #452 from radiantearth/update_geojson_schema
matthewhanson May 2, 2019
45752c7
Merge branch 'dev' into schema-formatting
mojodna May 2, 2019
7d833ee
Merge pull request #453 from mojodna/schema-formatting
m-mohr May 2, 2019
c22f7a6
Merge branch 'dev' into circleci
m-mohr May 2, 2019
93d5fa1
Merge branch 'dev' into changelog-070
cholmes May 2, 2019
b82330b
add ids and collections parameters to search
matthewhanson May 2, 2019
83b8402
update api spec
matthewhanson May 2, 2019
86da6b9
Updated CHANGELOG
m-mohr May 2, 2019
985ddac
Merge pull request #449 from jbants/circleci
m-mohr May 2, 2019
196f932
Merge branch 'dev' into changelog-070
cholmes May 2, 2019
f028e33
Merge pull request #451 from radiantearth/changelog-070
cholmes May 2, 2019
f330a8a
Updated readme
cholmes May 2, 2019
4d7441b
Minor improvements that takes extensions better into account.
m-mohr May 2, 2019
f73afb8
Merge branch 'dev' into add_api_params
m-mohr May 2, 2019
4feebbd
Merge branch 'dev' into api-spec-fix
cholmes May 2, 2019
333beea
Merge pull request #455 from radiantearth/add_api_params
cholmes May 2, 2019
28b8183
Updated version numbers
m-mohr May 2, 2019
daeb8c0
Merge branch 'dev' into api-spec-fix
cholmes May 2, 2019
28772fc
Add files via upload
hgs-msmith May 2, 2019
c204b22
Added links to catalog
hgs-msmith May 2, 2019
b7b3f28
Merge pull request #457 from radiantearth/uml-070
hgs-msmith May 2, 2019
3baac78
Merge branch 'dev' into api-spec-fix
cholmes May 2, 2019
4bc54f7
Converted UML diagram to draw.io
hgs-msmith May 2, 2019
b2cbb99
Merge pull request #456 from radiantearth/api-spec-fix
matthewhanson May 3, 2019
0dff94f
Merge branch 'dev' into uml-draw.io
m-mohr May 3, 2019
3d8498c
Merge pull request #459 from radiantearth/uml-draw.io
matthewhanson May 3, 2019
8554db7
Updates to dev process
cholmes May 3, 2019
e12a946
Merge pull request #460 from radiantearth/dev-process-updates
m-mohr May 3, 2019
2dcdc15
collection.json is also a valid catalog file name
fredliporace May 5, 2019
9ac7650
outdated upcoming version
fredliporace May 5, 2019
14aba42
Merge pull request #462 from fredliporace/review-0-7
cholmes May 6, 2019
15ed0ef
Merge branch 'dev' into eo_rev
cholmes May 6, 2019
d0ecb36
Merge pull request #463 from fredliporace/eo_rev
m-mohr May 6, 2019
6e39c2e
Added date to changelog.
m-mohr May 6, 2019
02cda58
Merge pull request #465 from radiantearth/changelog-date
matthewhanson May 6, 2019
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
4 changes: 4 additions & 0 deletions catalog-spec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ an OpenAPI definition of the standard way to do this, at the `/stac/` endpoint.
**The Specification:** The main Catalog specification is in *[catalog-spec.md](catalog-spec.md)*.
It includes an overview and in depth explanation of the structures and fields.

**Best Practices:** While the main spec is designed to be quite flexible, there are a set of emerging best practices for
how to actually manage a catalog. The *[catalog-best-practices.md](catalog-best-practices.md)* document lays out a number
of these. In time some of these may evolve to be part of the core spec.

**Examples:** For samples of how Catalogs can be implemented the *[examples/](examples/)* folder
contains a full sample catalog.

Expand Down
163 changes: 163 additions & 0 deletions catalog-spec/catalog-best-practices.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# STAC Catalog Best Practices

This document makes a number of recommendations for creating real world SpatioTemporal Asset [Catalogs](catalog-spec.md). None of them
are required to meet the core specification, but following these practices will make life easier for client tooling
and for users. They come about from practical experience of implementors, and introduce a bit more 'constraint' for
those who are creating new catalogs or new tools to work with STAC.

In time some of these may evolve to become part of the core specification, but while the current goal of the core is to remain
quite flexible and simple to meet a wide variety of use cases.

## Static and Dynamic Catalogs

As mentioned in the main [Catalog specification](catalog-spec.md), there are two main types of catalogs - static
and dynamic. This section explains each of them in more depth and shares some best practices on each.

#### Static Catalogs

A main target for STAC has been object storage services like [Amazon S3](https://aws.amazon.com/s3/),
[Google Cloud Storage](https://cloud.google.com/storage/) and [Azure Storage](https://azure.microsoft.com/en-us/services/storage/),
so that users can stand up a full STAC implementation with static files. Implementations created with just files online
are referred to as 'static catalogs'. These include not just the cloud services, but any type of file server that is online.

Static Catalogs tend to make extensive use of *sub-catalogs* to organize their Items in to sensible browsing structures,
as they can only have a single representation of their catalog, since the static nature means the structure is baked in.
While it is up to the implementor to organize the catalog, it is recommended to arrange it in a way that would make sense
for a human to browse a set of STAC Items in an intuitive matter.

The recommendation for static catalogs is to define them using the file name `catalog.json` to distinguish
the catalog from item other JSON type files. In order to support multiple catalogs, the recommended practice
is to place the `catalog.json` in namespaces "directories". For example:

- current/catalog.json
- archive/catalog.json

#### Dynamic Catalogs

Dynamic STAC Catalogs are those that generate their JSON responses programmatically instead of relying on a set of
already defined files. Typically a dynamic catalog implements the full [STAC API](../stac-api/) which enables
search of the Items indexed. But the `/stac/` endpoint returns the exact same `Catalog` and `Item` structures as a
static catalog, enabling the same discovery from people browsing and search engines crawling. Dynamic API's that
just seek to expose some data can also choose to only implement a Catalog the `/stac/` endpoint that returns dynamically.
For example a Content Management Service like Drupal or an Open Data Catalog like CKAN could choose to expose its content
as linked STAC Items by implementing a dynamic catalog.

One benefit of a dynamic catalog is that it can generate various 'views' of the catalog, exposing the same `Items` in
different sub-catalog organization structures. For example one catalog could divide sub-catalogs by date and another by
providers, and users could browse down to both. The leaf Items should just be linked to in a single canonical location
(or at least use a `rel` link that indicates the location of the canonical one.

The STAC API is also made to be compatible with WFS3, which has a set structure for the canonical location of its features.
STAC Items should use the WFS3 location as their canonical location, and then in the `/stac/` browse structure would just
link to those locations.

## Catalog Layout

Creating a catalog involves a number of decisions as to what folder structure to use to represent sub-catalogs, items
and assets, and how to name them. The specification leaves this totally open, and you can link things as you want. We
encourage people to explore new structures. But the following are what a number of implementors ended up doing. Following
these recommendations makes for more legible catalogs.

1. Root documents (catalogs / collections) should be at the root of a directory tree containing the static catalog.
2. Catalogs should be named `catalog.json` (cf. `index.html`).
3. Collections that are distinct from catalogs should be named `collection.json`.
4. Items should be named `<id>.json`
5. Sub-catalogs should be stored in subdirectories of their parent (and only 1 subdirectory deeper than a document's parent) (e.g. `.../sample/sub1/catalog.json`).
6. Items should be stored in subdirectories of their parent catalog.
This means that each item and its assets are contained in a unique subdirectory
7. Limit the number of items in a catalog or sub-catalog, grouping / partitioning as relevant to the dataset

### Dynamic Catalog Layout

While these recommendations were primarily written for [static catalogs](catalog-spec.md#static-catalogs), they apply
equally well to [dynamic catalogs](catalog-spec.md#dynamic-catalogs). Subdirectories of course would just be URL paths
generated dynamically, but the structure would be the same as is recommended.

One benefit of a dynamic catalog is that it can generate various 'views' of the catalog, exposing the same Items in
different sub-catalog organization structures. For example one catalog could divide sub-catalogs by date and another
by providers, and users could browse down to both. The leaf Items should just be linked to in a single canonical location
(or at least use a rel link that indicates the location of the canonical one). It is recommended that dynamic catalogs
provide multiple 'views' to allow users to navigate in a way that makes sense to them, providing multiple 'sub-catalogs'
from the root catalog that enable different paths to browse (country/state, date/time, constellation/satellite, etc). But the
canonical 'rel' link should be used to designate the primary location of the item to search engine crawlers.

## Use of links

The main catalog specification allows both relative and absolute links, and says that `self` links are not required, but are
strongly recommended. This is what the spec must say to enable the various use cases, but there is more subtlety for when it
is essential to use different link types. The best practice is to use one of the below
catalog types, applying the link recommendations consistently, instead of just haphazardly applying anything the spec allows.

### Self-contained Catalogs

A 'self-contained catalog' is one that is designed for portability. Users may want to download a catalog from online and be
able to use it on their local computer, so all links need to be relative. Or a tool that creates catalogs may need to work
without knowing the final location that it will live at online, so it isn't possible to set absolute 'self' URL's. These use
cases should utilize a catalog that follows the listed principles:

* **Only relative href's in `links`**: The full catalog structure of links down to sub-catalogs and items, and their
links back to their parents and roots, should be done with relative URL's. This enables the full catalog to be downloaded or
copy to another location and to still be valid. This also implies no `self` link, as that link must be absolute.

* **Use Asset `href` links consistently**: The links to the actual assets are allowed to be either relative or absolute. There
are two types of 'self-contained catalogs'. The first is just the metadata, and use absolute href links to refer to the
online locations of the assets. The second uses relative href links for the assets, and includes them in the folder structure.
This enables offline use of a catalog, by including all the actual data.

Self-contained catalogs tend to be used more as static catalogs, where they can be easily passed around. But often they will
be generated by a more dynamic STAC service, enabling a subset of a catalog or a portion of a search criteria to be downloaded
and used in other contexts. That catalog could be used offline, or even published in another location.

Self-contained catalogs are not just for offline use, however - they are designed to be able to be published online and to live
on the cloud in object storage. They just aim to ease the burden of publishing, by not requiring lots of updating of links.
Adding a single `self` link at the root is recommended for online catalogs, turning it into a 'relative published catalog', as detailed below. This anchors it in an online location and enable provenance tracking.

### Published Catalogs

A 'published catalog' is one that lives online in a stable location, and uses `self` links to establish its location and
enable easy provenance tracking. There are two types of published catalogs:

* **Absolute Published Catalog** is a catalog that uses absolute links for everything, both in the `links` objects and in the
`asset` hrefs. It includes `self` links for every item. Generally these are implemented by dynamic catalogs, as it is quite
easy for them to generate the proper links dynamically. But a static catalog that knows its published location could easily
implement it.
* **Relative Published Catalog** is a catalog that uses relative links for everything, but includes an absolute `self` link at
the root catalog, to identify its online location. This is designed so that a self-contained catalog can be 'published' online
by just adding one field (the self link) to its root catalog. All the other links should remain relative. With this, the
resolution of item and sub-catalog self links may be done by traversing parent and root links, but requires reading multiple
sources to achieve this.

## Static to Dynamic best practices

Many implementors are using static catalogs to be the reliable core of their dynamic services, or layering their STAC API
on top of any static catalog that is published. These are some recommendations on how to handle this:

#### Ingestion and links

Implementors have found that it's best to 'ingest' a static STAC into an internal datastore (often elasticsearch, but a
traditional database could work fine too) and then generate the full STAC API responses from that internal representation.
There are instances that have the API refer directly to the static STAC Items, but this only works well if the static STAC
catalog is an 'absolute published catalog'. So the recommendation is to always use absolute links - either in the static
published catalog, or to create new absolute links for the STAC search/ endpoint
responses, with the API's location at the base url. The /stac endpoint with the catalogs could either link directly
to the static catalog, or can follow the 'dynamic catalog layout' recommendations above with a new set of URL's.

Ideally each `Item` would use its `links` to provide a reference back to the static location. The location of the static
item should be treated as the canonical location, as the generated API is more likely to move or be temporarily down. The
spec provides the `derived_from` rel attribute, which fits well enough, but `canonical` is likely the more appropriate one
as everything but the links should be the same.

#### Keeping static and dynamic catalogs in sync with cloud notification and queue services

There is a set of emerging practices to use services like Amazon's Simple Queue Service (SQS) and Simple Notification Service
(SNS) to keep catalogs in sync. There is a great [blog post on the CBERS STAC implementation on AWS](https://aws.amazon.com/blogs/publicsector/keeping-a-spatiotemporal-asset-catalog-stac-up-to-date-with-sns-sqs/). The core
idea is that a static catalog should emit a notification whenever it changes. The recommendation for SNS is to use the STAC
item JSON as the message body, with some attributes such as a scene’s datetime and geographic bounding box that allows
basic geographic filtering from listeners.

The dynamic STAC API would then listen to the notifications and update its internal datastore whenever new data comes into
the static catalog. Implementors have had success using AWS Lambda to do a full 'serverless' updating of the elasticsearch
database, but it could just as easily be a server-based process.



63 changes: 18 additions & 45 deletions catalog-spec/catalog-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,54 +91,25 @@ root catalog might be a sub-catalog of someone else's structure. The goal is for
information and links they want to, while also encouraging a natural web of information to arise as Catalogs and Items are
linked to across the web.

### Catalog Types

The core Items and Catalogs of a SpatioTemporal Asset Catalog are designed for ease of implementation.
With the same core JSON documents and link structures it can be implemented in a way that is just files available online,
or easily implementable with modern REST service infrastructures. These represent two different types of catalogs, the
'static catalog' and the 'dynamic catalog', which can operate a bit differently though they can be treated the same by
clients.

But any server can implement the same JSON and link structure, creating responses
dynamically as REST calls. These are referred to as 'dynamic catalogs'.

#### Static Catalogs

A main target for STAC has been object storage services like [Amazon S3](https://aws.amazon.com/s3/),
[Google Cloud Storage](https://cloud.google.com/storage/) and [Azure Storage](https://azure.microsoft.com/en-us/services/storage/),
so that users can stand up a full STAC implementation with static files. Implementations created with just files online
are referred to as 'static catalogs'. These include not just the cloud services, but any type of file server that is online.
There are a number of emerging 'best practices' for how to organize and implement good catalogs. These can be found in
the [best practices document](catalog-best-practices.md), and include things like catalog layout, use of self links,
publishing catalogs, and more. This specification is designed for maximum flexbility, but the best practices provide
guidance for good recommendations when implementing.

Static Catalogs tend to make extensive use of *sub-catalogs* to organize their Items in to sensible browsing structures,
as they can only have a single representation of their catalog, as the static nature means the structure is baked in.
While it is up to the implementor to organize the catalog, it is recommended to arrange the in a way that would make sense
for a human to browse a set of STAC Items in an intuitive matter.

Static catalogs a recommended to be defined using the file name `catalog.json` to distinguish from item other JSON
type files. In order to support multiple catalogs, the recommended practice is to place the
`catalog.json` in namespaces "directories". For example:

- current/catalog.json
- archive/catalog.json

#### Dynamic Catalogs
### Catalog Types

Dynamic STAC Catalogs are those that generate their JSON responses programmatically instead of relying on a set of
already defined files. Typically a dynamic catalog implements the full [STAC API](../stac-api/) which enables
search of the Items indexed. But the `/stac/` endpoint returns the exact same `Catalog` and `Item` structures as a
static catalog, enabling the same discovery from people browsing and search engines crawling. But dynamic API's that
just seek to expose some data can also choose to only implement a Catalog the `/stac/` endpoint that returns dynamically.
For example a Content Management Service like Drupal or an Open Data Catalog like CKAN could choose to expose its content
as linked STAC Items by implementing a dynamic catalog.
Though it is technically an implementation detail outside the scope of the core specification, it is worth mentioning
that implementations generally fall into two different 'types':

One benefit of a dynamic catalog is that it can generate various 'views' of the catalog, exposing the same `Items` in
different sub-catalog organization structures. For example one catalog could divide sub-catalogs by date and another by
providers, and users could browse down to both. The leaf Items should just be linked to in a single canonical location
(or at least use a `rel` link that indicates the location of the canonical one.
* **Static Catalogs** can be implemented as simply files online, often stored in an cloud storage service like [Amazon S3](https://aws.amazon.com/s3/).
or [Google Cloud Storage](https://cloud.google.com/storage/).
The core JSON documents and link structures are encoded in the file, and work as long as things are structured properly.
* **Dynamic Catalogs** are implemented in software, returning the JSON documents and links dynamically. This is mostly
used when data holdings are already exposed through a dynamic interface, and STAC can be an alternate facade on the
same core database or search cluster.

The STAC API is also made to be compatible with WFS3, which has a set structure for the canonical location of its features.
STAC Items should use the WFS3 location as their canonical location, and then in the `/stac/` browse structure would just
link to those locations.
The two catalog types both implement the same fields and links, and can be treated as the same by clients. For more
details on the two types and how you might use them see the [Static and Dynamic Catalogs](catalog-best-practices.md#static-and-dynamic-catalogs) section of the best practices document.

## Catalog fields

Expand Down Expand Up @@ -207,7 +178,9 @@ with links.

A more complete list of possible 'rel' types can be seen at the [IANA page of Link Relation Types](https://www.iana.org/assignments/link-relations/link-relations.xhtml).

Please see the chapter 'relative vs absolute links' in the [Item spec](../item-spec/item-spec.md#relative-vs-absolute-links) for a discussion on that topic.
Please see the chapter 'relative vs absolute links' in the [Item spec](../item-spec/item-spec.md#relative-vs-absolute-links)
for a discussion on that topic, as well as the [use of links](catalog-best-practices.md#use-of-links) section of the
catalog best practices document.

#### Relation types

Expand Down
2 changes: 1 addition & 1 deletion item-spec/item-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ It is allowed to add additional fields such as a `title` and `type`.

| Field Name | Type | Description |
| ---------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------- |
| href | string | **REQUIRED.** The actual link in the format of an URL. Relative and absolute links are both allowed unless otherwise noted in the ```rel``` type description. |
| href | string | **REQUIRED.** The actual link in the format of an URL. Relative and absolute links are both allowed. |
| rel | string | **REQUIRED.** Relationship between the current document and the linked document. See chapter "Relation types" for more information. |
| type | string | Media type of the referenced entity. |
| title | string | A human readable title to be used in rendered displays of the link. |
Expand Down