Skip to content

Commit

Permalink
rdf+bcp47+hxl (#41), skos (#38): ok, at least not breaking the reasoner
Browse files Browse the repository at this point in the history
  • Loading branch information
fititnt committed Jun 14, 2022
1 parent 24d9f1c commit 3c0d91c
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 18 deletions.
63 changes: 46 additions & 17 deletions officina/999999999/0/L999999999_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -2412,7 +2412,18 @@ def _helper_aux_triple(
trivium_antecessori = linea[index_id].split(':')
# This initialize
trivium_antecessori.pop()
numerordinatio_cum_antecessoribus(trivium_antecessori)
if len(trivium_antecessori) > 0 and len(trivium_antecessori[0]) > 0:
# trivium_antecessori = list(trivium_antecessori)
numerordinatio_cum_antecessoribus(trivium_antecessori)

_ns = ':'.join(trivium_antecessori)

if len(_ns.strip()) > 0:
result['rdf_triplis'].append([
'<urn:mdciii:{0}()>'.format(_ns),
'skos:member',
triple_subject
])
elif is_urn:
triple_subject = '<urn:{0}>'.format(linea[index_id])
triple_rdfs_label_literal = linea[index_id]
Expand Down Expand Up @@ -5851,6 +5862,9 @@ def numerordinatio_cum_antecessoribus(
_numerordinatio = numerordinatio_neo_separatum(numerordinatio, ':')
numerordinatio = _numerordinatio.split(':')

if len(numerordinatio) == 0 or len(numerordinatio[0].strip()) == 0:
raise SyntaxError(numerordinatio)

if ':'.join(numerordinatio) in NUMERODINATIO_ANTECESSORIBUS__OKAY:
return NUMERODINATIO_ANTECESSORIBUS__RDF_TRIPLIS

Expand Down Expand Up @@ -5882,14 +5896,14 @@ def numerordinatio_cum_antecessoribus(
elif ordo == radix:
NUMERODINATIO_ANTECESSORIBUS__RDF_TRIPLIS.extend([
[
'<urn:{0}:{1}::>'.format(praefixum, ':'.join(trivium)),
'<urn:{0}:{1}()>'.format(praefixum, ':'.join(trivium)),
'a',
'skos:ConceptScheme',
],
[
'<urn:{0}:{1}::>'.format(praefixum, ':'.join(trivium)),
'<urn:{0}:{1}()>'.format(praefixum, ':'.join(trivium)),
'rdfs:label',
'"::{0}::"'.format(':'.join(trivium)),
'"({0})"'.format(':'.join(trivium)),
],
# [
# '<urn:{0}:{1}>'.format(praefixum, ':'.join(trivium)),
Expand All @@ -5901,43 +5915,58 @@ def numerordinatio_cum_antecessoribus(
elif ordo == (radix + 1):
NUMERODINATIO_ANTECESSORIBUS__RDF_TRIPLIS.extend([
[
'<urn:{0}:{1}::>'.format(praefixum, ':'.join(trivium)),
'<urn:{0}:{1}()>'.format(praefixum, ':'.join(trivium)),
'a',
# 'skos:ConceptScheme',
'skos:Collection',
],
[
'<urn:{0}:{1}::>'.format(praefixum, ':'.join(trivium)),
'<urn:{0}:{1}()>'.format(praefixum, ':'.join(trivium)),
'rdfs:label',
'"::{0}::"'.format(':'.join(trivium)),
'"({0})"'.format(':'.join(trivium)),
],
[
'<urn:{0}:{1}::>'.format(praefixum, ':'.join(trivium)),
# 'skos:inScheme',
'skos:member',
'<urn:{0}:{1}::>'.format(
'<urn:{0}:{1}()>'.format(praefixum, ':'.join(trivium)),
# 'skos:member',
# '<urn:{0}:{1}()>'.format(
# praefixum, ':'.join(trivium_antecessori)),
'skos:inScheme',
# 'skos:member',
'<urn:{0}:{1}()>'.format(
praefixum, ':'.join(trivium_antecessori)),
# '<urn:{0}:{1}()>'.format(praefixum, ':'.join(trivium)),
]
# [
# # '<urn:{0}:{1}::>'.format(praefixum, ':'.join(trivium)),
# # 'skos:member',
# '<urn:{0}:{1}()>'.format(
# praefixum, ':'.join(trivium_antecessori)),
# # 'skos:inScheme',
# 'skos:member',
# # '<urn:{0}:{1}::>'.format(
# # praefixum, ':'.join(trivium_antecessori)),
# '<urn:{0}:{1}()>'.format(praefixum, ':'.join(trivium)),
# ]
])
else:
NUMERODINATIO_ANTECESSORIBUS__RDF_TRIPLIS.extend([
[
'<urn:{0}:{1}::>'.format(praefixum, ':'.join(trivium)),
'<urn:{0}:{1}()>'.format(praefixum, ':'.join(trivium)),
'a',
# 'skos:ConceptScheme',
'skos:Collection',
],
[
'<urn:{0}:{1}::>'.format(praefixum, ':'.join(trivium)),
'<urn:{0}:{1}()>'.format(praefixum, ':'.join(trivium)),
'rdfs:label',
'"::{0}::"'.format(':'.join(trivium)),
'"({0})"'.format(':'.join(trivium)),
],
[
'<urn:{0}:{1}::>'.format(praefixum, ':'.join(trivium)),
'<urn:{0}:{1}()>'.format(
praefixum, ':'.join(trivium_antecessori)),
# 'skos:inScheme',
'skos:member',
'<urn:{0}:{1}::>'.format(
praefixum, ':'.join(trivium_antecessori)),
'<urn:{0}:{1}()>'.format(praefixum, ':'.join(trivium)),
]
])
pass
Expand Down
2 changes: 1 addition & 1 deletion officina/999999999/1603_45_16.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ bootstrap_1603_45_16__all() {
continue
fi

bootstrap_1603_45_16__item_no1 "$numerordinatio_praefixo" "$unm49" "$v_iso3" "$v_iso2" "$cod_ab_level_max" "1" "0"
# bootstrap_1603_45_16__item_no1 "$numerordinatio_praefixo" "$unm49" "$v_iso3" "$v_iso2" "$cod_ab_level_max" "1" "0"
bootstrap_1603_45_16__item_rdf "$numerordinatio_praefixo" "$unm49" "$v_iso3" "$v_iso2" "$cod_ab_level_max" "1" "0"

# echo "Sleep 5 (disable me later)"
Expand Down

0 comments on commit 3c0d91c

Please sign in to comment.