Skip to content

Commit

Permalink
1603_3_12.py (#12, #9): SPARQL requets broken in 3 chunks; end result…
Browse files Browse the repository at this point in the history
… is merged again; fixes issue with last commit
  • Loading branch information
fititnt committed Feb 11, 2022
1 parent f72f864 commit 4ee67b8
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 5 deletions.
6 changes: 5 additions & 1 deletion officinam/999999999/1603_0_1603.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ ROOTDIR="$(pwd)"

# tutorial https://opensource.com/article/18/5/you-dont-know-bash-intro-bash-arrays
PURGATORIA_CONCEPTUM=()
PURGATORIA_EXTENSIONEM=( "no1.tm.hxl.csv" "wikiq.tm.hxl.csv" "no11.tm.hxl.csv" "tm.hxl.csv" "mul-Latn.codex.pdf" "mul-Latn.codex.adoc" )
## Reset all files
# PURGATORIA_EXTENSIONEM=( "no1.tm.hxl.csv" "wikiq.tm.hxl.csv" "no11.tm.hxl.csv" "tm.hxl.csv" "mul-Latn.codex.pdf" "mul-Latn.codex.adoc" )

## Use cached files (avoid overload Google Sheets), but gives hint to re-generate translations
PURGATORIA_EXTENSIONEM=( "no1.tm.hxl.csv" "wikiq.tm.hxl.csv" "no11.tm.hxl.csv" )

# PURGATORIA_CONCEPTUM+=( "1603_1_1" )
# PURGATORIA_CONCEPTUM+=( "1603_1_6" )
Expand Down
47 changes: 43 additions & 4 deletions officinam/999999999/999999999.lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,11 @@ file_translate_csv_de_numerordinatio_q() {
objectivum_archivum_temporarium_b="${ROOTDIR}/999999/0/$_nomen.q.txt"
objectivum_archivum_temporarium_b_u="${ROOTDIR}/999999/0/$_nomen.uniq.q.txt"
objectivum_archivum_temporarium_b_u_wiki="${ROOTDIR}/999999/0/$_nomen.wikiq.tm.hxl.csv"
objectivum_archivum_temporarium_b_u_wiki_1_3="${ROOTDIR}/999999/0/$_nomen~1.wikiq.tm.hxl.csv"
objectivum_archivum_temporarium_b_u_wiki_2_3="${ROOTDIR}/999999/0/$_nomen~2.wikiq.tm.hxl.csv"
objectivum_archivum_temporarium_b_u_wiki_3_3="${ROOTDIR}/999999/0/$_nomen~3.wikiq.tm.hxl.csv"

objectivum_archivum_temporarium_b_u_wiki_1m2="${ROOTDIR}/999999/0/$_nomen~1+2.wikiq.tm.hxl.csv"

# if [ -z "$(changed_recently "$fontem_archivum")" ]; then return 0; fi

Expand Down Expand Up @@ -582,23 +587,57 @@ file_translate_csv_de_numerordinatio_q() {

"${ROOTDIR}/999999999/0/1603_3_12.py" \
--actionem-sparql \
--lingua-divisioni=2 \
--lingua-divisioni=3 \
--lingua-paginae=1 \
--query <"$objectivum_archivum_temporarium_b_u" |
./999999999/0/1603_3_12.py --actionem-sparql --csv --hxltm \
>"$objectivum_archivum_temporarium_b_u_wiki"
>"$objectivum_archivum_temporarium_b_u_wiki_1_3"

"${ROOTDIR}/999999999/0/1603_3_12.py" \
--actionem-sparql \
--lingua-divisioni=3 \
--lingua-paginae=2 \
--query <"$objectivum_archivum_temporarium_b_u" |
./999999999/0/1603_3_12.py --actionem-sparql --csv --hxltm \
>"$objectivum_archivum_temporarium_b_u_wiki_2_3"

"${ROOTDIR}/999999999/0/1603_3_12.py" \
--actionem-sparql \
--lingua-divisioni=3 \
--lingua-paginae=3 \
--query <"$objectivum_archivum_temporarium_b_u" |
./999999999/0/1603_3_12.py --actionem-sparql --csv --hxltm \
>"$objectivum_archivum_temporarium_b_u_wiki_3_3"
# "$objectivum_archivum_temporarium_b_u"

hxlmerge --keys='#item+conceptum+codicem' \
--tags='#item+rem' \
--merge="$objectivum_archivum_temporarium_b_u_wiki_2_3" \
"$objectivum_archivum_temporarium_b_u_wiki_1_3" \
>"$objectivum_archivum_temporarium_b_u_wiki_1m2"

hxlmerge --keys='#item+conceptum+codicem' \
--tags='#item+rem' \
--merge="$objectivum_archivum_temporarium_b_u_wiki_3_3" \
"$objectivum_archivum_temporarium_b_u_wiki_1m2" \
>"$objectivum_archivum_temporarium_b_u_wiki"

# TODO: implement check fo see if there is more than one Q columns, then use
# as baseline

rm "$objectivum_archivum_temporarium"
rm "$objectivum_archivum_temporarium_b"
# rm "$objectivum_archivum_temporarium_b_u"
rm "$objectivum_archivum_temporarium_b_u"
rm "$objectivum_archivum_temporarium_b_u_wiki_1_3"
rm "$objectivum_archivum_temporarium_b_u_wiki_2_3"
rm "$objectivum_archivum_temporarium_b_u_wiki_3_3"
rm "$objectivum_archivum_temporarium_b_u_wiki_1m2"

# cp "$objectivum_archivum_temporarium_b_u_wiki_1_3" "$objectivum_archivum_temporarium_b_u_wiki"

# mv "$objectivum_archivum_temporarium_b_u_wiki" "$objectivum_archivum"

echo "debug objectivum_archivum_temporarium_b_u_wiki $objectivum_archivum_temporarium_b_u_wiki"
# echo "debug objectivum_archivum_temporarium_b_u_wiki $objectivum_archivum_temporarium_b_u_wiki"

file_update_if_necessary csv "$objectivum_archivum_temporarium_b_u_wiki" "$objectivum_archivum"

Expand Down

0 comments on commit 4ee67b8

Please sign in to comment.