Skip to content

Commit

Permalink
999999999_7200235.py (#39): hxltm_carricato__cod_ab_levels_ttl() draft
Browse files Browse the repository at this point in the history
  • Loading branch information
fititnt committed May 25, 2022
1 parent d7dfd87 commit 5c47fb9
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 13 deletions.
46 changes: 43 additions & 3 deletions officina/999999999/0/999999999_7200235.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
# hxltm_sine_columnis,
hxltm_ex_selectis,
hxltm_index_praeparationi,
numerordinatio_progenitori,
qhxl_hxlhashtag_2_bcp47,
HXLTMAdRDFSimplicis,
numerordinatio_neo_separatum,
Expand Down Expand Up @@ -255,6 +256,7 @@ def make_args(self, hxl_output=True):
# 'pcode_ex_csv',
'cod_ab_index',
'cod_ab_index_levels',
'cod_ab_index_levels_ttl',
'cod_ab_ad_rdf_skos_ttl',
'de_hxltm_ad_hxltm', # load main file directly
# load main file by number (example: 1603_45_49)
Expand Down Expand Up @@ -636,7 +638,8 @@ def execute_cli(self, pyargs, stdin=STDIN, _stdout=sys.stdout,
# raise NotImplementedError(pyargs.methodus)
if pyargs.methodus in [
'de_hxltm_ad_hxltm', 'de_librario',
'index_praeparationi', 'cod_ab_index', 'cod_ab_index_levels']:
'index_praeparationi', 'cod_ab_index',
'cod_ab_index_levels', 'cod_ab_index_levels_ttl']:
# Decide which main file to load.
# if pyargs.methodus.startswith('de_librario'):
if pyargs.methodus.startswith(
Expand All @@ -653,13 +656,19 @@ def execute_cli(self, pyargs, stdin=STDIN, _stdout=sys.stdout,
elif pyargs.methodus.startswith('cod_ab_index'):
caput, data = hxltm_carricato(COD_AB_INDEX)

if pyargs.methodus == 'cod_ab_index_levels':
# if pyargs.methodus == 'cod_ab_index_levels':
if pyargs.methodus.startswith('cod_ab_index_levels'):
# @TODO cod_ab_index_levels
# caput, data = hxltm_carricato(COD_AB_INDEX)
# raise NotImplementedError(pyargs.methodus)

caput, data = hxltm_carricato__cod_ab_levels(caput, data)

if pyargs.methodus == 'cod_ab_index_levels_ttl':
paginae = hxltm_carricato__cod_ab_levels_ttl(caput, data)
for linea in paginae:
print(linea)
return self.EXIT_OK

est_data_referentibus = hxltm__est_data_referentibus(
pyargs.adde_columnis,
pyargs.ex_selectis,
Expand Down Expand Up @@ -1025,6 +1034,7 @@ def hxltm_carricato__cod_ab_levels(
Args:
caput (list): _description_
data (list): _description_
numerordinatio_praefixo (str): _description_
Returns:
Tuple[list, list]: _description_
Expand Down Expand Up @@ -1075,6 +1085,36 @@ def hxltm_carricato__cod_ab_levels(
return caput_novo, data_novis


def hxltm_carricato__cod_ab_levels_ttl(
caput: list, data: list, numerordinatio_praefixo: str = '1603_45_16'
) -> list:
"""hxltm_carricato__cod_ab_levels filter cod_ab_index into a list of levels
Args:
caput (list): _description_
data (list): _description_
numerordinatio_praefixo (str): _description_
Returns:
list: _description_
"""
paginae = []

print('caput', caput)

# https://www.wikidata.org/wiki/EntitySchema:E49

# paginae.append('# [{0}]'.format(
# numerordinatio_progenitori(numerordinatio_praefixo, ':')))
# paginae.append('@prefix skos: <http://www.w3.org/2004/02/skos/core#> .')

# for linea in data:
# paginae.append('<urn:{0}>'.format(linea[0]))
# paginae.append(' # {0}'.format(str(linea)))

return paginae


if __name__ == "__main__":

est_cli = Cli()
Expand Down
20 changes: 10 additions & 10 deletions officina/999999999/999999_1679.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,21 @@ ROOTDIR="$(pwd)"

# cat 999999/0/xmlCNES.tm.hxl.csv | ./999999999/0/999999999_54872.py --objectivum-formato=application/x-turtle --archivum-configurationi-ex-fonti=999999999/0/999999999_10263485.meta.yml --praefixum-configurationi-ex-fonti=methodus,datasus_xmlcnae > 999999/0/xmlCNES.no1.skos.ttl

archivum_unzip "999999/0/0/ftp.datasus.gov.br/cnes/CNESBRASIL.ZIP" "xmlCNES.xml" "999999/0/xmlCNES.xml"
# archivum_unzip "999999/0/0/ftp.datasus.gov.br/cnes/CNESBRASIL.ZIP" "xmlCNES.xml" "999999/0/xmlCNES.xml"

./999999999/0/999999999_10263485.py \
--methodus=datasus_xmlcnae --objectivum-formato=hxltm_csv \
"999999/0/xmlCNES.xml" >"999999/0/xmlCNES.tm.hxl.csv"
# ./999999999/0/999999999_10263485.py \
# --methodus=datasus_xmlcnae --objectivum-formato=hxltm_csv \
# "999999/0/xmlCNES.xml" >"999999/0/xmlCNES.tm.hxl.csv"

./999999999/0/999999999_10263485.py \
--methodus=datasus_xmlcnae --objectivum-formato=hxltm_csv \
"999999/0/xmlCNES.xml" >"999999/1603/63/49/76/1603_63_49_76.tm.hxl.csv"
# ./999999999/0/999999999_10263485.py \
# --methodus=datasus_xmlcnae --objectivum-formato=hxltm_csv \
# "999999/0/xmlCNES.xml" >"999999/1603/63/49/76/1603_63_49_76.tm.hxl.csv"

hxlcut --exclude="#meta" "999999/1603/63/49/76/1603_63_49_76.tm.hxl.csv" | hxlcut --skip-untagged | hxladd --before --spec="#item+conceptum+codicem={{#item+rem+i_qcc+is_zxxx+ix_v76vcnes}}" | hxladd --before --spec="#item+conceptum+numerordinatio=1603:63:49:76:{{#item+conceptum+codicem}}" | hxlsort --tags="#item+conceptum+codicem" >"999999/1603/63/49/76/1603_63_49_76.no1.tm.hxl.csv"
# hxlcut --exclude="#meta" "999999/1603/63/49/76/1603_63_49_76.tm.hxl.csv" | hxlcut --skip-untagged | hxladd --before --spec="#item+conceptum+codicem={{#item+rem+i_qcc+is_zxxx+ix_v76vcnes}}" | hxladd --before --spec="#item+conceptum+numerordinatio=1603:63:49:76:{{#item+conceptum+codicem}}" | hxlsort --tags="#item+conceptum+codicem" >"999999/1603/63/49/76/1603_63_49_76.no1.tm.hxl.csv"

sed -i '1d' "999999/1603/63/49/76/1603_63_49_76.no1.tm.hxl.csv"
# sed -i '1d' "999999/1603/63/49/76/1603_63_49_76.no1.tm.hxl.csv"

archivum_copiae "1603_63_49_76" "1603_63_49_76" "no1.tm.hxl.csv" "1" "0"
# archivum_copiae "1603_63_49_76" "1603_63_49_76" "no1.tm.hxl.csv" "1" "0"

# exit 1

Expand Down

0 comments on commit 5c47fb9

Please sign in to comment.