From 611b3e46925a09c47dec8e2626ab7108effa9a1e 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 | 15 +++ .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, 459 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..a21c249 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,15 @@ +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/checkout@v4 + - run: | + npm install + 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..23e68870d495b84f343613e2f26b63bc3a462de3 GIT binary patch literal 9791 zcmd^F%Wq?8R(Dd>RYgx}y87WLg=%3LDrz)U$-UQhl3RtaraiBwYBO$EV zzWyHPJFnmGoO`QYB`ae1Zun97lVW&19Qr5}dhjIl^YhOcNZT!~S)=xj)`lF9YorRcH$~^u-BD8sLpmhve2|olwJzZaL-_wtZ zUwruF3C<_(!pxjgE=@dq8rpm?&+kx}ej-{=Lq*ycUdOg8T8d9MihuU;1CThazBVld zTQ}ApKY46@^Q^q}&9mnJUoP1Cnn1kuwSsW#YsApTf4sl3zV%?^pWpu^6nb3TeDB;; zU1jsn@4kz&tFw{OADFHaeG!QY+rqXKeHIC3jEQeJG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