Created
December 2, 2022 13:04
-
-
Save sneumann/c488bc91d3aea448897b38dd935ca0a4 to your computer and use it in GitHub Desktop.
Import Metadata from MassBank DataDump to FIZ-OAI provider
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
#!/usr/bin/env bash | |
export BACKEND=http://localhost:8081/oai-backend | |
jq -c '.[]' DataDump-IPB.jsonld | \ | |
while read i; do | |
IDENTIFIER=`echo "$i" | jq '.identifier'` | |
( | |
cat <<EOF | |
<json xmlns="http://denbi.de/schemas/json-container"> | |
<![CDATA[ | |
EOF | |
echo "$i" | |
cat <<EOF | |
]]> | |
</json> | |
EOF | |
) | curl -v -X POST -H 'Content-Type: multipart/form-data' \ | |
-i "$BACKEND/item" \ | |
-F "item={\"identifier\":$IDENTIFIER,\"deleteFlag\":false,\"ingestFormat\":\"json_container\"};type=application/json" \ | |
-F content=@- ;\ | |
done # while read |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment