Skip to content

Commit

Permalink
999999999_521850.py (#43): great. Now the nested complex relations on…
Browse files Browse the repository at this point in the history
… RDF form start to make sense
  • Loading branch information
fititnt committed Aug 4, 2022
1 parent 8799a2a commit 64bbcf2
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
13 changes: 13 additions & 0 deletions officina/999999999/0/999999999_521850.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@
'#{t}+rem+i_qcc+is_zxxx+ix_iso8601v{v1}+rdf_p_wdata_p{v2}_s{trivio}+rdf_t_xsd_int': r"^#(?P<t>[a-z0-9]{3,99})\+rem\+i_qcc\+is_zxxx\+ix_iso8601v(?P<v1>[0-9]{4})\+ix_xywdatap(?P<v2>[0-9]{1,12})"
}

DATA_HXLTM_CASTTYPE = {
'ix_xywdatap1082': 'rdf_t_xsd_int',
'ix_xywdatap1539': 'rdf_t_xsd_int',
'ix_xywdatap1540': 'rdf_t_xsd_int',
'ix_xywdatap6344': 'rdf_t_xsd_int',
'ix_xywdatap6343': 'rdf_t_xsd_int',
}

DATA_METHODUS = {
'worldbank': {
# https://data.worldbank.org/topic/health?view=chart
Expand Down Expand Up @@ -973,6 +981,11 @@ def _no1lize(self, caput: list):
resultatum.append('')
continue

for ix_item, rdf_t_item in DATA_HXLTM_CASTTYPE.items():
if res.find(ix_item) > -1 and res.find(rdf_t_item) == -1:
res = res + '+' + rdf_t_item
# pass

res = hxltm_hashtag_ix_ad_rdf(res)
resultatum.append(res)
continue
Expand Down
27 changes: 24 additions & 3 deletions officina/999999999/0/L999999999_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -2986,20 +2986,36 @@ def _helper_aux_triple(
# print('bag_meta', rdf_trivio_hxla, bcp47_privateuse)
# print('bag_meta', bcp47_privateuse[0].startswith(rdf_trivio_hxla[0]))
_trivio_hxla = None
_trivio_hxla_list = []
for _hxla in rdf_trivio_hxla:
for _item in bcp47_privateuse:
if _item.startswith(_hxla):
# raise ValueError('foi', triples)
_trivio_hxla = 'ix:{0}'.format(_item)
# _trivio_hxla = 'ix:{0}'.format(_item)
_trivio_hxla_list.append(_item)
# triples.append(['#<foi>', _trivio_hxla, _hxla])

if len(_trivio_hxla_list) > 0:
sorted(_trivio_hxla_list)
if len(_trivio_hxla_list) == 1:
_trivio_hxla = 'ix:{0}'.format(_trivio_hxla_list[0])
else:
_parts = []
# if using owl:unionOf (ix:item1 ix:item2 ix:item3)
# for _item in _trivio_hxla_list:
# _parts.append('ix:{0}'.format(_item))
# _trivio_hxla = 'owl:unionOf ({0})'.format(' '.join(_parts))
for _item in _trivio_hxla_list:
_parts.append('ix:{0}'.format(_item))
_trivio_hxla = 'ix:{0}'.format('__'.join(_trivio_hxla_list))

if _trivio_hxla is not None:
triples_novo = []
for _triple_item in triples:
_bn = '_:{0}'.format(uuid.uuid3(
uuid.NAMESPACE_DNS,
_triple_item[0]
# str(_triple_item[0], _triple_item[1])
# _triple_item[0]
str('{}{}'.format(_triple_item[0], _triple_item[1]))
))
triples_novo.append([
_triple_item[0],
Expand All @@ -3012,7 +3028,12 @@ def _helper_aux_triple(
_triple_item[2]
])
# pass
# if len(triples):
# print(_bn)
# print('old', triples)
triples = triples_novo
# if len(triples):
# raise ValueError(triples, triples_novo)

return triples, triples_delayed

Expand Down

0 comments on commit 64bbcf2

Please sign in to comment.