Changeset 35084


Ignore:
Timestamp:
2021-04-17T10:23:10+12:00 (3 years ago)
Author:
davidb
Message:

collection name determined dynamically; exploding now done into a single folder (records 2000 limit); code tidy up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/model-sites-dev/eurovision-lod/collect/eurovision/prepare/08-EXPLODE-SPOTIFY-SPARQLRESULTS-TO-IMPORT.sh

    r35079 r35084  
    22
    33tmp_cache="tmp-cache"
     4
     5cwd=`pwd`
     6cwd_without_prepare=${cwd%/*}
     7collection=${cwd_without_prepare##*/}
    48
    59echo ""
     
    2832
    2933explode_metadata_database.pl \
     34    -records_per_folder 2000 \
    3035    -collectdir $GSDL3SRCHOME/web/sites/eurovision-lod/collect \
    31     -collection eurovision \
    32     -plugin_options "-metadata_merge_on_concat_fields Country,Year,TitleDisambiguation -OIDtype assigned -OIDmetadata Identifier" \
     36    -collection $collection \
     37    -plugin_options "-metadata_merge_on_concat_fields Country,Year -OIDtype assigned -OIDmetadata Identifier" \
    3338    -plugin JSONSPARQLResultPlugin  \
    3439    $tmp_cache/sparqlresults-$f
     
    4247
    4348echo ""
    44 echo "Regenerating sparqlresults-* files in '../import' (from exploded results in '$tmp_cache')"
     49echo "Adding metadata_esc_mir_gold.xml to the sparqlresults-* directories in '../import' (from exploded results in '$tmp_cache')"
    4550
    46 ##/bin/rm -rf ../import/sparqlresults-*
    4751
    48 for d in $tmp_cache/sparqlresults-* ; do
    49     tail_d=${d##*/}
    50     cat $tmp_cache/$tail_d/metadata.xml \
    51     | sed 's/"accumuate"/"override"/' > ../import/$tail_d/metadata-esc-mir-gold.xml   
     52#for d in $tmp_cache/sparqlresults-* ; do
     53#    tail_d=${d##*/}
     54#    cat $tmp_cache/$tail_d/metadata.xml \
     55#   | sed 's/mode="accumulate"/mode="override"/' > ../import/$tail_d/metadata-esc-mir-gold.xml   
     56#done
     57
     58
     59num_explode_subdirs=`ls -d $tmp_cache/sparqlresults-local--esc-mir-gold* | wc -l`
     60
     61if [ "x$num_explode_subdirs" != "x1" ] ; then
     62    echo "Error: This script is designed for all the results results from exploding to be" 1>&2
     63    echo "       in a single subdirectory" 1>&2
     64    echo "       In $tmp_cache found: $num_explode_subdirs" 1>&2   
     65    exit 1
     66fi
     67     
     68for d in ../import/sparqlresults-* ; do
     69    cat $tmp_cache/sparqlresults-local--esc-mir-gold/metadata.xml \
     70    | sed 's/mode="accumulate"/mode="override"/' > $d/metadata_esc_mir_gold.xml   
    5271done
    5372
    54 /bin/rm $tmp_cache/sparqlresults-*
     73/bin/rm -rf $tmp_cache/sparqlresults-*
    5574
    5675
    57 #/bin/mv $tmp_cache/sparqlresults-*/*.xml ../import/.
    58 
    5976echo ""
Note: See TracChangeset for help on using the changeset viewer.