Skip to content

Commit

Permalink
feat: Add asset language property (#173)
Browse files Browse the repository at this point in the history
* feat: Add asset language property

* feat: Enforce that `linz:language` is a string

We don't need to test on the item as well because we've de-duped that
part of the schema.

* feat: Enforce that `linz:language` is an RFC 5646 language tag

Got the language tags using `jq '.[].lang' <(curl --location
https://datahub.io/core/language-codes/r/ietf-language-tags.json)`.
  • Loading branch information
l0b0 authored Nov 22, 2021
1 parent 22ba48e commit 66bd0d5
Show file tree
Hide file tree
Showing 6 changed files with 861 additions and 7 deletions.
11 changes: 6 additions & 5 deletions extensions/linz/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,12 @@ This expands on the [provider object in the STAC spec](https://github.com/radian

These fields apply to assets within both items and collections.

| Field Name | Type | Description |
| ----------------------- | ------ | ------------------------------------------------------------------------------------------------------- |
| assets/\*/created | string | **REQUIRED**. Creation date and time of the asset, in UTC. |
| assets/\*/updated | string | **REQUIRED**. Date and time the asset was last updated, in UTC. |
| assets/\*/file:checksum | string | **REQUIRED**. See [reference](https://github.com/stac-extensions/file/blob/v2.0.0/README.md#checksums). |
| Field Name | Type | Description |
| ----------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------- |
| assets/\*/created | string | **REQUIRED**. Creation date and time of the asset, in UTC. |
| assets/\*/updated | string | **REQUIRED**. Date and time the asset was last updated, in UTC. |
| assets/\*/file:checksum | string | **REQUIRED**. See [reference](https://github.com/stac-extensions/file/blob/v2.0.0/README.md#checksums). |
| linz:language | string | **REQUIRED**. [RFC 5646 language tag](https://datatracker.ietf.org/doc/html/rfc5646), for example `en-NZ` (New Zealand English) |

## Extensions

Expand Down
1 change: 1 addition & 0 deletions extensions/linz/examples/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"created": "2000-01-01T00:00:00Z",
"updated": "2020-01-01T00:00:00Z",
"file:checksum": "1220e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"linz:language": "en-NZ",
"proj:epsg": 32659
}
}
Expand Down
3 changes: 2 additions & 1 deletion extensions/linz/examples/item.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"href": "https://example.com/examples/file.xyz",
"created": "2000-01-01T00:00:00Z",
"updated": "2020-01-01T00:00:00Z",
"file:checksum": "1220e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
"file:checksum": "1220e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"linz:language": "mi"
}
}
}
Loading

0 comments on commit 66bd0d5

Please sign in to comment.