diff --git a/officina/999999999/0/999999999_7200235.py b/officina/999999999/0/999999999_7200235.py index 41bc913..c1860e6 100755 --- a/officina/999999999/0/999999999_7200235.py +++ b/officina/999999999/0/999999999_7200235.py @@ -213,7 +213,10 @@ '/999999/1603/45/16/1603_45_16.index.hxl.csv' WDATA_ADM0 = NUMERORDINATIO_BASIM + \ - '/999999/1603/3/45/16/1/1/1603_3_45_16_1_1.tm.hxl.csv' + '/999999/1603/3/45/16/1/1/1603_3_45_16_1_1.no1.tm.hxl.csv' + +WDATA_ADM0_NO11 = NUMERORDINATIO_BASIM + \ + '/999999/1603/3/45/16/1/1/1603_3_45_16_1_1.no11.tm.hxl.csv' # autopep8 --list-fixes ./999999999/0/999999999_7200235.py # pylint --disable=W0511,C0103,C0116 ./999999999/0/999999999_7200235.py diff --git a/officina/999999999/1603_3_12.sh b/officina/999999999/1603_3_12.sh index a958f07..a7224bb 100755 --- a/officina/999999999/1603_3_12.sh +++ b/officina/999999999/1603_3_12.sh @@ -128,6 +128,7 @@ WHERE ####################################### # Return list of administrative level 0 codes ("country/territory" codes) +# Other generic functions can be used to extract the .wikiq.tm.hxl.csv # # Globals: # None @@ -144,7 +145,8 @@ WHERE objectivum_archivum_temporarium="${ROOTDIR}/999999/0/1603_3__adm0_v2.TEMP.csv" objectivum_archivum_temporarium_hxltm="${ROOTDIR}/999999/0/1603_3__adm0_v2.TEMP.tm.hxl.csv" # objectivum_archivum_hxltm="${ROOTDIR}/999999/0/1603_3__adm0.tm.hxl.csv" - objectivum_archivum_hxltm_999999="${ROOTDIR}/999999/1603/3/45/16/1/1/1603_3_45_16_1_1.tm.hxl.csv" + # objectivum_archivum_hxltm_999999="${ROOTDIR}/999999/1603/3/45/16/1/1/1603_3_45_16_1_1.tm.hxl.csv" + objectivum_archivum_hxltm_999999="${ROOTDIR}/999999/1603/3/45/16/1/1/1603_3_45_16_1_1.no1.tm.hxl.csv" # if [ -z "$(stale_archive "$objectivum_archivum")" ]; then return 0; fi @@ -442,6 +444,8 @@ order by (?wmCode) # exit 0 # 1603_3_12_cod_ab_et_wdata +# file_translate_csv_de_numerordinatio_q__v2 "1603_3_45_16_1_1" "1" "1" +# file_merge_numerordinatio_de_wiki_q "1603_3_45_16_1_1" "1" "1" "0" # exit 0 1603_3_12_wikipedia_language_codes @@ -453,6 +457,10 @@ order by (?wmCode) 1603_3_12_cod_ab_et_wdata +# 1603_3_12_wikipedia_adm0_v2 expansion +file_translate_csv_de_numerordinatio_q__v2 "1603_3_45_16_1_1" "1" "1" +file_merge_numerordinatio_de_wiki_q "1603_3_45_16_1_1" "1" "1" "0" + # temp, see later # - https://www.wikidata.org/wiki/Help:Frequently_used_properties # - https://www.wikidata.org/wiki/Property:P3896 diff --git a/officina/999999999/999999999.lib.sh b/officina/999999999/999999999.lib.sh index 09bf832..1bdae0e 100644 --- a/officina/999999999/999999999.lib.sh +++ b/officina/999999999/999999999.lib.sh @@ -1436,7 +1436,7 @@ neo_codex_de_numerordinatio_pdf() { ####################################### # Extract Wikipedia QIDs from numerordinatio no1.tm.hxl.csv and generate an -# wikiq.tm.csv +# wikiq.tm.hxl.csv # Extract QCodes from: # - '+ix_wikiq' # - '+v_wiki_q' @@ -1657,12 +1657,54 @@ file_translate_csv_de_numerordinatio_q() { return 0 } +####################################### +# Extract Wikipedia QIDs from numerordinatio no1.tm.hxl.csv and generate an +# wikiq.tm.hxl.csv +# Extract QCodes from: +# - '#item+rem+i_qcc+is_zxxx+ix_wikiq' +# +# Globals: +# ROOTDIR (here another case that migth be relevant add DESTDIR) +# Arguments: +# numerordinatio +# est_temporarium_fontem (default "1", from 99999/) +# est_temporarium_objectivumm (default "0", from real namespace) +# Outputs: +# Create file +####################################### file_translate_csv_de_numerordinatio_q__v2() { numerordinatio="$1" est_temporarium_fontem="${2:-"1"}" est_temporarium_objectivum="${3:-"0"}" - always_stale="${4:-"0"}" - echo "@TODO ..." + + _path=$(numerordinatio_neo_separatum "$numerordinatio" "/") + _nomen=$(numerordinatio_neo_separatum "$numerordinatio" "_") + _prefix=$(numerordinatio_neo_separatum "$numerordinatio" ":") + + if [ "$est_temporarium_fontem" -eq "1" ]; then + _basim_fontem="${ROOTDIR}/999999" + else + _basim_fontem="${ROOTDIR}" + fi + if [ "$est_temporarium_objectivum" -eq "1" ]; then + _basim_objectivum="${ROOTDIR}/999999" + else + _basim_objectivum="${ROOTDIR}" + fi + + fontem_archivum="${_basim_fontem}/$_path/$_nomen.no1.tm.hxl.csv" + objectivum_archivum="${_basim_objectivum}/$_path/$_nomen.wikiq.tm.hxl.csv" + # objectivum_archivum_temporarium="${ROOTDIR}/999999/0/$_nomen.wikiq~TEMP~TEMP.tm.hxl.csv" + + printf "\n\t%40s\n" "${tty_blue}${FUNCNAME[0]} STARTED [$numerordinatio] ${tty_normal}" + + # file_extract_ix_wikiq "999999/1603/3/45/16/1/1/1603_3_45_16_1_1.tm.hxl.csv" "999999/0/1603_3_45_16_1_1.uniq.q.txt" + # wikiq=$(file_extract_ix_wikiq "999999/1603/3/45/16/1/1/1603_3_45_16_1_1.tm.hxl.csv") + wikiq=$(file_extract_ix_wikiq "$fontem_archivum") + + # wikidata_q_ex_totalibus "$wikiq" "999999/1603/3/45/16/1/1/1603_3_45_16_1_1.wikiq.tm.hxl.csv" + wikidata_q_ex_totalibus "$wikiq" "$objectivum_archivum" + printf "\t%40s\n" "${tty_green}${FUNCNAME[0]} FINISHED OKAY ${tty_normal}" } ####################################### @@ -2629,6 +2671,9 @@ wikidata_q_ex_totalibus() { # @TODO: eventually design better inference than this. Needs be based on # tendency of Wikidata Query timeouts (Rocha, 2022-07-21 00:02 UTC) + if ((_qitems < 50)); then + lingua_divisioni=5 + fi if ((_qitems > 300)); then lingua_divisioni=15 fi