some-things/code/mk_ror_health_de.sh

19 lines
860 B
Shell
Executable file

#!/bin/bash
# returns JSON lines formatted records
set -e -u -o pipefail
jq -c '
.[]
| select((.types[] | contains("healthcare")) and .locations[0].geonames_details.country_code == "DE") | select(.external_ids != [])
| {pid: .id,
name: [.names[] | select((.types[] | contains("ror_display"))) | .value].[0],
short_name: [.names[] | select((.types[] | contains("acronym"))) | .value].[0],
at_location: "geodata:\(.locations[0].geonames_id)",
identifiers: [
.external_ids[] | {notation: .all[0], schema_agency: .type, schema_type: "dlidentifiers:IssuedIdentifier"}
],
characterized_by: [
.links[] | {predicate: "rdfs:seeAlso", object: .value}
],
display_label: "\([.names[] | select((.types[] | contains("ror_display"))) | .value].[0]) (\(.locations[0].geonames_details.country_name))"}
' < "$1"