From c8155e1f2869ac491a58aee4285ddc0a14172e3f Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Fri, 23 Feb 2024 20:11:33 +0100 Subject: [PATCH] Publish the extension template --- .github/.remarkrc | 11 ++ .github/workflows/publish.yaml | 18 +++ .github/workflows/test.yaml | 19 +++ .gitignore | 12 ++ CHANGELOG.md | 35 +++++ LICENSE | 201 ++++++++++++++++++++++++++++ README.md | 53 ++++++++ examples/geojson/collection.json | 43 ++++++ examples/geojson/example.json | 43 ++++++ examples/geoparquet/example.parquet | Bin 0 -> 9791 bytes package.json | 23 ++++ schema/schema.yaml | 5 + 12 files changed, 463 insertions(+) create mode 100644 .github/.remarkrc create mode 100644 .github/workflows/publish.yaml create mode 100644 .github/workflows/test.yaml create mode 100644 .gitignore create mode 100644 CHANGELOG.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 examples/geojson/collection.json create mode 100644 examples/geojson/example.json create mode 100644 examples/geoparquet/example.parquet create mode 100644 package.json create mode 100644 schema/schema.yaml diff --git a/.github/.remarkrc b/.github/.remarkrc new file mode 100644 index 0000000..f5aae5f --- /dev/null +++ b/.github/.remarkrc @@ -0,0 +1,11 @@ +{ + "plugins": [ + "remark-gfm", + "remark-preset-lint-consistent", + "remark-preset-lint-recommended", + "validate-links", + ["remark-lint-maximum-line-length", 100], + ["remark-lint-list-item-indent", "mixed"], + ["remark-lint-no-shortcut-reference-link", false] + ] +} \ No newline at end of file diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..3151b3a --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,18 @@ +name: Publish Schemas +on: + release: + types: + - published +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: inject env variables + uses: rlespinasse/github-slug-action@v4 + - uses: actions/checkout@v4 + - name: deploy schema for version ${{ env.GITHUB_REF_SLUG }} + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: schema + destination_dir: ${{ env.GITHUB_REF_SLUG }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..fa08a5f --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,19 @@ +name: Run Tests +on: + - push + - pull_request +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/setup-node@v4 + with: + node-version: 'lts/*' + - uses: actions/setup-python@v5 + with: + python-version: '>=3.9' + - uses: actions/checkout@v4 + - run: | + npm install + npm run init + npm test diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8ab09c2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +# OS files +.DS_Store +Thumbs.db + +# Editors +/.idea/ +/.vscode/ + +# Node / npm +.npm +/node_modules/ +package-lock.json \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f6046f5 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,35 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Added + +- ... + +### Changed + +- ... + +### Deprecated + +- ... + +### Removed + +- ... + +### Fixed + +- ... + +## [v0.1.0] - 2024-03-01 + +- First release + +[Unreleased]: +[v0.1.0]: diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..5b3fb10 --- /dev/null +++ b/README.md @@ -0,0 +1,53 @@ +# Template Extension Specification + +- **Title:** Template +- **Identifier:** +- **Property Name Prefix:** template +- **Extension Maturity Classification:** Proposal/Candidate/Stable +- **Owner**: @your-gh-handles @person2 + +This document explains the Template Extension to the +[Field Boundaries for Agriculture (fiboa) Specification](https://github.com/fiboa/specification). + +This is the place to add a short introduction. + +- Examples: + - [GeoJSON](examples/geojson/) + - [GeoParquet](examples/geoparquet/) +- [Schema](schema/schema.yaml) +- [Changelog](./CHANGELOG.md) + +## Properties + +The fields in the table below can be used in these parts of fiboa documents: + +- [ ] Collection +- [x] Feature Properties + +| Property Name | Type | Description | +| --------------- | ------ | ----------- | +| template:field1 | string | **REQUIRED**. Describe the required field... | +| template:field2 | int32 | Describe the field... | + +## Contributing + +All contributions are subject to the +[fiboa Code of Conduct](https://github.com/fiboa/specification/blob/main/CODE_OF_CONDUCT.md). +For contributions, please follow the +[fiboa contributing guideline](https://github.com/fiboa/specification/blob/main/CONTRIBUTING.md). + +### Running tests + +You'll need to install [nodejs and npm](https://nodejs.org/en/download/) to run the tests. +Alternatively, you can also use [yarn](https://yarnpkg.com/) instead of npm. +In this case replace all occurrences of `npm` with `yarn` below. +Additionally, you need Python >= 3.9 installed. + +Afterwards, navigate to the root of the specification repository. +Now, install the required test software: `npm install` and `npm run init` + +Finally, you can run all tests or subset of them: + +- To run all tests: `npm test` +- To check the markdown run: `npm run check-docs` +- To check the examples run: `npm run check-examples` diff --git a/examples/geojson/collection.json b/examples/geojson/collection.json new file mode 100644 index 0000000..a81187e --- /dev/null +++ b/examples/geojson/collection.json @@ -0,0 +1,43 @@ +{ + "fiboa_version": "0.0.2", + "fiboa_extensions": [ + "https://fiboa.github.io/extension-template/v0.1.0/schema.yaml" + ], + "stac_version": "1.0.0", + "type": "Collection", + "id": "fiboa", + "description": "An example fiboa dataset", + "license": "CC-0", + "extent": { + "spatial": { + "bbox": [ + [ + -180, + -90, + 180, + 90 + ] + ] + }, + "temporal": { + "interval": [ + [ + "2019-01-01T00:00:00Z", + "2020-01-01T00:00:00Z" + ] + ] + } + }, + "links": [ + { + "rel": "item", + "href": "example.json", + "type": "application/geo+json" + }, + { + "rel": "item", + "href": "example.parquet", + "type": "application/vnd.apache.parquet" + } + ] +} \ No newline at end of file diff --git a/examples/geojson/example.json b/examples/geojson/example.json new file mode 100644 index 0000000..46119f2 --- /dev/null +++ b/examples/geojson/example.json @@ -0,0 +1,43 @@ +{ + "type": "Feature", + "id": "example", + "bbox": [ + 172.91173669923782, + 1.3438851951615003, + 172.95469614953714, + 1.3690476620161975 + ], + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 172.91173669923782, + 1.3438851951615003 + ], + [ + 172.95469614953714, + 1.3438851951615003 + ], + [ + 172.95469614953714, + 1.3690476620161975 + ], + [ + 172.91173669923782, + 1.3690476620161975 + ], + [ + 172.91173669923782, + 1.3438851951615003 + ] + ] + ] + }, + "properties": { + "datetime": "2020-01-01T00:00:00Z", + "expires": "2021-01-01T00:00:00Z", + "template:field1": 1, + "template:field2": "abc" + } +} diff --git a/examples/geoparquet/example.parquet b/examples/geoparquet/example.parquet new file mode 100644 index 0000000000000000000000000000000000000000..a448c843484fbd0360f7922730be1db57159bb40 GIT binary patch literal 9791 zcmd^F%WorVR(H~UyPG?$xqTmw(x?}f;YN+7JE|JyZKvZnezlsYUa`xr zSKH-h&y}tau)2%@A$E-B4`2sENX%jwHY`}OVu5CXV3r7J&@B0#?<>bn;tUh+y+{Zv zw#(n+eCPH1om18QDp?W3cf*gupA^IE;m}8+(1RzTpPm1 zJhN{MmJImOovknKkO|l1+#r3W2|rm2|L)p649X{Opu^gowf8)HzlV2Pe)}KK{>=Dp z?{A;|-5-4Z^Y28z_wWDw#Sb!%LQnqE@P6+H|Mv6md?z}?!uAA>!Y+k9(gY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