Skip to content

Commit

Permalink
Merge pull request #1331 from libris/feature/ill-content-script
Browse files Browse the repository at this point in the history
Move release bound script to globalchanges-1.33.sh
  • Loading branch information
kwahlin authored Nov 17, 2023
2 parents 6e10b84 + d5cb185 commit bc6332c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 31 deletions.
13 changes: 3 additions & 10 deletions librisworks/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ NO_ANONYMOUS_TRANSLATIONS=$CLUSTERS_DIR/5-no-anonymous-translations
mkdir -p $CLUSTERS_DIR $NORMALIZATIONS_DIR $MERGED_WORKS_DIR $ALL $MERGED $TITLES $SWEDISH_FICTION $NO_ANONYMOUS_TRANSLATIONS

LANGUAGE_IN_TITLE=$NORMALIZATIONS_DIR/1-titles-with-language
ILL_CONTENT=$NORMALIZATIONS_DIR/2-illustrative-content
DEDUPLICATE_CONTRIBUTIONS=$NORMALIZATIONS_DIR/3-deduplicate-contributions
ADD_MISSING_CONTRIBUTION_DATA=$NORMALIZATIONS_DIR/4-add-missing-contribution-data
ROLES_TO_INSTANCE=$NORMALIZATIONS_DIR/5-roles-to-instance
DEDUPLICATE_CONTRIBUTIONS=$NORMALIZATIONS_DIR/2-deduplicate-contributions
ADD_MISSING_CONTRIBUTION_DATA=$NORMALIZATIONS_DIR/3-add-missing-contribution-data
ROLES_TO_INSTANCE=$NORMALIZATIONS_DIR/4-roles-to-instance

# Clustering TODO: run only on recently updated records after first run
echo "Finding new clusters..."
Expand Down Expand Up @@ -95,12 +94,6 @@ time java -Dxl.secret.properties=$HOME/secret.properties-$ENV -Dclusters=$SWEDIS
$ARGS --report $LANGUAGE_IN_TITLE $SCRIPTS_DIR/language-in-work-title.groovy 2>/dev/null
echo "$(count_lines $LANGUAGE_IN_TITLE/MODIFIED.txt) records affected, report in $LANGUAGE_IN_TITLE"

echo
echo "Moving illustrativeContent to instance..."
time java -Dxl.secret.properties=$HOME/secret.properties-$ENV -Dclusters=$SWEDISH_FICTION/$CLUSTER_TSV -jar $JAR_FILE \
$ARGS --report $ILL_CONTENT $SCRIPTS_DIR/lxl-4221-move-illustrativecontent-to-instance.groovy 2>/dev/null
echo "$(count_lines $ILL_CONTENT/MODIFIED.txt) records affected, report in $ILL_CONTENT"

echo
echo "Merging contribution objects with same agent..."
time java -Dxl.secret.properties=$HOME/secret.properties-$ENV -Dclusters=$SWEDISH_FICTION/$CLUSTER_TSV -jar $JAR_FILE \
Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions whelktool/globalchanges-1.33.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
set -euxo pipefail
time java -Dxl.secret.properties=$HOME/secret.properties-$ENV -jar build/libs/whelktool.jar --report reports/$ENV-$(date +%Y%m%d-%H%M%S) --skip-index scripts/2023/08/lxl-4243-move-out-solitary-contentType-from-hasPart.groovy
time java -Dxl.secret.properties=$HOME/secret.properties-$ENV -jar build/libs/whelktool.jar --report reports/$ENV-$(date +%Y%m%d-%H%M%S) --skip-index scripts/cleanups/2023/05/gf-cleanup.groovy
time java -Dxl.secret.properties=$HOME/secret.properties-$ENV -jar build/libs/whelktool.jar --report reports/$ENV-$(date +%Y%m%d-%H%M%S) --skip-index scripts/cleanups/2020/08/lxl-3294-move-bearer-like-gfs-from-work-to-instance.groovy
time java -Dxl.secret.properties=$HOME/secret.properties-$ENV -jar build/libs/whelktool.jar --report reports/$ENV-$(date +%Y%m%d-%H%M%S) --skip-index scripts/cleanups/2023/07/lxl-4221-move-illustrativecontent-to-instance.groovy
time java -Dxl.secret.properties=$HOME/secret.properties-$ENV -jar build/libs/whelktool.jar --report reports/$ENV-$(date +%Y%m%d-%H%M%S) --skip-index scripts/2023/10/elib-unspecified-contributor.groovy
time java -Dxl.secret.properties=$HOME/secret.properties-$ENV -jar build/libs/whelktool.jar --report reports/$ENV-$(date +%Y%m%d-%H%M%S) --skip-index scripts/2023/05/lxl-2512-move-contribution-by-relator-domain/script.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
def where = """
collection = 'bib'
and deleted = false
and data#>>'{@graph,1,instanceOf,@type}' = 'Text'
and data#>'{@graph,1,instanceOf, illustrativeContent}' is not null
"""

selectBySqlWhere(where) {
def instance = it.graph[1]
def work = instance.instanceOf

instance['illustrativeContent'] = (asList(instance['illustrativeContent']) + asList(work.remove('illustrativeContent'))).unique()

it.scheduleSave()
}

0 comments on commit bc6332c

Please sign in to comment.