Skip to content

Commit

Permalink
Include units for values relating to Sampling (https://github.com/emo…
Browse files Browse the repository at this point in the history
  • Loading branch information
laurianvm committed Oct 22, 2024
1 parent f3196d4 commit 1adc155
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 8 deletions.
56 changes: 52 additions & 4 deletions templates/sediment_sampling.ldt.ttl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,63 @@ Sets:
{%- endif %}
{%- if _.depth != "NA" %}
{%- if _.depth.startswith('>')%} {#case 1: > #}
emobon-sampling:minSampleDepth {{ _.depth | xsd("string") | safe }} ;
emobon-sampling:minSampleDepth [
a qudt:QuantityValue ;
qudt:numericValue {{ _.depth | xsd("integer") | safe }} ;
{%- for row in sets['schema']%}
{%- if row['LogsheetColumnTitle'] == 'depth' %}
{%- if row['Unit_URL'] and row['Unit_URL'] != "NA" %}
qudt:unit <{{row['Unit_URL'].strip() | safe }}> ;
{%- elif row['Unit'] and row['Unit'] != "NA" %}
qudt:unit {{row['Unit'].strip() | xsd('string') | safe }} ;
{%- endif %}
{%- endif %}
{%- endfor %}
] ;
{%- endif %}
{%- if _.depth.startswith('<')%} {#case 2: < #}
emobon-sampling:maxSampleDepth {{ _.depth | xsd("string") | safe }} ;
emobon-sampling:maxSampleDepth [
a qudt:QuantityValue ;
qudt:numericValue {{ _.depth | xsd("integer") | safe }} ;
{%- for row in sets['schema']%}
{%- if row['LogsheetColumnTitle'] == 'depth' %}
{%- if row['Unit_URL'] and row['Unit_URL'] != "NA" %}
qudt:unit <{{row['Unit_URL'].strip() | safe }}> ;
{%- elif row['Unit'] and row['Unit'] != "NA" %}
qudt:unit {{row['Unit'].strip() | xsd('string') | safe }} ;
{%- endif %}
{%- endif %}
{%- endfor %}
] ;
{%- endif %}
{%- if '-' in _.depth %} {# case 3: (range/single value) x-y/x-x (assuming smallest always first) #}
{% set x,y == _.depth.split('-') %}
emobon-sampling:minSampleDepth {{ x | xsd("string") | safe }} ;
emobon-sampling:maxSampleDepth {{ y | xsd("string") | safe }} ;
emobon-sampling:minSampleDepth [
a qudt:QuantityValue ;
qudt:numericValue {{ x | xsd("integer") | safe }} ;
{%- for row in sets['schema']%}
{%- if row['LogsheetColumnTitle'] == 'depth' %}
{%- if row['Unit_URL'] and row['Unit_URL'] != "NA" %}
qudt:unit <{{row['Unit_URL'].strip() | safe }}> ;
{%- elif row['Unit'] and row['Unit'] != "NA" %}
qudt:unit {{row['Unit'].strip() | xsd('string') | safe }} ;
{%- endif %}
{%- endif %}
{%- endfor %}
] ;
emobon-sampling:maxSampleDepth [
a qudt:QuantityValue ;
qudt:numericValue {{ y | xsd("integer") | safe }} ;
{%- for row in sets['schema']%}
{%- if row['LogsheetColumnTitle'] == 'depth' %}
{%- if row['Unit_URL'] and row['Unit_URL'] != "NA" %}
qudt:unit <{{row['Unit_URL'].strip() | safe }}> ;
{%- elif row['Unit'] and row['Unit'] != "NA" %}
qudt:unit {{row['Unit'].strip() | xsd('string') | safe }} ;
{%- endif %}
{%- endif %}
{%- endfor %}
] ;
{%- endif %}
{#emobon-sampling:sampleDepth {{ _.depth | xsd("string") | safe }} ; #}
{%- endif %}
Expand Down
56 changes: 52 additions & 4 deletions templates/water_sampling.ldt.ttl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,63 @@ Sets:
{%- endif %}
{%- if _.depth != "NA" %}
{%- if _.depth.startswith('>')%} {#case 1: > #}
emobon-sampling:minSampleDepth {{ _.depth | xsd("string") | safe }} ;
emobon-sampling:minSampleDepth [
a qudt:QuantityValue ;
qudt:numericValue {{ _.depth | xsd("integer") | safe }} ;
{%- for row in sets['schema']%}
{%- if row['LogsheetColumnTitle'] == 'depth' %}
{%- if row['Unit_URL'] and row['Unit_URL'] != "NA" %}
qudt:unit <{{row['Unit_URL'].strip() | safe }}> ;
{%- elif row['Unit'] and row['Unit'] != "NA" %}
qudt:unit {{row['Unit'].strip() | xsd('string') | safe }} ;
{%- endif %}
{%- endif %}
{%- endfor %}
] ;
{%- endif %}
{%- if _.depth.startswith('<')%} {#case 2: < #}
emobon-sampling:maxSampleDepth {{ _.depth | xsd("string") | safe }} ;
emobon-sampling:maxSampleDepth [
a qudt:QuantityValue ;
qudt:numericValue {{ _.depth | xsd("integer") | safe }} ;
{%- for row in sets['schema']%}
{%- if row['LogsheetColumnTitle'] == 'depth' %}
{%- if row['Unit_URL'] and row['Unit_URL'] != "NA" %}
qudt:unit <{{row['Unit_URL'].strip() | safe }}> ;
{%- elif row['Unit'] and row['Unit'] != "NA" %}
qudt:unit {{row['Unit'].strip() | xsd('string') | safe }} ;
{%- endif %}
{%- endif %}
{%- endfor %}
] ;
{%- endif %}
{%- if '-' in _.depth %} {# case 3: (range/single value) x-y/x-x (assuming smallest always first) #}
{% set x,y == _.depth.split('-') %}
emobon-sampling:minSampleDepth {{ x | xsd("string") | safe }} ;
emobon-sampling:maxSampleDepth {{ y | xsd("string") | safe }} ;
emobon-sampling:minSampleDepth [
a qudt:QuantityValue ;
qudt:numericValue {{ x | xsd("integer") | safe }} ;
{%- for row in sets['schema']%}
{%- if row['LogsheetColumnTitle'] == 'depth' %}
{%- if row['Unit_URL'] and row['Unit_URL'] != "NA" %}
qudt:unit <{{row['Unit_URL'].strip() | safe }}> ;
{%- elif row['Unit'] and row['Unit'] != "NA" %}
qudt:unit {{row['Unit'].strip() | xsd('string') | safe }} ;
{%- endif %}
{%- endif %}
{%- endfor %}
] ;
emobon-sampling:maxSampleDepth [
a qudt:QuantityValue ;
qudt:numericValue {{ y | xsd("integer") | safe }} ;
{%- for row in sets['schema']%}
{%- if row['LogsheetColumnTitle'] == 'depth' %}
{%- if row['Unit_URL'] and row['Unit_URL'] != "NA" %}
qudt:unit <{{row['Unit_URL'].strip() | safe }}> ;
{%- elif row['Unit'] and row['Unit'] != "NA" %}
qudt:unit {{row['Unit'].strip() | xsd('string') | safe }} ;
{%- endif %}
{%- endif %}
{%- endfor %}
] ;
{%- endif %}
{#emobon-sampling:sampleDepth {{ _.depth | xsd("string") | safe }} ; #}
{%- endif %}
Expand Down

0 comments on commit 1adc155

Please sign in to comment.