Skip to content

Commit

Permalink
Merge pull request #1087 from radiantearth/validate
Browse files Browse the repository at this point in the history
Update STAC Node Validator, fix examples, fix #1088
  • Loading branch information
cholmes authored Apr 15, 2021
2 parents 82d3a22 + 93765a5 commit 6a5a153
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@
"rel": "parent",
"href": "../collection.json",
"type": "application/json"
},
{
"rel": "collection",
"href": "../collection.json",
"type": "application/json"
}
],
"assets": {
Expand All @@ -242,7 +247,6 @@
"eo:bands": [
{
"name": "B8",
"common_name": "panchromatic",
"center_wavelength": 0.59,
"full_width_half_max": 0.18
}
Expand Down
4 changes: 2 additions & 2 deletions item-spec/item-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ inherited from GeoJSON.
| properties | [Properties Object](#properties-object) | **REQUIRED.** A dictionary of additional metadata for the Item. |
| links | \[[Link Object](#link-object)] | **REQUIRED.** List of link objects to resources and related URLs. A link with the `rel` set to `self` is strongly recommended. |
| assets | Map<string, [Asset Object](#asset-object)> | **REQUIRED.** Dictionary of asset objects that can be downloaded, each with a unique key. |
| collection | string | The `id` of the STAC Collection this Item references to (see [`collection` relation type](#relation-types)). This field is *required* if such a relation type is present. This field provides an easy way for a user to search for any Items that belong in a specified Collection. Must be a non-empty string. |
| collection | string | The `id` of the STAC Collection this Item references to (see [`collection` relation type](#relation-types)). This field is *required* if such a relation type is present and is *not allowed* otherwise. This field provides an easy way for a user to search for any Items that belong in a specified Collection. Must be a non-empty string. |

### Additional Field Information

Expand Down Expand Up @@ -183,7 +183,7 @@ This happens where there is not a clear official option, or where STAC uses an o
| self | STRONGLY RECOMMENDED. *Absolute* URL to the Item if it is available at a public URL. This is particularly useful when in a download package that includes metadata, so that the downstream user can know where the data has come from. |
| root | URL to the root STAC Catalog or Collection. |
| parent | URL to the parent STAC Catalog or Collection. |
| collection | STRONGLY RECOMMENDED. URL to a Collection. *Absolute* URLs should be used whenever possible. The referenced Collection is STRONGLY RECOMMENDED to implement the same STAC version as the Item. |
| collection | STRONGLY RECOMMENDED. URL to a Collection. *Absolute* URLs should be used whenever possible. The referenced Collection is STRONGLY RECOMMENDED to implement the same STAC version as the Item. A link with this `rel` type is *required* if the `collection` field in properties is present. |
| derived_from | URL to a STAC Item that was used as input data in the creation of this Item. |

A more complete list of potential `rel` types and their meaning in STAC can be found in the [Using Relation
Expand Down
42 changes: 36 additions & 6 deletions item-spec/json-schema/item.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,42 @@
]
}
]
},
"collection": {
"title": "Collection ID",
"description": "The ID of the STAC Collection this Item references to.",
"type": "string",
"minLength": 1
}
},
"if": {
"properties": {
"links": {
"contains": {
"required": [
"rel"
],
"properties": {
"rel": {
"const": "collection"
}
}
}
}
}
},
"then": {
"required": [
"collection"
],
"properties": {
"collection": {
"title": "Collection ID",
"description": "The ID of the STAC Collection this Item references to.",
"type": "string",
"minLength": 1
}
}
},
"else": {
"properties": {
"collection": {
"not": {}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"remark-preset-lint-markdown-style-guide": "^3.0.0",
"remark-preset-lint-recommended": "^4.0.0",
"remark-validate-links": "^10.0.0",
"stac-node-validator": "^0.4.6"
"stac-node-validator": "^1.0.1"
}
}

0 comments on commit 6a5a153

Please sign in to comment.