Skip to content

Commit

Permalink
Merge pull request #7 from stac-extensions/mah/alternate-asset-object
Browse files Browse the repository at this point in the history
New alternate asset object - v1.1.0
  • Loading branch information
matthewhanson authored Jul 8, 2021
2 parents 58aa16a + 8fc9e02 commit 568e9b7
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 36 deletions.
12 changes: 6 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added
## [v1.1.0]

### Changed

### Deprecated
- No longer reference a STAC version
- Alternate objects are not of type `Asset` but rather `AlternateAsset` which is just a restrictive version of an `Asset`

### Removed

### Fixed
- requirement for alternate (which meant it had to be used in all assets). There are no no required fields

## [v1.0.0]

Initial release

[Unreleased]: <https://github.com/stac-extensions/alternate-assets/compare/v1.0.0...HEAD>
[Unreleased]: <https://github.com/stac-extensions/alternate-assets/compare/v1.1.0...HEAD>
[v1.1.0]: <https://github.com/stac-extensions/alternate-assets/compare/v1.0.0...v1.1.0>
[v1.0.0]: <https://github.com/stac-extensions/alternate-assets/tree/v1.0.0>
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Alternate Assets Extension Specification

- **Title:** Alternate Assets
- **Identifier:** <https://stac-extensions.github.io/alternate-assets/v1.0.0/schema.json>
- **Identifier:** <https://stac-extensions.github.io/alternate-assets/v1.1.0/schema.json>
- **Field Name Prefix:** -
- **Scope:** Asset
- **Extension [Maturity Classification](https://github.com/radiantearth/stac-spec/tree/master/extensions/README.md#extension-maturity):** Proposal
Expand All @@ -22,14 +22,13 @@ to access it.

| Field Name | Type | Description |
| -------------------- | ------------------------- | ----------- |
| alternate | Map<string, [Asset Object](https://github.com/radiantearth/stac-spec/blob/master/item-spec/item-spec.md#asset-object)> | An array of alternate location information for an asset |
| alternate | Map<string, [AlternateAsset Object](#alternate-asset-object)> | An array of alternate location information for an asset |

The alternate Assets are like any other Asset object, except should only contain fields relevant to the location and access of the asset.
In the simplest case, the object consists of a single field, `href`, but could include other fields if they do not specify
attributes in the physical asset. For example, `gsd` represents the resolution of the data asset. Changing that would imply
a different asset. Fields like `title` or `description` can be used to provide info on the alternate asset.
Considering other extensions, the fields from the [Storage Extension](https://github.com/stac-extensions/storage)
could be used in an alternative asset to provide additional details on it's location.
The Alternate Assets are similar to the core Asset object, except only contain fields relevant to the location and access of the asset.
In the simplest case, the object consists of a single field, `href`, but could include a title or description to provide additional info
regarding the alternate location or URL.
The fields from the [Storage Extension](https://github.com/stac-extensions/storage) could be used in an AlternateAsset to
provide additional details on it's location.

The key to each alternate asset, e.g.,

Expand All @@ -47,6 +46,14 @@ in an Item are all available via s3 direct access, the key for all of them shoul
It is also recommended that the [item assets](https://github.com/stac-extensions/item-assets)
extension be used in Collections to convey to users what the options are for alternate access.

### Alternate Asset Object

| Field Name | Type | Description |
| ----------- | --------- | ----------- |
| href | string | **REQUIRED.** URI to the asset object. Relative and absolute URI are both allowed. |
| title | string | The displayed title for clients and users. |
| description | string | A description of the Asset providing additional details, such as how it was processed or created. [CommonMark 0.29](http://commonmark.org/) syntax MAY be used for rich text representation. |

## Contributing

All contributions are subject to the
Expand Down
2 changes: 1 addition & 1 deletion examples/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"stac_version": "1.0.0",
"stac_extensions": [
"https://stac-extensions.github.io/item-assets/v1.0.0/schema.json",
"https://stac-extensions.github.io/alternate-assets/v1.0.0/schema.json"
"https://stac-extensions.github.io/alternate-assets/v1.1.0/schema.json"
],
"type": "Collection",
"id": "collection-1",
Expand Down
5 changes: 4 additions & 1 deletion examples/item.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"stac_version": "1.0.0",
"stac_extensions": [
"https://stac-extensions.github.io/alternate-assets/v1.0.0/schema.json"
"https://stac-extensions.github.io/alternate-assets/v1.1.0/schema.json"
],
"type": "Feature",
"id": "item",
Expand Down Expand Up @@ -50,6 +50,9 @@
"assets": {
"data": {
"href": "https://mycoolsat.com/examples/file.xyz",
"roles": [
"data"
],
"alternate": {
"s3": {
"title": "s3 Access",
Expand Down
57 changes: 39 additions & 18 deletions json-schema/schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://stac-extensions.github.io/alternate-assets/v1.0.0/schema.json#",
"$id": "https://stac-extensions.github.io/alternate-assets/v1.1.0/schema.json#",
"title": "Alternate Assets Extension",
"description": "STAC Alternate Assets Extension for STAC Items and STAC Collections.",
"oneOf": [
Expand All @@ -20,7 +20,7 @@
"assets": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/asset"
"$ref": "#/definitions/alternate_assets"
}
}
}
Expand All @@ -45,13 +45,13 @@
"assets": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/asset"
"$ref": "#/definitions/alternate_assets"
}
},
"item_assets": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/item_asset"
"$ref": "#/definitions/alternate_item_assets"
}
}
}
Expand All @@ -72,38 +72,59 @@
"stac_extensions": {
"type": "array",
"contains": {
"const": "https://stac-extensions.github.io/alternate-assets/v1.0.0/schema.json"
"const": "https://stac-extensions.github.io/alternate-assets/v1.1.0/schema.json"
}
}
}
},
"assets": {
"alternate_assets": {
"title": "Assets",
"description": "Links to assets",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/asset"
}
},
"asset": {
"type": "object",
"required": [
"alternate"
],
"properties": {
"alternate": {
"type": "object",
"additionalProperties": {
"$ref": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json#/definitions/asset"
"required": ["href"],
"properties": {
"href": {
"title": "Asset reference",
"type": "string",
"format": "iri-reference",
"minLength": 1
},
"title": {
"title": "Asset title",
"type": "string"
},
"description": {
"title": "Asset description",
"type": "string"
}
}
}
}
}
},
"item_asset": {
"alternate_item_assets": {
"title": "Assets",
"description": "Links to assets",
"type": "object",
"properties": {
"alternate": {
"type": "object"
"type": "object",
"additionalProperties": {
"properties": {
"title": {
"title": "Asset title",
"type": "string"
},
"description": {
"title": "Asset description",
"type": "string"
}
}
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"scripts": {
"test": "npm run check-markdown && npm run check-examples",
"check-markdown": "remark . -f -r .github/remark.yaml",
"check-examples": "stac-node-validator . --lint --verbose --schemaMap https://stac-extensions.github.io/alternate-assets/v1.0.0/schema.json=./json-schema/schema.json",
"format-examples": "stac-node-validator . --format --schemaMap https://stac-extensions.github.io/alternate-assets/v1.0.0/schema.json=./json-schema/schema.json"
"check-examples": "stac-node-validator . --lint --verbose --schemaMap https://stac-extensions.github.io/alternate-assets/v1.1.0/schema.json=./json-schema/schema.json",
"format-examples": "stac-node-validator . --format --schemaMap https://stac-extensions.github.io/alternate-assets/v1.1.0/schema.json=./json-schema/schema.json"
},
"dependencies": {
"remark-cli": "^8.0.0",
Expand Down

0 comments on commit 568e9b7

Please sign in to comment.