diff --git a/.dockerignore b/.dockerignore index 605503a..e64afa1 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,3 +2,6 @@ /spec /test /tmp +docker-compose.yaml +docker-compose.*.yaml +.dockerignore \ No newline at end of file diff --git a/.env b/.env new file mode 100644 index 0000000..7817581 --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +STA_USER= +STA_PASSWORD= \ No newline at end of file diff --git a/DOCKER.markdown b/DOCKER.markdown index 093f2c6..03950c8 100644 --- a/DOCKER.markdown +++ b/DOCKER.markdown @@ -7,7 +7,7 @@ There is currently no official Docker image on Docker Hub. Please build a Docker ## Building the Image ```terminal -$ docker build -t data-transloader:latest . +docker build -t data-transloader:latest . ``` ## Running a Container @@ -15,7 +15,7 @@ $ docker build -t data-transloader:latest . To test that the container runs: ```terminal -$ docker run -it --rm data-transloader:latest +docker run -it --rm data-transloader:latest ``` This should print the "help" information for the tool. We use `--rm` to delete the container after running, as it is an ephemeral one-time run. @@ -23,7 +23,7 @@ This should print the "help" information for the tool. We use `--rm` to delete t To run the tool in actual usage, a Docker volume should be used to store the data and metadata. ([A bind mount][binds] to the host filesystem may also be used.) ```terminal -$ docker volume create etl-data +docker volume create etl-data ``` The tool can then be ran with the usual parameters; be sure to mount the volume so that the metadata is re-used. diff --git a/Dockerfile b/Dockerfile index a6d0de2..ecdb0bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,10 @@ # Ruby 2.6 is the recommended version -FROM ruby:2.6 +FROM ruby:2.6.6 + +RUN set -ex \ + && apt-get update \ + && apt-get install -y --no-install-recommends curl jq \ + && rm -rf /var/lib/apt/lists/* # Set the language to ensure encodings are handled properly. # Otherwise the transloader tool will have errors parsing. diff --git a/Gemfile b/Gemfile index a7dabdd..8fe23a9 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,7 @@ gem "deep_merge", "~> 1.2" gem "nokogiri", "~> 1.10" gem "parallel", "~> 1.19" gem "pg", "~> 1.2" -gem "rdf-turtle", "~> 3.0" +gem "rdf-turtle", "~> 3.2" gem "semantic_logger", "~> 4.5" gem "spreadsheet", "~> 1.2" diff --git a/Gemfile.lock b/Gemfile.lock index 3c5aa68..e2be9c9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -14,27 +14,26 @@ GEM zeitwerk (~> 2.3) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) - amazing_print (1.3.0) + amazing_print (1.4.0) coderay (1.1.3) concurrent-ruby (1.1.8) crack (0.4.5) rexml deep_merge (1.2.1) diff-lcs (1.4.4) - ebnf (2.1.3) - amazing_print (~> 1.2) + ebnf (2.3.0) + amazing_print (~> 1.4) htmlentities (~> 4.3) - rdf (~> 3.1) + rdf (~> 3.2) scanf (~> 1.0) - sxp (~> 1.1) - unicode-types (~> 1.6) - hamster (3.0.0) - concurrent-ruby (~> 1.0) + sxp (~> 1.2) + unicode-types (~> 1.7) hashdiff (1.0.1) htmlentities (4.3.4) i18n (1.8.10) concurrent-ruby (~> 1.0) link_header (0.0.8) + matrix (0.4.2) method_source (1.0.0) mini_portile2 (2.5.3) minitest (5.14.4) @@ -48,12 +47,11 @@ GEM method_source (~> 1.0) public_suffix (4.0.6) racc (1.5.2) - rdf (3.1.14) - hamster (~> 3.0) + rdf (3.2.3) link_header (~> 0.0, >= 0.0.8) - rdf-turtle (3.1.3) - ebnf (~> 2.1) - rdf (~> 3.1, >= 3.1.8) + rdf-turtle (3.2.0) + ebnf (~> 2.3) + rdf (~> 3.2) rexml (3.2.5) rspec (3.10.0) rspec-core (~> 3.10.0) @@ -75,12 +73,13 @@ GEM concurrent-ruby (~> 1.0) spreadsheet (1.2.9) ruby-ole - sxp (1.1.0) - rdf (~> 3.1) + sxp (1.2.1) + matrix + rdf (~> 3.2) timecop (0.9.4) tzinfo (2.0.4) concurrent-ruby (~> 1.0) - unicode-types (1.6.0) + unicode-types (1.7.0) vcr (5.1.0) webmock (3.13.0) addressable (>= 2.3.6) @@ -98,7 +97,7 @@ DEPENDENCIES parallel (~> 1.19) pg (~> 1.2) pry (~> 0.12) - rdf-turtle (~> 3.0) + rdf-turtle (~> 3.2) rspec (~> 3.9) ruby-prof (~> 1.4) semantic_logger (~> 4.5) diff --git a/README.markdown b/README.markdown index 084c587..ee616a3 100644 --- a/README.markdown +++ b/README.markdown @@ -1,3 +1,7 @@ +**The latest state of the 52North UoM branch of the data transloader is migrated to https://cwincloud.cc.umanitoba.ca/ccadi/transloader (a private repository!) and will be maintained there.** +**Hence, this public fork of the data-transloader by 52N will be archived.** + + # Arctic Sensor Web Data Transloader [![Build Status](https://travis-ci.org/GeoSensorWebLab/data-transloader.svg?branch=master)](https://travis-ci.org/GeoSensorWebLab/data-transloader) diff --git a/docker-compose.get-and-put-metadata.yaml b/docker-compose.get-and-put-metadata.yaml new file mode 100644 index 0000000..11210bc --- /dev/null +++ b/docker-compose.get-and-put-metadata.yaml @@ -0,0 +1,260 @@ +# +# Docker compose setup for transloading observations from +# environment canada and data garrison to a SensorThings API +# +# There are two types of services: +# +# * get-metadata-jobs that fetch the metadata from the provider for a station and push it +# to the STA. The jobs are meant to run once and then exit. +# +# * transload-data-jobs are cronjobs that fetch new data from the provider and transload +# it to the STA. There is one cronjob per station. +# +version: "3" + +# Default values/templates for the different services +x-defaults: + # Defaults for the transloader cron job + + get-metadata-environment: &get-metadata-environment + DATA_DIR: /data + # the STA endpoint to load data to + STA_URL: http://sta:8080/FROST-Server/v1.0/ + INSTRUMENT_DETAILS_BASE_URL: https://canwin-datahub.ad.umanitoba.ca/data/instrument_details + STA_USER: ${STA_USER} + STA_PASSWORD: ${STA_PASSWORD} + + # Defaults for getting metadata + get-metadata-job-defaults: &get-metadata-job-defaults + image: data-transloader:latest + build: + context: . + dockerfile: Dockerfile + environment: *get-metadata-environment + restart: "on-failure" + networks: + - sta + volumes: + - data:/data + - ./update-sensors.sh:/usr/local/bin/update-sensors + + # Defaults for getting metadata from data garrison + # + # geolocation and timezone offset can not determined from + # data garrison and have to be supplied using environment + # variables + data-garrision-get-metadata-job-defaults: + &data-garrision-get-metadata-job-defaults + <<: *get-metadata-job-defaults + entrypoint: [/bin/sh, -e, -x, -c] + command: + - | + # getting the metadata from the provider + ruby transload get metadata \ + --provider data_garrison \ + --user_id "$${USER_ID}" \ + --station_id "$${STATION_ID}" \ + --database_url "file://$${DATA_DIR}" \ + --overwrite + + # customize the metadata + ruby transload set metadata \ + --provider data_garrison \ + --user_id "$${USER_ID}" \ + --station_id "$${STATION_ID}" \ + --database_url "file://$${DATA_DIR}" \ + --key longitude \ + --value "$${LONGITUDE}" > /dev/null + ruby transload set metadata \ + --provider data_garrison \ + --user_id "$${USER_ID}" \ + --station_id "$${STATION_ID}" \ + --database_url "file://$${DATA_DIR}" \ + --key latitude \ + --value "$${LATITUDE}" > /dev/null + ruby transload set metadata \ + --provider data_garrison \ + --user_id "$${USER_ID}" \ + --station_id "$${STATION_ID}" \ + --database_url "file://$${DATA_DIR}" \ + --key timezone_offset \ + --value "$${TIMEZONE_OFFSET}" > /dev/null + ruby transload set metadata \ + --provider data_garrison \ + --user_id "$${USER_ID}" \ + --station_id "$${STATION_ID}" \ + --database_url "file://$${DATA_DIR}" \ + --key name \ + --value "$${NAME}" > /dev/null + ruby transload set metadata \ + --provider data_garrison \ + --user_id "$${USER_ID}" \ + --station_id "$${STATION_ID}" \ + --database_url "file://$${DATA_DIR}" \ + --key description \ + --value "$${DESCRIPTION}" > /dev/null + + # push the metadata to the STA + if [ -z "$${STA_USER}" ] || [ -z "$${STA_PASSWORD}" ]; then + ruby transload put metadata \ + --database_url "file://$${DATA_DIR}" \ + --destination "$${STA_URL}" \ + --provider data_garrison \ + --user_id "$${USER_ID}" \ + --station_id "$${STATION_ID}" + else + ruby transload put metadata \ + --database_url "file://$${DATA_DIR}" \ + --destination "$${STA_URL}" \ + --provider data_garrison \ + --user_id "$${USER_ID}" \ + --station_id "$${STATION_ID}" \ + --user "$${STA_USER}:$${STA_PASSWORD}" + fi + + update-sensors "$${STATION_ID}" "$${STATION_SENSOR_NAME}" "$${INSTRUMENT_DETAILS}" + + # Defaults for getting metadata from environment canada + environment-canada-get-metadata-job-defaults: + &environment-canada-get-metadata-job-defaults + <<: *get-metadata-job-defaults + entrypoint: [/bin/sh, -e, -x, -c] + command: + - | + # getting the metadata from the provider + ruby transload get metadata --provider environment_canada \ + --station_id "$${STATION_ID}" \ + --database_url "file://$${DATA_DIR}" \ + --overwrite + + # push the metadata to the STA + if [ -z "$${STA_USER}" ] || [ -z "$${STA_PASSWORD}" ]; then + ruby transload put metadata \ + --provider environment_canada \ + --destination "$${STA_URL}" \ + --station_id "$${STATION_ID}" \ + --database_url "file://$${DATA_DIR}" + else + ruby transload put metadata \ + --provider environment_canada \ + --destination "$${STA_URL}" \ + --station_id "$${STATION_ID}" \ + --database_url "file://$${DATA_DIR}" \ + --user "$${STA_USER}:$${STA_PASSWORD}" + fi + +services: + get-metadata-environment-canada-CWCF: # Berens, River + <<: *environment-canada-get-metadata-job-defaults + environment: + <<: *get-metadata-environment + STATION_ID: CWCF + + get-metadata-environment-canada-CWZE: # Carberry, CS + <<: *environment-canada-get-metadata-job-defaults + environment: + <<: *get-metadata-environment + STATION_ID: CWZE + + get-metadata-environment-canada-CWZT: # Dauphin, Airport + <<: *environment-canada-get-metadata-job-defaults + environment: + <<: *get-metadata-environment + STATION_ID: CWZT + + get-metadata-environment-canada-CWSZ: # Fisher, Branch, (auto) + <<: *environment-canada-get-metadata-job-defaults + environment: + <<: *get-metadata-environment + STATION_ID: CWSZ + + get-metadata-environment-canada-CWWS: # George, Island + <<: *environment-canada-get-metadata-job-defaults + environment: + <<: *get-metadata-environment + STATION_ID: CWWS + + get-metadata-environment-canada-CPGH: # Gimli, Climate + <<: *environment-canada-get-metadata-job-defaults + environment: + <<: *get-metadata-environment + STATION_ID: CPGH + + get-metadata-environment-canada-CWJD: # Grand, Rapids, (auto) + <<: *environment-canada-get-metadata-job-defaults + environment: + <<: *get-metadata-environment + STATION_ID: CWJD + + get-metadata-environment-canada-CWOO: # McCreary + <<: *environment-canada-get-metadata-job-defaults + environment: + <<: *get-metadata-environment + STATION_ID: CWOO + + get-metadata-environment-canada-CWOJ: # Oak, Point, Marine + <<: *environment-canada-get-metadata-job-defaults + environment: + <<: *get-metadata-environment + STATION_ID: CWOJ + + get-metadata-environment-canada-CWPG: # Portage, Southport + <<: *environment-canada-get-metadata-job-defaults + environment: + <<: *get-metadata-environment + STATION_ID: CWPG + + get-metadata-environment-canada-CWEQ: # Swan, River, RCS + <<: *environment-canada-get-metadata-job-defaults + environment: + <<: *get-metadata-environment + STATION_ID: CWEQ + + get-metadata-environment-canada-CWII: # victoria, Beach, (auto) + <<: *environment-canada-get-metadata-job-defaults + environment: + <<: *get-metadata-environment + STATION_ID: CWII + + get-metadata-environment-canada-CWWP: # Wasagaming + <<: *environment-canada-get-metadata-job-defaults + environment: + <<: *get-metadata-environment + STATION_ID: CWWP + + get-metadata-data-garrison-MMF1: + <<: *data-garrision-get-metadata-job-defaults + environment: + <<: *get-metadata-environment + USER_ID: "300234068013390" + STATION_ID: "300534063017060" + LATITUDE: "50.40768" + LONGITUDE: "-97.96212" + TIMEZONE_OFFSET: "-06:00" + NAME: St Laurent Li Taan Aen Staansyoon_17060 + STATION_SENSOR_NAME: St Laurent Li Taan Aen Staansyoon + INSTRUMENT_DETAILS: st-laurent-met-sensors + DESCRIPTION: Manitoba Metis Federation weather station located in St.Laurent + + get-metadata-data-garrison-MMF2: + <<: *data-garrision-get-metadata-job-defaults + environment: + <<: *get-metadata-environment + USER_ID: "300234068013390" + STATION_ID: "300534061454190" + LATITUDE: "52.977050" + LONGITUDE: "-100.979630" + TIMEZONE_OFFSET: "-06:00" + NAME: Dawson Bay Li Taan Aen Staansyoon_54190 + STATION_SENSOR_NAME: Dawson Bay Li Taan Aen Staansyoon + INSTRUMENT_DETAILS: dawbay-met-sensors + DESCRIPTION: Manitoba Metis Federation weather station located in Dawson Bay + +volumes: + data: + driver: local + +networks: + sta: + name: uom-frost_default + external: true diff --git a/docker-compose.get-and-put-observations.env b/docker-compose.get-and-put-observations.env new file mode 100644 index 0000000..379f97c --- /dev/null +++ b/docker-compose.get-and-put-observations.env @@ -0,0 +1,9 @@ +# the STA endpoint to load data to +STA_URL=http://sta:8080/FROST-Server/v1.0/ +# the moving window to download data for (optional, defaults to 2 days) +MOVING_WINDOW="2 days" +# the schedule of the job (optional, defaults to @daily) +# currently configured in docker-compose.get-and-put-observations.yaml +# SCHEDULE="34 * * * *" +DATA_DIR=/data +OVERWRITE_METADATA="false" diff --git a/docker-compose.get-and-put-observations.yaml b/docker-compose.get-and-put-observations.yaml new file mode 100644 index 0000000..5b021b7 --- /dev/null +++ b/docker-compose.get-and-put-observations.yaml @@ -0,0 +1,150 @@ +# +# Docker compose setup for transloading observations from +# environment canada and data garrison to a SensorThings API +# +# There are two types of services: +# +# * get-metadata-jobs that fetch the metadata from the provider for a station and push it +# to the STA. The jobs are meant to run once and then exit. +# +# * transload-data-jobs are cronjobs that fetch new data from the provider and transload +# it to the STA. There is one cronjob per station. +# The scheduling of the transload-data-jobs in done manually using the environment +# variable SCHEDULE. The current approach triggers two jobs every 5 minutes for +# keeping the load on the hosting machine lower.# +# +version: "3" + +# Default values/templates for the different services +x-defaults: + # Defaults for the transloader cron job + cronjob: &cron-job-defaults + image: data-transloader-job:latest + build: + context: . + dockerfile: docker/cron/Dockerfile + volumes: + - data:/data + networks: + - sta + restart: unless-stopped + env_file: + - .env + - docker-compose.get-and-put-observations.env + +services: + + transload-data-data-garrison-MMF1: + <<: *cron-job-defaults + environment: + SCHEDULE: "5 * * * *" + command: + [ + --provider, + data_garrison, + --user_id, + "300234068013390", + --station_id, + "300534063017060", + ] + + transload-data-data-garrison-MMF2: + <<: *cron-job-defaults + environment: + SCHEDULE: "5 * * * *" + command: + [ + --provider, + data_garrison, + --user_id, + "300234068013390", + --station_id, + "300534061454190", + ] + + transload-data-environment-canada-CWCF: # Berens, River + <<: *cron-job-defaults + environment: + SCHEDULE: "15 * * * *" + command: [--provider, environment_canada, --station_id, CWCF] + + transload-data-environment-canada-CWZE: # Carberry, CS + <<: *cron-job-defaults + environment: + SCHEDULE: "15 * * * *" + command: [--provider, environment_canada, --station_id, CWZE] + + transload-data-environment-canada-CWZT: # Dauphin, Airport + environment: + SCHEDULE: "20 * * * *" + <<: *cron-job-defaults + command: [--provider, environment_canada, --station_id, CWZT] + + transload-data-environment-canada-CWSZ: # Fisher, Branch, (auto) + environment: + SCHEDULE: "20 * * * *" + <<: *cron-job-defaults + command: [--provider, environment_canada, --station_id, CWSZ] + + transload-data-environment-canada-CWWS: # George, Island + environment: + SCHEDULE: "25 * * * *" + <<: *cron-job-defaults + command: [--provider, environment_canada, --station_id, CWWS] + + transload-data-environment-canada-CPGH: # Gimli, Climate + environment: + SCHEDULE: "25 * * * *" + <<: *cron-job-defaults + command: [--provider, environment_canada, --station_id, CPGH] + + transload-data-environment-canada-CWJD: # Grand, Rapids, (auto) + environment: + SCHEDULE: "30 * * * *" + <<: *cron-job-defaults + command: [--provider, environment_canada, --station_id, CWJD] + + transload-data-environment-canada-CWOO: # McCreary + environment: + SCHEDULE: "30 * * * *" + <<: *cron-job-defaults + command: [--provider, environment_canada, --station_id, CWOO] + + transload-data-environment-canada-CWOJ: # Oak, Point, Marine + environment: + SCHEDULE: "35 * * * *" + <<: *cron-job-defaults + command: [--provider, environment_canada, --station_id, CWOJ] + + transload-data-environment-canada-CWPG: # Portage, Southport + environment: + SCHEDULE: "35 * * * *" + <<: *cron-job-defaults + command: [--provider, environment_canada, --station_id, CWPG] + + transload-data-environment-canada-CWEQ: # Swan, River, RCS + environment: + SCHEDULE: "40 * * * *" + <<: *cron-job-defaults + command: [--provider, environment_canada, --station_id, CWEQ] + + transload-data-environment-canada-CWII: # victoria, Beach, (auto) + environment: + SCHEDULE: "40 * * * *" + <<: *cron-job-defaults + command: [--provider, environment_canada, --station_id, CWII] + + transload-data-environment-canada-CWWP: # Wasagaming + environment: + SCHEDULE: "45 * * * *" + <<: *cron-job-defaults + command: [--provider, environment_canada, --station_id, CWWP] + +volumes: + data: + driver: local + +networks: + sta: + name: uom-frost_default + external: true diff --git a/docker/cron/Dockerfile b/docker/cron/Dockerfile new file mode 100644 index 0000000..8734754 --- /dev/null +++ b/docker/cron/Dockerfile @@ -0,0 +1,37 @@ +# Ruby 2.6 is the recommended version +FROM ruby:2.6.6 + +# Set the language to ensure encodings are handled properly. +# Otherwise the transloader tool will have errors parsing. +ENV LC_ALL C.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US.UTF-8 + +WORKDIR /usr/src/app + +# Set up the gems for this image early, as it is slower +COPY Gemfile Gemfile.lock ./ +RUN bundle install + +# Copy contents of the repository into the image +COPY . . + +# install cron +RUN set -ex \ + && apt-get update \ + && apt-get install -y --no-install-recommends cron \ + && rm -rf /var/lib/apt/lists/* \ + && chmod +x docker/cron/*.sh + + +ENV \ + SCHEDULE="@daily" \ + DATA_DIR=/data \ + MOVING_WINDOW="2 days" \ + STA_URL= \ + OVERWRITE_METADATA=false + + +VOLUME /data + +ENTRYPOINT [ "./docker/cron/entrypoint.sh" ] \ No newline at end of file diff --git a/docker/cron/README.md b/docker/cron/README.md new file mode 100644 index 0000000..8fe78b0 --- /dev/null +++ b/docker/cron/README.md @@ -0,0 +1,43 @@ +# Arctic Sensor Web Data Transloader Cron Job + +The Docker image runs `cron` as PID 1 and regularly executes the following script. Provider specific command line options should be supplied as the Docker command. + +```shell +ruby transload get metadata ... ${COMMAND} # optional +ruby transload put metadata ... ${COMMAND} # optional +ruby transload get observations ... ${COMMAND} +ruby transload put observations ... ${COMMAND} +``` + +Example invocation: + +```sh +docker run -d -e STA_URL="..." -e SCHEDULE="@hourly" -e MOVING_WINDOW="1 day" \ + data-transloader-job:latest --provider environment_canada --station_id CWCF +``` + +## Building + +The build has to be done in the root directory of this repository: + +```shell +docker build -t data-transloader-job:latest -f docker/cron/Dockerfile . +``` + +## Environment Variables + +| Environment Variable | Description | Default Value | +| -------------------- | ----------------------------------------------------------------------------------------------------------------------- | ------------- | +| `SCHEDULE` | A valid cron time specification (see [here][man5crontab]) | `@daily` | +| `DATA_DIR` | The directory to store data. Defaults to the volume `/data`. | `/data` | +| `MOVING WINDOW` | The moving time window of observations to push to th STA, supplied to [`date -d`][man1date] as `"${MOVING_WINDOW} ago"` | `2 days` | +| `STA_URL` | The URL of SensorThings API to push metadata and observations | | +| `STA_USER` | *optional*: username to be used if STA is write protected using basic auth. | | +| `STA_PASSWORD` | *optional*: password to be used if STA is write protected using basic auth. | | +| `OVERWRITE_METADATA` | Whether `get metadata` should be executed with each `cron` invocation. | `false` | + +`STA_USER` and `STA_PASSWORD` must be set both, or none will be used. +These can be set in the `.env` file. + +[man1date]: https://man7.org/linux/man-pages/man1/date.1.html +[man5crontab]: https://man7.org/linux/man-pages/man5/crontab.5.html diff --git a/docker/cron/cronjob.sh b/docker/cron/cronjob.sh new file mode 100755 index 0000000..b3748e8 --- /dev/null +++ b/docker/cron/cronjob.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +set -e +# for debugging +# set -x + +STA_URL="${STA_URL:?"Error: STA_URL not set"}" +DATABASE_URL="file://${DATA_DIR}" +INTERVAL="$(date -u -d "${MOVING_WINDOW} ago" "+%Y-%m-%dT%TZ")/$(date -u "+%Y-%m-%dT%TZ")" + +if [ "$OVERWRITE_METADATA" = "true" ]; then + ruby transload get metadata --database_url "${DATABASE_URL}" --overwrite "$@" + if [ -z "${STA_USER}" ] || [ -z "${STA_PASSWORD}" ]; then + ruby transload put metadata --database_url "${DATABASE_URL}" --destination "${STA_URL}" "$@" + else + ruby transload put metadata --database_url "${DATABASE_URL}" --destination "${STA_URL}" --user "${STA_USER}:${STA_PASSWORD}" "$@" + fi +fi + +ruby transload get observations --database_url "${DATABASE_URL}" "$@" + +if [ -z "${STA_USER}" ] || [ -z "${STA_PASSWORD}" ]; then + ruby transload put observations --database_url "${DATABASE_URL}" --destination "${STA_URL}" --date "${INTERVAL}" "$@" +else + ruby transload put observations --database_url "${DATABASE_URL}" --destination "${STA_URL}" --date "${INTERVAL}" --user "${STA_USER}:${STA_PASSWORD}" "$@" +fi diff --git a/docker/cron/entrypoint.sh b/docker/cron/entrypoint.sh new file mode 100644 index 0000000..ce4b78b --- /dev/null +++ b/docker/cron/entrypoint.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +# fail early +STA_URL=${STA_URL:?"Error: STA_URL not set"} + +# build the command by quoting addtional parameters +COMMAND="cd $(pwd) && ./docker/cron/cronjob.sh" +for PARAM in "$@"; do + COMMAND="$COMMAND ${PARAM@Q}" +done + +# build the crontab +env | sort | grep -Ev '^[^=]+=$' > /etc/cron.d/transloader-job +echo >> /etc/cron.d/transloader-job +echo "${SCHEDULE:-"@daily"} $(id -un) ${COMMAND} > /proc/\$(cat /var/run/crond.pid)/fd/1 2>/proc/\$(cat /var/run/crond.pid)/fd/2" >> /etc/cron.d/transloader-job + +# for debugging +#cat /etc/cron.d/transloader-job +#date + +# give over to cron +exec cron -f -L 15 \ No newline at end of file diff --git a/lib/ontologies/README.markdown b/lib/ontologies/README.markdown index a8ad3bc..36aa68c 100644 --- a/lib/ontologies/README.markdown +++ b/lib/ontologies/README.markdown @@ -1,12 +1,12 @@ # Ontologies -The [RDF][] ontology files in this directory provide semantic mappings for metadata from the data providers into a standard vocabulary of entities for SensorThings API. +The [RDF] ontology files in this directory provide semantic mappings for metadata from the data providers into a standard vocabulary of entities for SensorThings API. Observed Properties from a provider are namespaced and matched to a single Unit of Measurement and Observed Property. A class in the Data Transloader Ruby library will provide an API for looking up these mappings. [RDF]: https://en.wikipedia.org/wiki/Resource_Description_Framework -### Example +## Example The source data provider `Data Garrison` provides observations for a sensor with the property `Pressure` and units `mbar`. This maps to the RDF Individual `DataGarrison:Pressure`. Properties are namespaced by their provider in case different providers use the same names. diff --git a/lib/ontologies/etl-ontology.ttl b/lib/ontologies/etl-ontology.ttl index 751110d..2c923bd 100644 --- a/lib/ontologies/etl-ontology.ttl +++ b/lib/ontologies/etl-ontology.ttl @@ -232,6 +232,13 @@ etl-ontology:DataGarrison:Backup_Batteries rdf:type owl:NamedIndividual , etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:Volt . +### http://gswlab.ca/ontologies/etl-ontology#DataGarrison:Backup_Batts +etl-ontology:DataGarrison:Backup_Batts rdf:type owl:NamedIndividual , + etl-ontology:SourceProperty ; + etl-ontology:matchesObservedProperty etl-ontology:Property:Battery_Voltage ; + etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:Volt . + + ### http://gswlab.ca/ontologies/etl-ontology#DataGarrison:Gust_Speed etl-ontology:DataGarrison:Gust_Speed rdf:type owl:NamedIndividual , etl-ontology:SourceProperty ; @@ -273,7 +280,18 @@ etl-ontology:DataGarrison:Wind_Speed rdf:type owl:NamedIndividual , etl-ontology:matchesObservedProperty etl-ontology:Property:Wind_Speed ; etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:kilometer_per_hour . +### http://gswlab.ca/ontologies/etl-ontology#DataGarrison:PAR +etl-ontology:DataGarrison:PAR rdf:type owl:NamedIndividual , + etl-ontology:SourceProperty ; + etl-ontology:matchesObservedProperty etl-ontology:Property:PAR ; + etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:mikroeinstein_per_square_meter_per_second . +### http://gswlab.ca/ontologies/etl-ontology#DataGarrison:Rain +etl-ontology:DataGarrison:Rain rdf:type owl:NamedIndividual , + etl-ontology:SourceProperty ; + etl-ontology:matchesObservedProperty etl-ontology:Property:Precipitation ; + etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:millimeter . + ### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:air_temp etl-ontology:EnvironmentCanada:air_temp rdf:type owl:NamedIndividual , etl-ontology:SourceProperty ; @@ -281,6 +299,25 @@ etl-ontology:EnvironmentCanada:air_temp rdf:type owl:NamedIndividual , etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:degree_Celsius . +### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:air_temp_1 +etl-ontology:EnvironmentCanada:air_temp_1 rdf:type owl:NamedIndividual , + etl-ontology:SourceProperty ; + etl-ontology:matchesObservedProperty etl-ontology:Property:Air_Temperature_1 ; + etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:degree_Celsius . + +### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:air_temp_2 +etl-ontology:EnvironmentCanada:air_temp_2 rdf:type owl:NamedIndividual , + etl-ontology:SourceProperty ; + etl-ontology:matchesObservedProperty etl-ontology:Property:Air_Temperature_2 ; + etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:degree_Celsius . + +### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:air_temp_3 +etl-ontology:EnvironmentCanada:air_temp_3 rdf:type owl:NamedIndividual , + etl-ontology:SourceProperty ; + etl-ontology:matchesObservedProperty etl-ontology:Property:Air_Temperature_3 ; + etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:degree_Celsius . + + ### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:air_temp_12hrs_ago etl-ontology:EnvironmentCanada:air_temp_12hrs_ago rdf:type owl:NamedIndividual , etl-ontology:SourceProperty ; @@ -299,6 +336,24 @@ etl-ontology:EnvironmentCanada:avg_air_temp_pst1hr rdf:type owl:NamedIndividual etl-ontology:matchesObservedProperty etl-ontology:Property:Average_Air_Temperature_over_past_1_hour ; etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:degree_Celsius . +### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:avg_air_temp_pst1hr_1 +etl-ontology:EnvironmentCanada:avg_air_temp_pst1hr_1 rdf:type owl:NamedIndividual , + etl-ontology:SourceProperty ; + etl-ontology:matchesObservedProperty etl-ontology:Property:Average_Air_Temperature_over_past_1_hour ; + etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:degree_Celsius . + +### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:avg_air_temp_pst1hr_2 +etl-ontology:EnvironmentCanada:avg_air_temp_pst1hr_2 rdf:type owl:NamedIndividual , + etl-ontology:SourceProperty ; + etl-ontology:matchesObservedProperty etl-ontology:Property:Average_Air_Temperature_over_past_1_hour ; + etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:degree_Celsius . + +### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:avg_air_temp_pst1hr_3 +etl-ontology:EnvironmentCanada:avg_air_temp_pst1hr_3 rdf:type owl:NamedIndividual , + etl-ontology:SourceProperty ; + etl-ontology:matchesObservedProperty etl-ontology:Property:Average_Air_Temperature_over_past_1_hour ; + etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:degree_Celsius . + ### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:avg_cum_pcpn_gag_wt_fltrd_mt55-60 etl-ontology:EnvironmentCanada:avg_cum_pcpn_gag_wt_fltrd_mt55-60 rdf:type owl:NamedIndividual , @@ -348,6 +403,24 @@ etl-ontology:EnvironmentCanada:avg_snw_dpth_pst5mts rdf:type owl:NamedIndividual etl-ontology:matchesObservedProperty etl-ontology:Property:Average_snow_depth_over_past_5_minutes ; etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:centimeter . +### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:avg_snw_dpth_pst5mts_1 +etl-ontology:EnvironmentCanada:avg_snw_dpth_pst5mts_1 rdf:type owl:NamedIndividual , + etl-ontology:SourceProperty ; + etl-ontology:matchesObservedProperty etl-ontology:Property:Average_snow_depth_over_past_5_minutes_1 ; + etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:centimeter . + +### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:avg_snw_dpth_pst5mts_2 +etl-ontology:EnvironmentCanada:avg_snw_dpth_pst5mts_2 rdf:type owl:NamedIndividual , + etl-ontology:SourceProperty ; + etl-ontology:matchesObservedProperty etl-ontology:Property:Average_snow_depth_over_past_5_minutes_2 ; + etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:centimeter . + +### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:avg_snw_dpth_pst5mts_3 +etl-ontology:EnvironmentCanada:avg_snw_dpth_pst5mts_3 rdf:type owl:NamedIndividual , + etl-ontology:SourceProperty ; + etl-ontology:matchesObservedProperty etl-ontology:Property:Average_snow_depth_over_past_5_minutes_3 ; + etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:centimeter . + ### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:avg_wnd_dir_10m_mt50-60 etl-ontology:EnvironmentCanada:avg_wnd_dir_10m_mt50-60 rdf:type owl:NamedIndividual , @@ -422,10 +495,24 @@ etl-ontology:EnvironmentCanada:avg_wnd_spd_10m_pst2mts rdf:type owl:NamedIndivid ### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:avg_wnd_spd_pcpn_gag_mt50-60 etl-ontology:EnvironmentCanada:avg_wnd_spd_pcpn_gag_mt50-60 rdf:type owl:NamedIndividual , etl-ontology:SourceProperty ; - etl-ontology:matchesObservedProperty ; + etl-ontology:matchesObservedProperty etl-ontology:Property:10-minute_average_wind_speed_at_the_height_of_the_precipitation_gauge ; etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:kilometer_per_hour . +### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:max_pk_wnd_tm_pst1hr +etl-ontology:EnvironmentCanada:max_pk_wnd_tm_pst1hr rdf:type owl:NamedIndividual , + etl-ontology:SourceProperty ; + etl-ontology:matchesObservedProperty etl-ontology:Property:Max_wind_speed_past_1_hour_timestamp ; + etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:timestamp . + + +### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:max_wnd_gst_spd_10m_pst10mts +etl-ontology:EnvironmentCanada:max_wnd_gst_spd_10m_pst10mts rdf:type owl:NamedIndividual , + etl-ontology:SourceProperty ; + etl-ontology:matchesObservedProperty etl-ontology:Property:Max_10m_wind_gust_speed_over_past_10_minutes ; + etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:kilometer_per_hour . + + ### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:avg_wnd_spd_pcpn_gag_pst10mts etl-ontology:EnvironmentCanada:avg_wnd_spd_pcpn_gag_pst10mts rdf:type owl:NamedIndividual , etl-ontology:SourceProperty ; @@ -551,6 +638,24 @@ etl-ontology:EnvironmentCanada:max_air_temp_pst1hr rdf:type owl:NamedIndividual etl-ontology:matchesObservedProperty etl-ontology:Property:Maximum_Air_Temperature_over_past_1_hour ; etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:degree_Celsius . +### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:max_air_temp_pst1hr_1 +etl-ontology:EnvironmentCanada:max_air_temp_pst1hr_1 rdf:type owl:NamedIndividual , + etl-ontology:SourceProperty ; + etl-ontology:matchesObservedProperty etl-ontology:Property:Maximum_Air_Temperature_over_past_1_hour_1 ; + etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:degree_Celsius . + +### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:max_air_temp_pst1hr_2 +etl-ontology:EnvironmentCanada:max_air_temp_pst1hr_2 rdf:type owl:NamedIndividual , + etl-ontology:SourceProperty ; + etl-ontology:matchesObservedProperty etl-ontology:Property:Maximum_Air_Temperature_over_past_1_hour_2 ; + etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:degree_Celsius . + +### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:max_air_temp_pst1hr_3 +etl-ontology:EnvironmentCanada:max_air_temp_pst1hr_3 rdf:type owl:NamedIndividual , + etl-ontology:SourceProperty ; + etl-ontology:matchesObservedProperty etl-ontology:Property:Maximum_Air_Temperature_over_past_1_hour_3 ; + etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:degree_Celsius . + ### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:max_air_temp_pst24hrs etl-ontology:EnvironmentCanada:max_air_temp_pst24hrs rdf:type owl:NamedIndividual , @@ -639,21 +744,40 @@ etl-ontology:EnvironmentCanada:max_wnd_spd_pst1hr_tm rdf:type owl:NamedIndividua ### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:min_air_temp_pst1hr etl-ontology:EnvironmentCanada:min_air_temp_pst1hr rdf:type owl:NamedIndividual , etl-ontology:SourceProperty ; - etl-ontology:matchesObservedProperty etl-ontology:Property:Maximum_Air_Temperature_over_past_1_hour ; + etl-ontology:matchesObservedProperty etl-ontology:Property:Minimum_Air_Temperature_over_past_1_hour ; etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:degree_Celsius . +### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:min_air_temp_pst1hr_1 +etl-ontology:EnvironmentCanada:min_air_temp_pst1hr_1 rdf:type owl:NamedIndividual , + etl-ontology:SourceProperty ; + etl-ontology:matchesObservedProperty etl-ontology:Property:Minimum_Air_Temperature_over_past_1_hour_1 ; + etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:degree_Celsius . + +### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:min_air_temp_pst1hr_2 +etl-ontology:EnvironmentCanada:min_air_temp_pst1hr_2 rdf:type owl:NamedIndividual , + etl-ontology:SourceProperty ; + etl-ontology:matchesObservedProperty etl-ontology:Property:Minimum_Air_Temperature_over_past_1_hour_2 ; + etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:degree_Celsius . + +### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:min_air_temp_pst1hr_3 +etl-ontology:EnvironmentCanada:min_air_temp_pst1hr_3 rdf:type owl:NamedIndividual , + etl-ontology:SourceProperty ; + etl-ontology:matchesObservedProperty etl-ontology:Property:Minimum_Air_Temperature_over_past_1_hour_3 ; + etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:degree_Celsius . + + ### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:min_air_temp_pst24hrs etl-ontology:EnvironmentCanada:min_air_temp_pst24hrs rdf:type owl:NamedIndividual , etl-ontology:SourceProperty ; - etl-ontology:matchesObservedProperty etl-ontology:Property:Maximum_Air_Temperature_over_past_24_hours ; + etl-ontology:matchesObservedProperty etl-ontology:Property:Minimum_Air_Temperature_over_past_24_hours ; etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:degree_Celsius . ### http://gswlab.ca/ontologies/etl-ontology#EnvironmentCanada:min_air_temp_pst6hrs etl-ontology:EnvironmentCanada:min_air_temp_pst6hrs rdf:type owl:NamedIndividual , etl-ontology:SourceProperty ; - etl-ontology:matchesObservedProperty etl-ontology:Property:Maximum_Air_Temperature_over_past_6_hours ; + etl-ontology:matchesObservedProperty etl-ontology:Property:Minimum_Air_Temperature_over_past_6_hours ; etl-ontology:matchesUnitOfMeasurement etl-ontology:Unit:degree_Celsius . @@ -992,7 +1116,7 @@ etl-ontology:KLRSHistoricalWeather:WindDir_SD1_WVT rdf:type owl:NamedIndividual ### http://gswlab.ca/ontologies/etl-ontology#Property:Air_Pressure etl-ontology:Property:Air_Pressure rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/air_pressure"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0015/"^^xsd:anyURI ; etl-ontology:description "Air pressure is the force per unit area which would be exerted when the moving gas molecules of which the air is composed strike a theoretical surface of any orientation."^^xsd:string ; rdfs:label "Air Pressure" . @@ -1000,7 +1124,28 @@ etl-ontology:Property:Air_Pressure rdf:type owl:NamedIndividual , ### http://gswlab.ca/ontologies/etl-ontology#Property:Air_Temperature etl-ontology:Property:Air_Temperature rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/air_temperature"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0023/"^^xsd:anyURI ; + etl-ontology:description "Air temperature is the bulk temperature of the air, not the surface (skin) temperature."^^xsd:string ; + rdfs:label "Air Temperature" . + +### http://gswlab.ca/ontologies/etl-ontology#Property:Air_Temperature_1 +etl-ontology:Property:Air_Temperature_1 rdf:type owl:NamedIndividual , + etl-ontology:ObservedProperty ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0023/"^^xsd:anyURI ; + etl-ontology:description "Air temperature is the bulk temperature of the air, not the surface (skin) temperature."^^xsd:string ; + rdfs:label "Air Temperature" . + +### http://gswlab.ca/ontologies/etl-ontology#Property:Air_Temperature_2 +etl-ontology:Property:Air_Temperature_2 rdf:type owl:NamedIndividual , + etl-ontology:ObservedProperty ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0023/"^^xsd:anyURI ; + etl-ontology:description "Air temperature is the bulk temperature of the air, not the surface (skin) temperature."^^xsd:string ; + rdfs:label "Air Temperature" . + +### http://gswlab.ca/ontologies/etl-ontology#Property:Air_Temperature_3 +etl-ontology:Property:Air_Temperature_3 rdf:type owl:NamedIndividual , + etl-ontology:ObservedProperty ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0023/"^^xsd:anyURI ; etl-ontology:description "Air temperature is the bulk temperature of the air, not the surface (skin) temperature."^^xsd:string ; rdfs:label "Air Temperature" . @@ -1008,7 +1153,7 @@ etl-ontology:Property:Air_Temperature rdf:type owl:NamedIndividual , ### http://gswlab.ca/ontologies/etl-ontology#Property:Air_Temperature_12_hours_ago etl-ontology:Property:Air_Temperature_12_hours_ago rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/air_temperature"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0023/"^^xsd:anyURI ; etl-ontology:description "Air temperature is the bulk temperature of the air, not the surface (skin) temperature."^^xsd:string ; rdfs:label "Air Temperature 12 hours ago" . @@ -1016,7 +1161,7 @@ etl-ontology:Property:Air_Temperature_12_hours_ago rdf:type owl:NamedIndividual ### http://gswlab.ca/ontologies/etl-ontology#Property:Average_10m_wind_speed_over_past_10_minutes etl-ontology:Property:Average_10m_wind_speed_over_past_10_minutes rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/wind_speed"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0038/"^^xsd:anyURI ; etl-ontology:description "Speed is the magnitude of velocity. Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. The wind speed is the magnitude of the wind velocity."^^xsd:string ; rdfs:label "Average 10 meter wind speed over past 10 minutes" . @@ -1024,7 +1169,7 @@ etl-ontology:Property:Average_10m_wind_speed_over_past_10_minutes rdf:type owl:N ### http://gswlab.ca/ontologies/etl-ontology#Property:Average_10m_wind_speed_over_past_1_hour etl-ontology:Property:Average_10m_wind_speed_over_past_1_hour rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/wind_speed"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0038/"^^xsd:anyURI ; etl-ontology:description "Speed is the magnitude of velocity. Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. The wind speed is the magnitude of the wind velocity."^^xsd:string ; rdfs:label "Average 10 meter wind speed over past 1 hour" . @@ -1032,7 +1177,7 @@ etl-ontology:Property:Average_10m_wind_speed_over_past_1_hour rdf:type owl:Named ### http://gswlab.ca/ontologies/etl-ontology#Property:Average_10m_wind_speed_over_past_2_minutes etl-ontology:Property:Average_10m_wind_speed_over_past_2_minutes rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/wind_speed"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0038/"^^xsd:anyURI ; etl-ontology:description "Speed is the magnitude of velocity. Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. The wind speed is the magnitude of the wind velocity."^^xsd:string ; rdfs:label "Average 10 meter wind speed over past 2 minutes" . @@ -1040,7 +1185,28 @@ etl-ontology:Property:Average_10m_wind_speed_over_past_2_minutes rdf:type owl:Na ### http://gswlab.ca/ontologies/etl-ontology#Property:Average_Air_Temperature_over_past_1_hour etl-ontology:Property:Average_Air_Temperature_over_past_1_hour rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/air_temperature"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0023/"^^xsd:anyURI ; + etl-ontology:description "Air temperature is the bulk temperature of the air, not the surface (skin) temperature."^^xsd:string ; + rdfs:label "Average air temperature over past 1 hour" . + +### http://gswlab.ca/ontologies/etl-ontology#Property:Average_Air_Temperature_over_past_1_hour_1 +etl-ontology:Property:Average_Air_Temperature_over_past_1_hour_1 rdf:type owl:NamedIndividual , + etl-ontology:ObservedProperty ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0023/"^^xsd:anyURI ; + etl-ontology:description "Air temperature is the bulk temperature of the air, not the surface (skin) temperature."^^xsd:string ; + rdfs:label "Average air temperature over past 1 hour" . + +### http://gswlab.ca/ontologies/etl-ontology#Property:Average_Air_Temperature_over_past_1_hour_2 +etl-ontology:Property:Average_Air_Temperature_over_past_1_hour_2 rdf:type owl:NamedIndividual , + etl-ontology:ObservedProperty ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0023/"^^xsd:anyURI ; + etl-ontology:description "Air temperature is the bulk temperature of the air, not the surface (skin) temperature."^^xsd:string ; + rdfs:label "Average air temperature over past 1 hour" . + +### http://gswlab.ca/ontologies/etl-ontology#Property:Average_Air_Temperature_over_past_1_hour_3 +etl-ontology:Property:Average_Air_Temperature_over_past_1_hour_3 rdf:type owl:NamedIndividual , + etl-ontology:ObservedProperty ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0023/"^^xsd:anyURI ; etl-ontology:description "Air temperature is the bulk temperature of the air, not the surface (skin) temperature."^^xsd:string ; rdfs:label "Average air temperature over past 1 hour" . @@ -1052,6 +1218,13 @@ etl-ontology:Property:Average_Battery_Voltage rdf:type owl:NamedIndividual , etl-ontology:description "The battery voltage of a datalogger or sensing system, often recorded as an indicator of data reliability."^^xsd:string ; rdfs:label "Average Battery Voltage over an interval"^^xsd:string . +### http://gswlab.ca/ontologies/etl-ontology#Property:batteryVoltage +etl-ontology:Property:batteryVoltage rdf:type owl:NamedIndividual , + etl-ontology:ObservedProperty ; + etl-ontology:definition "https://mmisw.org/ont/CUAHSI/WaterQualityCore2/batteryVoltage"^^xsd:anyURI ; + etl-ontology:description "The battery voltage of a datalogger or sensing system, often recorded as an indicator of data reliability."^^xsd:string ; + rdfs:label "Battery Voltage"^^xsd:string . + ### http://gswlab.ca/ontologies/etl-ontology#Property:Average_snow_depth_over_past_5_minutes etl-ontology:Property:Average_snow_depth_over_past_5_minutes rdf:type owl:NamedIndividual , @@ -1060,11 +1233,32 @@ etl-ontology:Property:Average_snow_depth_over_past_5_minutes rdf:type owl:NamedI etl-ontology:description "Average snow depth over past 5 minutes." ; rdfs:label "Average snow depth over past 5 minutes" . +### http://gswlab.ca/ontologies/etl-ontology#Property:Average_snow_depth_over_past_5_minutes_1 +etl-ontology:Property:Average_snow_depth_over_past_5_minutes_1 rdf:type owl:NamedIndividual , + etl-ontology:ObservedProperty ; + etl-ontology:definition "http://mmisw.org/ont/ioos_test/parameters_regional_web_services/snowdepth"^^xsd:anyURI ; + etl-ontology:description "Average snow depth over past 5 minutes." ; + rdfs:label "Average snow depth over past 5 minutes" . + +### http://gswlab.ca/ontologies/etl-ontology#Property:Average_snow_depth_over_past_5_minutes_2 +etl-ontology:Property:Average_snow_depth_over_past_5_minutes_2 rdf:type owl:NamedIndividual , + etl-ontology:ObservedProperty ; + etl-ontology:definition "http://mmisw.org/ont/ioos_test/parameters_regional_web_services/snowdepth"^^xsd:anyURI ; + etl-ontology:description "Average snow depth over past 5 minutes." ; + rdfs:label "Average snow depth over past 5 minutes" . + + ### http://gswlab.ca/ontologies/etl-ontology#Property:Average_snow_depth_over_past_5_minutes_3 +etl-ontology:Property:Average_snow_depth_over_past_5_minutes_3 rdf:type owl:NamedIndividual , + etl-ontology:ObservedProperty ; + etl-ontology:definition "http://mmisw.org/ont/ioos_test/parameters_regional_web_services/snowdepth"^^xsd:anyURI ; + etl-ontology:description "Average snow depth over past 5 minutes." ; + rdfs:label "Average snow depth over past 5 minutes" . + ### http://gswlab.ca/ontologies/etl-ontology#Property:Average_wind_direction_at_10_meters_over_past_2_minutes etl-ontology:Property:Average_wind_direction_at_10_meters_over_past_2_minutes rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/wind_from_direction"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0036/"^^xsd:anyURI ; etl-ontology:description "Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. \"from_direction\" is used in the construction X_from_direction and indicates the direction from which the velocity vector of X is coming." ; rdfs:label "Average wind direction at 10 meters over past 2 minutes" . @@ -1072,10 +1266,16 @@ etl-ontology:Property:Average_wind_direction_at_10_meters_over_past_2_minutes rd ### http://gswlab.ca/ontologies/etl-ontology#Property:Average_wind_speed_at_precipitation_gauge_over_past_10_minutes etl-ontology:Property:Average_wind_speed_at_precipitation_gauge_over_past_10_minutes rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/wind_speed"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0038/"^^xsd:anyURI ; etl-ontology:description "Speed is the magnitude of velocity. Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. The wind speed is the magnitude of the wind velocity." ; rdfs:label "Average wind speed at precipitation gauge over past 10 minutes" . +### http://gswlab.ca/ontologies/etl-ontology#Property:Max_10m_wind_gust_speed_over_past_10_minutes +etl-ontology:Property:Max_10m_wind_gust_speed_over_past_10_minutes rdf:type owl:NamedIndividual , + etl-ontology:ObservedProperty ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0038/"^^xsd:anyURI ; + etl-ontology:description "Speed is the magnitude of velocity. Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. The wind speed is the magnitude of the wind velocity." ; + rdfs:label "Max wind speed over the last 10 minutes of the hour is >= 15 knots AND the max speed exceeds the 2-minute mean wind speed by >= 5 knots" . ### http://gswlab.ca/ontologies/etl-ontology#Property:Battery_Voltage etl-ontology:Property:Battery_Voltage rdf:type owl:NamedIndividual , @@ -1136,7 +1336,7 @@ etl-ontology:Property:Cloud_type_obscuring_phenomena_for_layer_3 rdf:type owl:Na ### http://gswlab.ca/ontologies/etl-ontology#Property:Data_Availability etl-ontology:Property:Data_Availability rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://dd.weather.gc.ca/observations/doc/"^^xsd:anyURI ; + etl-ontology:definition "https://dd.weather.gc.ca/observations/doc/SWOB-ML_Product_User_Guide_V8.9_e.pdf"^^xsd:anyURI ; etl-ontology:description "Data availability"^^xsd:string ; rdfs:label "Data Availability" . @@ -1152,7 +1352,7 @@ etl-ontology:Property:Datalogger_panel_temperature rdf:type owl:NamedIndividual ### http://gswlab.ca/ontologies/etl-ontology#Property:Derived_peak_wind_remark etl-ontology:Property:Derived_peak_wind_remark rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://dd.weather.gc.ca/observations/doc/"^^xsd:anyURI ; + etl-ontology:definition "https://dd.weather.gc.ca/observations/doc/SWOB-ML_Product_User_Guide_V8.9_e.pdf"^^xsd:anyURI ; etl-ontology:description "Derived peak wind remark"^^xsd:string ; rdfs:label "Derived peak wind remark"^^xsd:string . @@ -1216,7 +1416,7 @@ etl-ontology:Property:High_Data_Rate_transmitter_reflected_power rdf:type owl:Na ### http://gswlab.ca/ontologies/etl-ontology#Property:Max_wind_speed_past_1_hour_timestamp etl-ontology:Property:Max_wind_speed_past_1_hour_timestamp rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://dd.weather.gc.ca/observations/doc/"^^xsd:anyURI ; + etl-ontology:definition "https://dd.weather.gc.ca/observations/doc/SWOB-ML_Product_User_Guide_V8.9_e.pdf"^^xsd:anyURI ; etl-ontology:description "Timestamp of maximum wind speed over past hour." ; rdfs:label "Timestamp of maximum wind speed over past hour" . @@ -1224,7 +1424,7 @@ etl-ontology:Property:Max_wind_speed_past_1_hour_timestamp rdf:type owl:NamedInd ### http://gswlab.ca/ontologies/etl-ontology#Property:Maximum_10m_peak_wind_speed_over_past_1_hour etl-ontology:Property:Maximum_10m_peak_wind_speed_over_past_1_hour rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/wind_speed"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0038/"^^xsd:anyURI ; etl-ontology:description "Speed is the magnitude of velocity. Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. The wind speed is the magnitude of the wind velocity."^^xsd:string ; rdfs:label "Maximum 10 meter peak wind speed over past 1 hour" . @@ -1232,7 +1432,7 @@ etl-ontology:Property:Maximum_10m_peak_wind_speed_over_past_1_hour rdf:type owl: ### http://gswlab.ca/ontologies/etl-ontology#Property:Maximum_10m_wind_speed_over_past_10_minutes etl-ontology:Property:Maximum_10m_wind_speed_over_past_10_minutes rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/wind_speed"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0038/"^^xsd:anyURI ; etl-ontology:description "Speed is the magnitude of velocity. Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. The wind speed is the magnitude of the wind velocity."^^xsd:string ; rdfs:label "Maximum 10 meter wind speed over past 10 minutes" . @@ -1240,7 +1440,7 @@ etl-ontology:Property:Maximum_10m_wind_speed_over_past_10_minutes rdf:type owl:N ### http://gswlab.ca/ontologies/etl-ontology#Property:Maximum_10m_wind_speed_over_past_1_hour etl-ontology:Property:Maximum_10m_wind_speed_over_past_1_hour rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/wind_speed"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0038/"^^xsd:anyURI ; etl-ontology:description "Speed is the magnitude of velocity. Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. The wind speed is the magnitude of the wind velocity."^^xsd:string ; rdfs:label "Maximum 10 meter wind speed over past 1 hour" . @@ -1248,7 +1448,29 @@ etl-ontology:Property:Maximum_10m_wind_speed_over_past_1_hour rdf:type owl:Named ### http://gswlab.ca/ontologies/etl-ontology#Property:Maximum_Air_Temperature_over_past_1_hour etl-ontology:Property:Maximum_Air_Temperature_over_past_1_hour rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/air_temperature"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0023/"^^xsd:anyURI ; + etl-ontology:description "Air temperature is the bulk temperature of the air, not the surface (skin) temperature."^^xsd:string ; + rdfs:label "Maximum Air Temperature over past 1 hour" . + + +### http://gswlab.ca/ontologies/etl-ontology#Property:Maximum_Air_Temperature_over_past_1_hour_1 +etl-ontology:Property:Maximum_Air_Temperature_over_past_1_hour_1 rdf:type owl:NamedIndividual , + etl-ontology:ObservedProperty ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0023/"^^xsd:anyURI ; + etl-ontology:description "Air temperature is the bulk temperature of the air, not the surface (skin) temperature."^^xsd:string ; + rdfs:label "Maximum Air Temperature over past 1 hour" . + +### http://gswlab.ca/ontologies/etl-ontology#Property:Maximum_Air_Temperature_over_past_1_hour_2 +etl-ontology:Property:Maximum_Air_Temperature_over_past_1_hour_2 rdf:type owl:NamedIndividual , + etl-ontology:ObservedProperty ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0023/"^^xsd:anyURI ; + etl-ontology:description "Air temperature is the bulk temperature of the air, not the surface (skin) temperature."^^xsd:string ; + rdfs:label "Maximum Air Temperature over past 1 hour" . + +### http://gswlab.ca/ontologies/etl-ontology#Property:Maximum_Air_Temperature_over_past_1_hour_3 +etl-ontology:Property:Maximum_Air_Temperature_over_past_1_hour_3 rdf:type owl:NamedIndividual , + etl-ontology:ObservedProperty ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0023/"^^xsd:anyURI ; etl-ontology:description "Air temperature is the bulk temperature of the air, not the surface (skin) temperature."^^xsd:string ; rdfs:label "Maximum Air Temperature over past 1 hour" . @@ -1256,7 +1478,7 @@ etl-ontology:Property:Maximum_Air_Temperature_over_past_1_hour rdf:type owl:Name ### http://gswlab.ca/ontologies/etl-ontology#Property:Maximum_Air_Temperature_over_past_24_hours etl-ontology:Property:Maximum_Air_Temperature_over_past_24_hours rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/air_temperature"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0023/"^^xsd:anyURI ; etl-ontology:description "Air temperature is the bulk temperature of the air, not the surface (skin) temperature."^^xsd:string ; rdfs:label "Maximum Air Temperature over past 24 hours" . @@ -1264,7 +1486,7 @@ etl-ontology:Property:Maximum_Air_Temperature_over_past_24_hours rdf:type owl:Na ### http://gswlab.ca/ontologies/etl-ontology#Property:Maximum_Air_Temperature_over_past_6_hours etl-ontology:Property:Maximum_Air_Temperature_over_past_6_hours rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/air_temperature"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0023/"^^xsd:anyURI ; etl-ontology:description "Air temperature is the bulk temperature of the air, not the surface (skin) temperature."^^xsd:string ; rdfs:label "Maximum Air Temperature over past 6 hours" . @@ -1288,7 +1510,7 @@ etl-ontology:Property:Maximum_Battery_Voltage_Past_1_Hour rdf:type owl:NamedIndi ### http://gswlab.ca/ontologies/etl-ontology#Property:Maximum_Relative_Humidity_over_past_1_hour etl-ontology:Property:Maximum_Relative_Humidity_over_past_1_hour rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/relative_humidity"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0413/"^^xsd:anyURI ; etl-ontology:description "Amount of moisture in the air as vapor relative to how much it can possibly hold at the same temperature."^^xsd:string ; rdfs:label "Maximum Relative Humidity over past 1 hour" . @@ -1304,10 +1526,58 @@ etl-ontology:Property:Maximum_visibility_over_past_10_minutes rdf:type owl:Named ### http://gswlab.ca/ontologies/etl-ontology#Property:Mean_sea_level_pressure etl-ontology:Property:Mean_sea_level_pressure rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/air_pressure_at_mean_sea_level"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0015/_at_mean_sea_level"^^xsd:anyURI ; etl-ontology:description "Air pressure is the force per unit area which would be exerted when the moving gas molecules of which the air is composed strike a theoretical surface of any orientation."^^xsd:string ; rdfs:label "Mean Sea Level Pressure" . +### http://gswlab.ca/ontologies/etl-ontology#Property:Minimum_Air_Temperature_over_past_1_hour +etl-ontology:Property:Minimum_Air_Temperature_over_past_1_hour rdf:type owl:NamedIndividual , + etl-ontology:ObservedProperty ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0023/"^^xsd:anyURI ; + etl-ontology:description "Air temperature is the bulk temperature of the air, not the surface (skin) temperature."^^xsd:string ; + rdfs:label "Minimum Air Temperature over past 1 hour" . + +### http://gswlab.ca/ontologies/etl-ontology#Property:Minimum_Air_Temperature_over_past_1_hour_1 +etl-ontology:Property:Minimum_Air_Temperature_over_past_1_hour_1 rdf:type owl:NamedIndividual , + etl-ontology:ObservedProperty ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0023/"^^xsd:anyURI ; + etl-ontology:description "Air temperature is the bulk temperature of the air, not the surface (skin) temperature."^^xsd:string ; + rdfs:label "Minimum Air Temperature over past 1 hour" . + + +### http://gswlab.ca/ontologies/etl-ontology#Property:Minimum_Air_Temperature_over_past_1_hour_2 +etl-ontology:Property:Minimum_Air_Temperature_over_past_1_hour_2 rdf:type owl:NamedIndividual , + etl-ontology:ObservedProperty ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0023/"^^xsd:anyURI ; + etl-ontology:description "Air temperature is the bulk temperature of the air, not the surface (skin) temperature."^^xsd:string ; + rdfs:label "Minimum Air Temperature over past 1 hour" . + + +### http://gswlab.ca/ontologies/etl-ontology#Property:Minimum_Air_Temperature_over_past_1_hour_3 +etl-ontology:Property:Minimum_Air_Temperature_over_past_1_hour_3 rdf:type owl:NamedIndividual , + etl-ontology:ObservedProperty ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0023/"^^xsd:anyURI ; + etl-ontology:description "Air temperature is the bulk temperature of the air, not the surface (skin) temperature."^^xsd:string ; + rdfs:label "Minimum Air Temperature over past 1 hour" . + + + +### http://gswlab.ca/ontologies/etl-ontology#Property:Minimum_Air_Temperature_over_past_24_hours +etl-ontology:Property:Minimum_Air_Temperature_over_past_24_hours rdf:type owl:NamedIndividual , + etl-ontology:ObservedProperty ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0023/"^^xsd:anyURI ; + etl-ontology:description "Air temperature is the bulk temperature of the air, not the surface (skin) temperature."^^xsd:string ; + rdfs:label "Minimum Air Temperature over past 24 hours" . + + +### http://gswlab.ca/ontologies/etl-ontology#Property:Minimum_Air_Temperature_over_past_6_hours +etl-ontology:Property:Minimum_Air_Temperature_over_past_6_hours rdf:type owl:NamedIndividual , + etl-ontology:ObservedProperty ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0023/"^^xsd:anyURI ; + etl-ontology:description "Air temperature is the bulk temperature of the air, not the surface (skin) temperature."^^xsd:string ; + rdfs:label "Minimum Air Temperature over past 6 hours" . + + ### http://gswlab.ca/ontologies/etl-ontology#Property:Minimum_Battery_Voltage etl-ontology:Property:Minimum_Battery_Voltage rdf:type owl:NamedIndividual , @@ -1336,7 +1606,7 @@ etl-ontology:Property:Minimum_Battery_Voltage_Timestamp rdf:type owl:NamedIndivi ### http://gswlab.ca/ontologies/etl-ontology#Property:Minimum_Relative_Humidity_over_past_1_hour etl-ontology:Property:Minimum_Relative_Humidity_over_past_1_hour rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/relative_humidity"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0413/"^^xsd:anyURI ; etl-ontology:description "Amount of moisture in the air as vapor relative to how much it can possibly hold at the same temperature."^^xsd:string ; rdfs:label "Minimum Relative Humidity over past 1 hour" . @@ -1400,7 +1670,7 @@ etl-ontology:Property:Non-cumulative_cloud_cover_or_amount_layer_3 rdf:type owl: ### http://gswlab.ca/ontologies/etl-ontology#Property:Precipitation_Amount_over_past_1_hour etl-ontology:Property:Precipitation_Amount_over_past_1_hour rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/ioos/parameter/precipitation_amount"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P01/current/CPRPRG01/"^^xsd:anyURI ; etl-ontology:description "The deposit of atmospheric moisture as rain, hail, sleet, snow, frost or dew. Precipition amount is often measured as depth of liquid equivalent moisture at a point but also can be expressed as liquid volume or mass per unit area."^^xsd:string ; rdfs:label "Precipitation Amount over past 1 hour" . @@ -1408,7 +1678,7 @@ etl-ontology:Property:Precipitation_Amount_over_past_1_hour rdf:type owl:NamedIn ### http://gswlab.ca/ontologies/etl-ontology#Property:Precipitation_Amount_over_past_24_hours etl-ontology:Property:Precipitation_Amount_over_past_24_hours rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/ioos/parameter/precipitation_amount"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P01/current/CPRPRG01/"^^xsd:anyURI ; etl-ontology:description "The deposit of atmospheric moisture as rain, hail, sleet, snow, frost or dew. Precipition amount is often measured as depth of liquid equivalent moisture at a point but also can be expressed as liquid volume or mass per unit area."^^xsd:string ; rdfs:label "Precipitation amount over past 24 hours" . @@ -1416,7 +1686,7 @@ etl-ontology:Property:Precipitation_Amount_over_past_24_hours rdf:type owl:Named ### http://gswlab.ca/ontologies/etl-ontology#Property:Precipitation_Amount_over_past_3_hours etl-ontology:Property:Precipitation_Amount_over_past_3_hours rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/ioos/parameter/precipitation_amount"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P01/current/CPRPRG01/"^^xsd:anyURI ; etl-ontology:description "The deposit of atmospheric moisture as rain, hail, sleet, snow, frost or dew. Precipition amount is often measured as depth of liquid equivalent moisture at a point but also can be expressed as liquid volume or mass per unit area."^^xsd:string ; rdfs:label "Precipitation amount over past 3 hours" . @@ -1424,7 +1694,7 @@ etl-ontology:Property:Precipitation_Amount_over_past_3_hours rdf:type owl:NamedI ### http://gswlab.ca/ontologies/etl-ontology#Property:Precipitation_Amount_over_past_6_hours etl-ontology:Property:Precipitation_Amount_over_past_6_hours rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/ioos/parameter/precipitation_amount"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P01/current/CPRPRG01/"^^xsd:anyURI ; etl-ontology:description "The deposit of atmospheric moisture as rain, hail, sleet, snow, frost or dew. Precipition amount is often measured as depth of liquid equivalent moisture at a point but also can be expressed as liquid volume or mass per unit area."^^xsd:string ; rdfs:label "Precipitation amount over past 6 hours" . @@ -1432,10 +1702,24 @@ etl-ontology:Property:Precipitation_Amount_over_past_6_hours rdf:type owl:NamedI ### http://gswlab.ca/ontologies/etl-ontology#Property:Precipitation_Amount_since_last_synoptic_hour etl-ontology:Property:Precipitation_Amount_since_last_synoptic_hour rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/ioos/parameter/precipitation_amount"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P01/current/CPRPRG01/"^^xsd:anyURI ; etl-ontology:description "The deposit of atmospheric moisture as rain, hail, sleet, snow, frost or dew. Precipition amount is often measured as depth of liquid equivalent moisture at a point but also can be expressed as liquid volume or mass per unit area."^^xsd:string ; rdfs:label "Precipitation Amount since last synoptic hour" . +### http://gswlab.ca/ontologies/etl-ontology#Property:Precipitation +etl-ontology:Property:Precipitation rdf:type owl:NamedIndividual , + etl-ontology:ObservedProperty ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P01/current/CPRPRG01/"^^xsd:anyURI ; + etl-ontology:description "Thickness of precipitation amount (liquid water equivalent) in the atmosphere by in-situ rain gauge."^^xsd:string ; + rdfs:label "Precipitation" . + +### http://gswlab.ca/ontologies/etl-ontology#Property:PAR +etl-ontology:Property:PAR rdf:type owl:NamedIndividual , + etl-ontology:ObservedProperty ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P14/current/GVAR0627/"^^xsd:anyURI ; + etl-ontology:description "Photosynthetically active radiation (PAR) is a measure of light. It is the intensity of the part of sunlight that plants can use to support new growth, and also the wavelengths of light that our eyes are sensitive to."^^xsd:string ; + rdfs:label "Photosynthetically Active Radiation" . + ### http://gswlab.ca/ontologies/etl-ontology#Property:Present_Weather etl-ontology:Property:Present_Weather rdf:type owl:NamedIndividual , @@ -1448,7 +1732,7 @@ etl-ontology:Property:Present_Weather rdf:type owl:NamedIndividual , ### http://gswlab.ca/ontologies/etl-ontology#Property:Rainfall_amount_over_past_1_hour etl-ontology:Property:Rainfall_amount_over_past_1_hour rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/ioos/parameter/precipitation_amount"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P01/current/CPRPRG01/"^^xsd:anyURI ; etl-ontology:description "The deposit of atmospheric moisture as rain, hail, sleet, snow, frost or dew. Precipition amount is often measured as depth of liquid equivalent moisture at a point but also can be expressed as liquid volume or mass per unit area."^^xsd:string ; rdfs:label "Rainfall amount over past 1 hour" . @@ -1456,7 +1740,7 @@ etl-ontology:Property:Rainfall_amount_over_past_1_hour rdf:type owl:NamedIndivid ### http://gswlab.ca/ontologies/etl-ontology#Property:Rainfall_since_last_synoptic_hour etl-ontology:Property:Rainfall_since_last_synoptic_hour rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/ioos/parameter/precipitation_amount"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P01/current/CPRPRG01/"^^xsd:anyURI ; etl-ontology:description "The deposit of atmospheric moisture as rain, hail, sleet, snow, frost or dew. Precipition amount is often measured as depth of liquid equivalent moisture at a point but also can be expressed as liquid volume or mass per unit area."^^xsd:string ; rdfs:label "Rainfall since last synoptic hour" . @@ -1464,8 +1748,8 @@ etl-ontology:Property:Rainfall_since_last_synoptic_hour rdf:type owl:NamedIndivi ### http://gswlab.ca/ontologies/etl-ontology#Property:Relative_Humidity etl-ontology:Property:Relative_Humidity rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/relative_humidity"^^xsd:anyURI ; - etl-ontology:description "Amount of moisture in the air as vapor relative to how much it can possibly hold at the same temperature."^^xsd:string ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0413/"^^xsd:anyURI ; + etl-ontology:description "The ratio of the amount of water vapour in the air compared to the maximum amount of water vapour that can theoretically be held at the air's temperature."^^xsd:string ; rdfs:label "Relative Humidity" . @@ -1528,7 +1812,7 @@ etl-ontology:Property:Solar_Panel_Temperature_Minimum rdf:type owl:NamedIndividu ### http://gswlab.ca/ontologies/etl-ontology#Property:Station_Pressure etl-ontology:Property:Station_Pressure rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/air_pressure"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0015/"^^xsd:anyURI ; etl-ontology:description "Air pressure is the force per unit area which would be exerted when the moving gas molecules of which the air is composed strike a theoretical surface of any orientation."^^xsd:string ; rdfs:label "Station Pressure" . @@ -1544,7 +1828,7 @@ etl-ontology:Property:Total_global_solar_radiation_over_past_1_hour rdf:type owl ### http://gswlab.ca/ontologies/etl-ontology#Property:Vector_average_10m_wind_direction_over_past_1_hour etl-ontology:Property:Vector_average_10m_wind_direction_over_past_1_hour rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/wind_from_direction"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0036/"^^xsd:anyURI ; etl-ontology:description "Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. \"from_direction\" is used in the construction X_from_direction and indicates the direction from which the velocity vector of X is coming."^^xsd:string ; rdfs:label "Vector average 10 meter wind direction over past 1 hour" . @@ -1552,7 +1836,7 @@ etl-ontology:Property:Vector_average_10m_wind_direction_over_past_1_hour rdf:typ ### http://gswlab.ca/ontologies/etl-ontology#Property:Vectoral_average_10m_wind_direction_over_past_10_minutes etl-ontology:Property:Vectoral_average_10m_wind_direction_over_past_10_minutes rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/wind_from_direction"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0036/"^^xsd:anyURI ; etl-ontology:description "Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. \"from_direction\" is used in the construction X_from_direction and indicates the direction from which the velocity vector of X is coming."^^xsd:string ; rdfs:label "Vectoral average 10 meter wind direction over past 10 minutes" . @@ -1560,7 +1844,7 @@ etl-ontology:Property:Vectoral_average_10m_wind_direction_over_past_10_minutes r ### http://gswlab.ca/ontologies/etl-ontology#Property:Vectoral_average_10m_wind_direction_over_past_2_minutes etl-ontology:Property:Vectoral_average_10m_wind_direction_over_past_2_minutes rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/wind_from_direction"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0036/"^^xsd:anyURI ; etl-ontology:description "Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. \"from_direction\" is used in the construction X_from_direction and indicates the direction from which the velocity vector of X is coming."^^xsd:string ; rdfs:label "Vectoral average 10 meter wind direction over past 2 minutes" . @@ -1592,7 +1876,7 @@ etl-ontology:Property:Wet_bulb_temperature rdf:type owl:NamedIndividual , ### http://gswlab.ca/ontologies/etl-ontology#Property:Wind_Direction_Average etl-ontology:Property:Wind_Direction_Average rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/wind_from_direction" ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0036/" ; etl-ontology:description "Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. \"from_direction\" is used in the construction X_from_direction and indicates the direction from which the velocity vector of X is coming." ; rdfs:label "Average wind direction over an interval" . @@ -1600,7 +1884,7 @@ etl-ontology:Property:Wind_Direction_Average rdf:type owl:NamedIndividual , ### http://gswlab.ca/ontologies/etl-ontology#Property:Wind_Direction_Standard_Deviation etl-ontology:Property:Wind_Direction_Standard_Deviation rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/wind_from_direction" ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0036/" ; etl-ontology:description "Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. \"from_direction\" is used in the construction X_from_direction and indicates the direction from which the velocity vector of X is coming." ; rdfs:label "Standard deviation of wind direction over an interval" . @@ -1608,23 +1892,23 @@ etl-ontology:Property:Wind_Direction_Standard_Deviation rdf:type owl:NamedIndivi ### http://gswlab.ca/ontologies/etl-ontology#Property:Wind_From_Direction etl-ontology:Property:Wind_From_Direction rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/wind_from_direction"^^xsd:anyURI ; - etl-ontology:description "Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. \"from_direction\" is used in the construction X_from_direction and indicates the direction from which the velocity vector of X is coming."^^xsd:string ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0036/"^^xsd:anyURI ; + etl-ontology:description "Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. (Vertical motion in the atmosphere has the standard name upward_air_velocity.) In meteorological reports, the direction of the wind vector is usually (but not always) given as the direction from which it is blowing (wind_from_direction) (westerly, northerly, etc.). In other contexts, such as atmospheric modelling, it is often natural to give the direction in the usual manner of vectors as the heading or the direction to which it is blowing (wind_to_direction) (eastward, southward, etc.) 'from_direction' is used in the construction X_from_direction and indicates the direction from which the velocity vector of X is coming."^^xsd:string ; rdfs:label "Wind From Direction" . ### http://gswlab.ca/ontologies/etl-ontology#Property:Wind_Speed etl-ontology:Property:Wind_Speed rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/wind_speed"^^xsd:anyURI ; - etl-ontology:description "Speed is the magnitude of velocity. Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. The wind speed is the magnitude of the wind velocity."^^xsd:string ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0038/"^^xsd:anyURI ; + etl-ontology:description "Speed is the magnitude of velocity. Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. (Vertical motion in the atmosphere has the standard name upward_air_velocity.) The wind speed is the magnitude of the wind velocity."^^xsd:string ; rdfs:label "Wind Speed" . ### http://gswlab.ca/ontologies/etl-ontology#Property:Wind_Speed_Average etl-ontology:Property:Wind_Speed_Average rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/wind_speed" ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0038/" ; etl-ontology:description "Speed is the magnitude of velocity. Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. The wind speed is the magnitude of the wind velocity." ; rdfs:label "Average wind speed over an interval" . @@ -1632,7 +1916,7 @@ etl-ontology:Property:Wind_Speed_Average rdf:type owl:NamedIndividual , ### http://gswlab.ca/ontologies/etl-ontology#Property:Wind_Speed_Maximum etl-ontology:Property:Wind_Speed_Maximum rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/wind_speed" ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0038/" ; etl-ontology:description "Speed is the magnitude of velocity. Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. The wind speed is the magnitude of the wind velocity." ; rdfs:label "Maximum wind speed over an interval" . @@ -1640,7 +1924,7 @@ etl-ontology:Property:Wind_Speed_Maximum rdf:type owl:NamedIndividual , ### http://gswlab.ca/ontologies/etl-ontology#Property:Wind_direction_associated_with_the_past_1-hour_maximum_wind_speed_at_10m etl-ontology:Property:Wind_direction_associated_with_the_past_1-hour_maximum_wind_speed_at_10m rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/wind_from_direction"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0036/"^^xsd:anyURI ; etl-ontology:description "Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. \"from_direction\" is used in the construction X_from_direction and indicates the direction from which the velocity vector of X is coming."^^xsd:string ; rdfs:label "Wind direction associated with the maximum wind speed at 10 meters over past 1 hour" . @@ -1648,7 +1932,7 @@ etl-ontology:Property:Wind_direction_associated_with_the_past_1-hour_maximum_win ### http://gswlab.ca/ontologies/etl-ontology#Property:Wind_direction_associated_with_the_past_1-hour_peak_wind_speed_at_10m etl-ontology:Property:Wind_direction_associated_with_the_past_1-hour_peak_wind_speed_at_10m rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/wind_from_direction"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0036/"^^xsd:anyURI ; etl-ontology:description "Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. \"from_direction\" is used in the construction X_from_direction and indicates the direction from which the velocity vector of X is coming."^^xsd:string ; rdfs:label "Wind direction associated with the peak wind speed at 10 meters over past 1 hour" . @@ -1656,7 +1940,7 @@ etl-ontology:Property:Wind_direction_associated_with_the_past_1-hour_peak_wind_s ### http://gswlab.ca/ontologies/etl-ontology#Property:Wind_direction_associated_with_the_past_10-minute_maximum_wind_speed_at_10m etl-ontology:Property:Wind_direction_associated_with_the_past_10-minute_maximum_wind_speed_at_10m rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/wind_from_direction"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0036/"^^xsd:anyURI ; etl-ontology:description "Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. \"from_direction\" is used in the construction X_from_direction and indicates the direction from which the velocity vector of X is coming."^^xsd:string ; rdfs:label "Wind direction associated with the maximum wind speed at 10 meters over past 10 minutes" . @@ -1664,15 +1948,15 @@ etl-ontology:Property:Wind_direction_associated_with_the_past_10-minute_maximum_ ### http://gswlab.ca/ontologies/etl-ontology#Property:Wind_speed_of_gust etl-ontology:Property:Wind_speed_of_gust rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/wind_speed_of_gust"^^xsd:anyURI ; - etl-ontology:description "Speed is the magnitude of velocity. A gust is a sudden brief period of high wind speed." ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0039/"^^xsd:anyURI ; + etl-ontology:description "Speed is the magnitude of velocity. Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component. (Vertical motion in the atmosphere has the standard name upward_air_velocity.) The wind speed is the magnitude of the wind velocity. A gust is a sudden brief period of high wind speed. In an observed timeseries of wind speed, the gust wind speed can be indicated by a cell_methods of maximum for the time-interval. In an atmospheric model which has a parametrised calculation of gustiness, the gust wind speed may be separately diagnosed from the wind speed." ; rdfs:label "Wind speed of gust" . ### http://gswlab.ca/ontologies/etl-ontology#Property:maximum_10m_wind_gust_speed_over_past_10_minutes etl-ontology:Property:maximum_10m_wind_gust_speed_over_past_10_minutes rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/cf/parameter/wind_speed_of_gust"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P07/current/CFSN0039/"^^xsd:anyURI ; etl-ontology:description "A gust is a sudden brief period of high wind speed."^^xsd:string ; rdfs:label "Maximum 10 meter wind gust speed over past 10 minutes" . @@ -1728,7 +2012,7 @@ etl-ontology:Property:maximum_10m_wind_gust_speed_over_past_10_minutes rdf:type ### http://gswlab.ca/ontologies/etl-ontology#Property:5-minute_cumulative_precipitation_gauge_filtered_weight_for_minutes_55_to_60 rdf:type owl:NamedIndividual , etl-ontology:ObservedProperty ; - etl-ontology:definition "http://mmisw.org/ont/ioos/parameter/precipitation_amount"^^xsd:anyURI ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P01/current/CPRPRG01/"^^xsd:anyURI ; etl-ontology:description "The deposit of atmospheric moisture as rain, hail, sleet, snow, frost or dew. Precipition amount is often measured as depth of liquid equivalent moisture at a point but also can be expressed as liquid volume or mass per unit area."^^xsd:string ; rdfs:label "5-minute cumulative precipitation gauge filtered weight for minutes 55 to 60" . @@ -1896,6 +2180,14 @@ etl-ontology:Unit:millimeter rdf:type owl:NamedIndividual , rdfs:label "millimeter"^^xsd:string . +### http://gswlab.ca/ontologies/etl-ontology#Unit:mikroeinstein_per_square_meter_per_second +etl-ontology:Unit:mikroeinstein_per_square_meter_per_second rdf:type owl:NamedIndividual , + etl-ontology:UnitOfMeasurement ; + etl-ontology:definition "http://vocab.nerc.ac.uk/collection/P06/current/UMES/"^^xsd:anyURI ; + etl-ontology:observationType "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement"^^xsd:anyURI ; + etl-ontology:symbol "uE/m^2/s"^^xsd:string ; + rdfs:label "MicroEinsteins per square metre per second"^^xsd:string . + ### http://gswlab.ca/ontologies/etl-ontology#Unit:obscuring_phenomena etl-ontology:Unit:obscuring_phenomena rdf:type owl:NamedIndividual , etl-ontology:UnitOfMeasurement ; diff --git a/lib/transloader/data_garrison/station.rb b/lib/transloader/data_garrison/station.rb index 47601f6..d5a1fa1 100644 --- a/lib/transloader/data_garrison/station.rb +++ b/lib/transloader/data_garrison/station.rb @@ -40,7 +40,7 @@ def initialize(options = {}) properties = options[:properties] || {} @metadata[:properties].merge!(properties) - @base_path = "https://datagarrison.com/users/#{@user_id}/#{@id}/index.php?sens_details=127&details=7" + @base_path = "https://datagarrison.com/users/#{@user_id}/#{@id}/index.php?sens_details=65535&details=7" end # Download and extract metadata from HTML, use to build metadata @@ -64,7 +64,7 @@ def download_metadata(override_metadata: nil) html.xpath('/html/body/table/tr[position()=2]/td/table/tr/td[position()=2]/div[position()=2]/table/tr[position()=2]/td/table/tr/td/font/a').collect do |element| href = element.attr('href') data_desc = element.text.to_s - filename = data_desc.sub(/ /, '_') + filename = data_desc.gsub(/ /, '_') if filename == "" # Without a filename, the file cannot be downloaded as a TSV @@ -273,6 +273,8 @@ def upload_metadata(server_url, options = {}) # Create Sensor entities sensor = build_sensor("Station #{@id} #{stream[:name]} Sensor", "#{NAME} #{@id} #{stream[:name]} Sensor") + sensor.encoding_type = "text/html" + sensor.metadata = "https://datagarrison.com/users/#{@user_id}/#{@id}/" # Upload entity and parse response sensor.upload_to(server_url) diff --git a/lib/transloader/environment_canada/station.rb b/lib/transloader/environment_canada/station.rb index a2173d9..12021f9 100644 --- a/lib/transloader/environment_canada/station.rb +++ b/lib/transloader/environment_canada/station.rb @@ -73,6 +73,8 @@ def download_metadata(override_metadata: {}) name: "#{NAME} #{@id}", description: "#{LONG_NAME} #{properties["Name"]}", elevation: xml.xpath('//po:element[@name="stn_elev"]', NAMESPACES).first.attribute('value').value, + longitude: properties[:Longitude], + latitude: properties[:Latitude], updated_at: Time.now, datastreams: datastreams, procedure: xml.xpath('//om:procedure/@xlink:href', NAMESPACES).text, @@ -286,7 +288,7 @@ def get_swob_data(timestamp = nil) # "AUTO" or "MANNED" will be determined automatically from the # station metadata. def get_swob_data_from_url(url) - case @metadata["properties"]["AUTO/MAN"] + case @metadata[:properties][:"AUTO/MAN"] when "AUTO", "Auto", "Manned/Auto" type = "AUTO" when "MAN", "Manned" diff --git a/lib/transloader/observation_property_cache.rb b/lib/transloader/observation_property_cache.rb index e0ddb18..fc08d82 100644 --- a/lib/transloader/observation_property_cache.rb +++ b/lib/transloader/observation_property_cache.rb @@ -13,11 +13,14 @@ def initialize(datastream_names) # it if it is missing. If it already exists, nothing is changed. def cache_observation_property(property_name) if !@matches.key?(property_name) - matching_datastream = @datastream_names.find do |datastream| - property_name.include?(datastream) + # first check if we have an exact match + if @datastream_names.include?(property_name) + @matches[property_name] = property_name + else + @matches[property_name] = @datastream_names.find do |datastream| + property_name.include?(datastream) + end end - - @matches[property_name] = matching_datastream end end diff --git a/start-sequentially.sh b/start-sequentially.sh new file mode 100755 index 0000000..f6a1082 --- /dev/null +++ b/start-sequentially.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Requirements: +# * https://github.com/kislyuk/yq + +set -e + +COMPOSE_FILE="docker-compose.get-and-put-metadata.yaml" + +yq -r '.services | keys | .[]' "${COMPOSE_FILE}" | \ +while read service; do + docker compose -f "${COMPOSE_FILE}" up "$service" +done diff --git a/transload b/transload old mode 100644 new mode 100755 diff --git a/update-sensors.sh b/update-sensors.sh new file mode 100755 index 0000000..a25b0be --- /dev/null +++ b/update-sensors.sh @@ -0,0 +1,83 @@ +#!/bin/bash + +set -e + +# STA_URL ends with an slash!!! +#STA_URL="http://localhost:8080/FROST-Server/v1.0/" +#INSTRUMENT_DETAILS_BASE_URL="https://canwin-datahub.ad.umanitoba.ca/data/instrument_details" + +function get-sensor-id() { + local NAME="$1" + curl -sG "${STA_URL}Sensors" --data-urlencode "\$filter=name eq '${NAME}'" | jq -r '.value[0]["@iot.id"]' +} + +function update-sensors() { + local STATION_ID="$1" + local STATION_SENSOR_NAME="$2" + local INSTRUMENT_DETAILS="$3" + local METADATA_URL="${INSTRUMENT_DETAILS_BASE_URL}/${INSTRUMENT_DETAILS}" + declare -A NAMES DESCRIPTIONS + + NAMES["Station ${STATION_ID} Pressure Sensor"]="${STATION_SENSOR_NAME} Barometric Pressure Sensor" + NAMES["Station ${STATION_ID} PAR Sensor"]="${STATION_SENSOR_NAME} HOBO PAR Sensor" + NAMES["Station ${STATION_ID} Temperature Sensor"]="${STATION_SENSOR_NAME} HOBO Temperature/Relative Humidity Smart Sensor- Temperature Sensor" + NAMES["Station ${STATION_ID} RH Sensor"]="${STATION_SENSOR_NAME} HOBO Temperature/Relative Humidity Smart Sensor- Relative Humidity (RH Sensor)" + NAMES["Station ${STATION_ID} Rain Sensor"]="${STATION_SENSOR_NAME} HOBO Rain Gauge" + NAMES["Station ${STATION_ID} Wind Speed Sensor"]="${STATION_SENSOR_NAME} R M Young Wind sensor/monitor - Wind Speed Sensor" + NAMES["Station ${STATION_ID} Wind Direction Sensor"]="${STATION_SENSOR_NAME} R M Young Wind sensor/monitor - Wind direction Sensor" + NAMES["Station ${STATION_ID} Gust Speed Sensor"]="${STATION_SENSOR_NAME} R M Young Wind sensor/monitor - Gust Speed Sensor" + NAMES["Station ${STATION_ID} Backup Batteries Sensor"]="${STATION_SENSOR_NAME} Backup Batteries Sensor" + + DESCRIPTIONS["Station ${STATION_ID} Pressure Sensor"]="Pressure measured using a barometer mounted inside the enclosure that houses the air temperature sensor. It is reported in millibars, where 1000 millibars is the average air pressure at sea level. Changing pressure often indicates a coming change in the weather. Increasing pressure is associated with clearing skies. Decreasing pressure is associated with increasing cloudiness, and possibly an approaching storm" + DESCRIPTIONS["Station ${STATION_ID} PAR Sensor"]="Photosynthetically active radiation (PAR) is a measure of light. It is the intensity of the part of sunlight that plants can use to support new growth, and also the wavelengths of light that our eyes are sensitive to. It is measured on a small white disc that records the sum of light falling directly from the sun plus the light scattered by the sky and clouds. It is reported in a unit called a micro-Einstein." + DESCRIPTIONS["Station ${STATION_ID} Temperature Sensor"]="We report temperature in the shade, in Centigrade degrees. It is measured using an electronic thermometer shielded from direct sunlight and mounted inside an enclosure with louvered walls to allow free air flow past the sensor." + DESCRIPTIONS["Station ${STATION_ID} RH Sensor"]="Relative humidity is the amount of water vapour in the air reported as a percentage of the amount that would saturate it at the air temperature. Warmer air can hold more water vapour than cooler air." + DESCRIPTIONS["Station ${STATION_ID} Rain Sensor"]="Rain is reported in millimetres accumulated every 15 minutes in a gauge set about 1 m above the ground. Rain falling into a 6-inch diameter funnel drips onto one of a pair of “buckets”, mounted on a teeter-totter. When one bucket is filled, the teeter-totter flips, the first bucket is emptied and rain then drips into the other “bucket” until it is filled, and so on. Each flip is equal to 0.2 mm of rain." + DESCRIPTIONS["Station ${STATION_ID} Wind Speed Sensor"]="Wind speed is measured using a spinning anemometer mounted on the wind vane at the top of the tower, about 3 m above the ground. We report the average speed for every 15 minute period, in kilometres per hour." + DESCRIPTIONS["Station ${STATION_ID} Wind Direction Sensor"]="Wind direction is measured using a wind vane mounted at the top of the tower. As we do with wind speed, we report the average direction for every 15 minutes, in compass degrees from true north. It is then converted to a direction." + DESCRIPTIONS["Station ${STATION_ID} Gust Speed Sensor"]="Wind gusts are the highest wind speed recorded in each 15 minute period, and are also recorded in kilometres per hour." + DESCRIPTIONS["Station ${STATION_ID} Backup Batteries Sensor"]="This sensor is measuring the voltage from the 12 volt battery that acts as a backup to the solar panels." + + + for OLDNAME in "${!NAMES[@]}"; do + local SENSOR_ID="$(get-sensor-id "${OLDNAME}")" + local NAME="${NAMES[$OLDNAME]}" + local DESCRIPTION="${DESCRIPTIONS[${OLDNAME}]}" + if [ -n "${SENSOR_ID}" -a "${SENSOR_ID}" != "null" ]; then + if [ -z "${STA_USER}" ] || [ -z "${STA_PASSWORD}" ]; then + curl -X PATCH \ + -H "Content-Type: application/json" \ + "${STA_URL}Sensors(${SENSOR_ID})" \ + -d "{ + \"name\": \"${NAME}\", + \"description\": \"${DESCRIPTION}\", + \"metadata\": \"${METADATA_URL}\" + }" + else + curl -X PATCH \ + -u "${STA_USER}:${STA_PASSWORD}" \ + -H "Content-Type: application/json" \ + "${STA_URL}Sensors(${SENSOR_ID})" \ + -d "{ + \"name\": \"${NAME}\", + \"description\": \"${DESCRIPTION}\", + \"metadata\": \"${METADATA_URL}\" + }" + fi + + fi + done +} + + +#STATION_ID="300534061454190" +#STATION_SENSOR_NAME="Dawson Bay Li Taan Aen Staansyoon" +#INSTRUMENT_DETAILS="dawbay-met-sensors" +#update-sensors "${STATION_ID}" "${STATION_SENSOR_NAME}" "${INSTRUMENT_DETAILS}" + +#STATION_ID="300534063017060" +#STATION_SENSOR_NAME="St Laurent Li Taan Aen Staansyoon" +#INSTRUMENT_DETAILS="st-laurent-met-sensors" +#update-sensors "${STATION_ID}" "${STATION_SENSOR_NAME}" "${INSTRUMENT_DETAILS}" + +update-sensors "$1" "$2" "$3"