Skip to content

Commit

Permalink
999999999_521850.py (#43): --rdf-per-trivio MVP; create blanknodes (w…
Browse files Browse the repository at this point in the history
…hich can be merged back to ttl with other tools)
  • Loading branch information
fititnt committed Jul 31, 2022
1 parent 1587d50 commit dcb5138
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 5 deletions.
4 changes: 4 additions & 0 deletions officina/999999999/0/999999999_521850.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@
],
}

DATA_HXLTM_AD_RDFTYPE = {
'ix_iso8601v': ''
}


def parse_hashtag(hashtag: str) -> dict:
"""parse_hashtag
Expand Down
30 changes: 25 additions & 5 deletions officina/999999999/0/L999999999_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,7 @@ def _expand_hxl_ad_rdf():
'wdt': 'http://www.wikidata.org/prop/direct/',
'wdv': 'http://www.wikidata.org/value/',
'p': 'http://www.wikidata.org/prop/', # NOTE: preffer use wdata for datasets
'xsd': 'http://www.w3.org/2001/XMLSchema#',
}
# For "Base OWL" of Wikidata, download link: http://wikiba.se/ontology

Expand Down Expand Up @@ -2985,15 +2986,29 @@ def _helper_aux_triple(
for _item in bcp47_privateuse:
if _item.startswith(_hxla):
# raise ValueError('foi', triples)
_trivio_hxla = 'ix:{0}'.format(_hxla)
triples.append(['#<foi>', _trivio_hxla, _hxla])
_trivio_hxla = 'ix:{0}'.format(_item)
# triples.append(['#<foi>', _trivio_hxla, _hxla])

if _trivio_hxla is not None:
triples_novo = []
for _triple_item in triples:
_bn = uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org')
pass

_bn = '_:{0}'.format(uuid.uuid3(
uuid.NAMESPACE_DNS,
_triple_item[0]
# str(_triple_item[0], _triple_item[1])
))
triples_novo.append([
_triple_item[0],
_triple_item[1],
_bn
])
triples_novo.append([
_bn,
_trivio_hxla,
_triple_item[2]
])
# pass
triples = triples_novo

return triples, triples_delayed

Expand Down Expand Up @@ -3107,6 +3122,11 @@ def _helper_aux_triple(
# @TODO remove this later.
del result['rdf_spatia_nominalibus']

# raise ValueError(result['caput_asa'].keys())
if rdf_trivio_hxla and len(rdf_trivio_hxla) > 0:
# We're likely to need upfront. So lets already add it
result['caput_asa']['rdf_spatia_nominalibus']['ix'] = 'urn:hxl:vocab:a:ix:'

result['antecessoribus_rdf_triplis'] = \
NUMERODINATIO_ANTECESSORIBUS__RDF_TRIPLIS

Expand Down
7 changes: 7 additions & 0 deletions officina/999999999/1568346/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
- `BCP47_EX_HXL` on L999999999_0.py is just a syntatic sugar for
`#item+conceptum+codicem` and `#item+conceptum+numerordinatio`

## Note on harecoded special cases for cell value expansion: HXL `+rdf_t_xsd_datetime*` and BCP47 `-r-y*`
Full example:

- `xsd:dateTime`
- HXL attribute: `#item+rem+i_qcc+is_zxxx+rdf_t_xsd_datetime`
- BPC 47 part attribute: `qcc-Zxxx-r-tXSD-tdatetime-tnop`

## Note on harecoded special cases for cell value expansion: HXL `+rdf_y_*` and BCP47 `-r-y*`

### Explode list of items
Expand Down
1 change: 1 addition & 0 deletions officina/999999999/999999_17.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ set -x
--methodus=_temp_no1 \
--rdf-sine-spatia-nominalibus=devnull,mdciii \
--rdf-trivio=1603 \
--rdf-per-trivio='iso8601v' \
"999999/0/1603_992_1_0~worldbank~SP_POP_TOTL.no1.tm.hxl.csv" \
>"999999/0/1603_992_1_0~worldbank~SP_POP_TOTL~TEMP.no1.owl.ttl"

Expand Down

0 comments on commit dcb5138

Please sign in to comment.