Skip to content

Commit

Permalink
Add distinction between min/max depth (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurianvm committed Oct 21, 2024
1 parent e83c966 commit 3b18f4a
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 5 deletions.
26 changes: 24 additions & 2 deletions templates/sediment_sampling.ldt.ttl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,18 @@ Sets:
emobon-sampling:tidalStage {{_.tidal_stage | xsd("string") | safe }} ;
{%- endif %}
{%- if _.depth != "NA" %}
emobon-sampling:samplingDepth {{ _.depth | xsd("string") | safe }} ; {#mix of string and float|string#}
{%- if _.depth.startswith('>')%} {#case 1: > #}
emobon-sampling:minSamplingDepth {{ _.depth | xsd("string") | safe }} ;
{%- endif %}
{%- if _.depth.startswith('<')%} {#case 2: < #}
emobon-sampling:maxSamplingDepth {{ _.depth | xsd("string") | safe }} ;
{%- endif %}
{%- if '-' in _.depth %} {# case 3: (range/single value) x-y/x-x (assuming smallest always first) #}
{% set x,y = _.depth.split('-') %}
emobon-sampling:minSamplingDepth {{ x | xsd("string") | safe }} ;
emobon-sampling:maxSamplingDepth {{ y | xsd("string") | safe }} ;
{%- endif %}
{#emobon-sampling:samplingDepth {{ _.depth | xsd("string") | safe }} ; #}
{%- endif %}
{%- if observatory.tot_depth_water_col != "NA" %}
emobon-sampling:waterColumnDepth {{observatory.tot_depth_water_col | xsd("string") | safe }} ; {#info from observ file - better suited here#}
Expand Down Expand Up @@ -126,7 +137,18 @@ Sets:
emobon-sampling:failure 'false'^^xsd:boolean ;
{%- endif %}
{%- if _.depth != "NA" %}
emobon-sampling:sampleDepth {{ _.depth | xsd("string") | safe }} ;
{%- if _.depth.startswith('>')%} {#case 1: > #}
emobon-sampling:minSampleDepth {{ _.depth | xsd("string") | safe }} ;
{%- endif %}
{%- if _.depth.startswith('<')%} {#case 2: < #}
emobon-sampling:maxSampleDepth {{ _.depth | xsd("string") | safe }} ;
{%- 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 }} ;
{%- endif %}
{#emobon-sampling:sampleDepth {{ _.depth | xsd("string") | safe }} ; #}
{%- endif %}
{%- if _.samp_size_mass != "NA" %}
emobon-sampling:hasSampleSize {{ _.samp_size_mass | xsd("string") | safe }} ; {#mix of string and float|string#}
Expand Down
27 changes: 24 additions & 3 deletions templates/water_sampling.ldt.ttl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,18 @@ Sets:
emobon-sampling:tidalStage {{_.tidal_stage | xsd("string") | safe }} ;
{%- endif %}
{%- if _.depth != "NA" %}
emobon-sampling:samplingDepth {{ _.depth | xsd("string") | safe }} ; {#mix of string and float|string#}
{%- endif %}
{%- if _.depth.startswith('>')%} {#case 1: > #}
emobon-sampling:minSamplingDepth {{ _.depth | xsd("string") | safe }} ;
{%- endif %}
{%- if _.depth.startswith('<')%} {#case 2: < #}
emobon-sampling:maxSamplingDepth {{ _.depth | xsd("string") | safe }} ;
{%- endif %}
{%- if '-' in _.depth %} {# case 3: (range/single value) x-y/x-x (assuming smallest always first) #}
{% set x,y = _.depth.split('-') %}
emobon-sampling:minSamplingDepth {{ x | xsd("string") | safe }} ;
emobon-sampling:maxSamplingDepth {{ y | xsd("string") | safe }} ;
{%- endif %}
{#emobon-sampling:samplingDepth {{ _.depth | xsd("string") | safe }} ; #} {%- endif %}
{%- if observatory.tot_depth_water_col != "NA" %}
emobon-sampling:waterColumnDepth {{observatory.tot_depth_water_col | xsd("string") | safe }} ; {#info from observ file - better suited here#}
{%- endif %}
Expand Down Expand Up @@ -125,7 +135,18 @@ Sets:
emobon-sampling:failure 'false'^^xsd:boolean ;
{%- endif %}
{%- if _.depth != "NA" %}
emobon-sampling:sampleDepth {{ _.depth | xsd("string") | safe }} ;
{%- if _.depth.startswith('>')%} {#case 1: > #}
emobon-sampling:minSampleDepth {{ _.depth | xsd("string") | safe }} ;
{%- endif %}
{%- if _.depth.startswith('<')%} {#case 2: < #}
emobon-sampling:maxSampleDepth {{ _.depth | xsd("string") | safe }} ;
{%- 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 }} ;
{%- endif %}
{#emobon-sampling:sampleDepth {{ _.depth | xsd("string") | safe }} ; #}
{%- endif %}
{%- if _.samp_size_vol != "NA" %}
emobon-sampling:hasSampleSize {{ _.samp_size_vol | xsd("string") | safe }} ; {#mix of string and float|string#}
Expand Down

0 comments on commit 3b18f4a

Please sign in to comment.