some-things/code/mk_ror_facilityorgs.sh
Michael Hanke 1fd52216ac
feat: add research facility records
This script is an almost identical copy of the one for the
educational organizations. It should be deduplicated eventually.
However, for now it is just documentation.
2025-08-19 16:28:37 +02:00

19 lines
850 B
Shell
Executable file

#!/bin/bash
# returns JSON lines formatted records
set -e -u -o pipefail
jq -c '
.[]
| select((.types[] | contains("facility"))) | select(.links[].type | contains("wikipedia")) | 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"