-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ESA-EarthCODE/root-level-package
Root level package
- Loading branch information
Showing
10 changed files
with
58 additions
and
76 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,34 @@ | ||
# open-science-catalog-validation | ||
Validation for [open-science-catalog-metadata](https://github.com/ESA-EarthCODE/open-science-catalog-metadata) | ||
Validation for [open-science-catalog-metadata](https://github.com/ESA-EarthCODE/open-science-catalog-metadata). | ||
|
||
# Instructions | ||
|
||
## How-to | ||
To run validation do the following: | ||
|
||
In order to run the valdation, run the folling steps: | ||
```bash | ||
npm install ESA-EarthCODE/open-science-catalog-validation | ||
``` | ||
|
||
Then, inside a folder containing a STAC structure compatible with Open Science Catalog, run: | ||
|
||
```bash | ||
npm install | ||
open-science-catalog-validation ./{eo-missions,products,projects,themes,variables} | ||
``` | ||
|
||
Example for single file validation: | ||
|
||
```bash | ||
npx stac-node-validator --config config.json ../../metadata/{eo-missions,products,projects,themes,variables} | ||
``` | ||
open-science-catalog-validation ./projects/3d-earth/collection.json | ||
``` | ||
|
||
# How it works | ||
This validation package is based on [stac-node-validator](https://github.com/stac-utils/stac-node-validator). Additional to generic validation following the [STAC spec](https://github.com/radiantearth/stac-spec) it does some custom validation (see [./validate.js](./validate.js)). | ||
|
||
# Open Science Catalog STAC schema | ||
Open Science Catalog requires a certain STAC structure for its entities (products, projects, variables etc.). The schema for these can be found in [./schemas](./schemas). | ||
|
||
These schemas can also be used for e.g. automatically rendering an input form. | ||
|
||
# Development | ||
For development, copy some compatible folder structure into the root folder, then run `npm install` follwed by a `npm test`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env node | ||
const { resolve } = require("path"); | ||
const { exec } = require("child_process"); | ||
|
||
exec( | ||
`npm explore open-science-catalog-validation -- npm run test -- ${process.argv | ||
.slice(2) | ||
.map((p) => resolve(p)) | ||
.join(" ")}`, | ||
(error, stdout) => { | ||
if (error) { | ||
console.error("Validation failed!"); | ||
} else { | ||
console.info("Validation successful!"); | ||
} | ||
console.log(stdout); | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"lint": false, | ||
"custom": "./validate.js" | ||
} |
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.