Skip to content

Commit

Permalink
Update script in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
renatocjn committed Nov 7, 2024
1 parent bb91ae7 commit 648c60a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions update-triples-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ ontop materialize --db-user "$ONTOP_DB_USER" --db-password "$ONTOP_DB_PASSWORD"
# if diff -q new-idorg-ontology-materialized.rdf idorg-ontology-materialized.rdf > /dev/null; then
echo Updating materialized file
old_sha=$(wget --no-check-certificate -O - -q https://api.github.com/repos/identifiers-org/ontop/contents/idorg-ontology/idorg-ontology-materialized.rdf | grep sha | cut -d\" -f4)
echo -n "{\"message\":\"Sync materialized registry tuples with database\", \"committer\":{\"name\":\"Ontop bot\", \"email\":\"[email protected]\"}, \"content\":\"" > datafile
cat new-idorg-ontology-materialized.rdf|base64 >> datafile
echo "\", \"sha\": \"$old_sha\"}" >> datafile
wget --method=PUT --no-check-certificate \
-H "Accept: application/vnd.github+json"\
-H "Authorization: Bearer $ONTOP_GH_TOKEN"\
-H "X-GitHub-Api-Version: 2022-11-28"\
--body-data="{\"message\":\"Sync materialized registry tuples with database\", \"committer\":{\"name\":\"Ontop bot\", \"email\":\"[email protected]\"}, \"content\":\"$(cat new-idorg-ontology-materialized.rdf|base64)\", \"sha\": \"$old_sha\"}"\
https://api.github.com/repos/identifiers-org/ontop/contents/idorg-ontology/idorg-ontology-materialized.rdf\
--body-file=datafile \
https://api.github.com/repos/identifiers-org/ontop/contents/idorg-ontology/idorg-ontology-materialized.rdf
# else
# echo No need to update materialized file
# fi

0 comments on commit 648c60a

Please sign in to comment.