diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7274ccb9..fe5dc5a8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,15 @@ fail_fast: true repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 + hooks: + # This one has been added to fail fast on syntax errors + # before running expensive pylint + - id: check-json + - id: check-yaml + types: [file] + files: \.(yaml|yml)$ - repo: https://github.com/inab/python-extended-json-schema-validator.git rev: v0.15.1 hooks: diff --git a/json-schemas/from_1.0.x_to_2.0.x.yaml b/json-schemas/from_1.0.x_to_2.0.x.yaml index 057ccca1..9b34daf3 100644 --- a/json-schemas/from_1.0.x_to_2.0.x.yaml +++ b/json-schemas/from_1.0.x_to_2.0.x.yaml @@ -125,10 +125,25 @@ "_id": $id } | + ( + .metrics_contact_ids | map( + $contacts[.].links[] | select(.label == "ORCID") + | + .uri + | ltrimstr("orcid:") + | ltrimstr("https://orcid.org/") + | "orcid:" + . + ) + ) as $metrics_contact_ids + | . * { "_id": $id, - "_schema": "https://w3id.org/openebench/scientific-schemas/2.0/Metrics" + "_schema": "https://w3id.org/openebench/scientific-schemas/2.0/Metrics", + "metrics_contact_ids": $metrics_contact_ids, + "name": .title } + | + del(.title) - schema: https://www.elixir-europe.org/excelerate/WP2/json-schemas/1.0/Reference side_objects_paths: contacts: MIG-1.0/Contact