Skip to content

Commit

Permalink
urn-data (#13): UN/LOCODE script started, based on @sabas work (thank…
Browse files Browse the repository at this point in the history
…s\!)
  • Loading branch information
fititnt committed Apr 29, 2021
1 parent c64d01f commit 28191f7
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 9 deletions.
1 change: 1 addition & 0 deletions ontologia/codicem/locum/un-locode/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
temp/
10 changes: 9 additions & 1 deletion ontologia/codicem/locum/un-locode/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# ontologia/codicem/locum/un-locode

- GitHub Issues:
- https://github.com/HXL-CPLP/forum/issues/57
- https://github.com/EticaAI/HXL-Data-Science-file-formats/issues/13
- https://github.com/datasets/un-locode
- http://www.unece.org/cefact/locode/welcome.html
- http://www.unece.org/cefact/locode/welcome.html

<!--
Not so precise? See this discussion:
- https://github.com/datasets/un-locode/issues/19
-->
24 changes: 24 additions & 0 deletions ontologia/codicem/locum/un-locode/make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@
# USAGE: ./ontologia/codicem/locum/un-locode/make.sh
#
# DESCRIPTION: Download files from ontologia/codicem/locum/un-locode/
# Script based on work from @sabas, from
# https://github.com/datasets/un-locode/blob/master/scripts/prepare_edition.sh
#
# OPTIONS: ---
#
# REQUIREMENTS: - sh
# - wget
# - unzip
# - mdbtools (https://github.com/mdbtools/mdbtools)
# - csvkit (https://github.com/wireservice/csvkit)
# BUGS: ---
# NOTES: ---
# AUTHOR: Emerson Rocha <rocha[at]ieee.org>
# (Based @sabas Stefano work, github.com/datasets/un-locode)
# COMPANY: EticaAI
# LICENSE: Public Domain dedication
# SPDX-License-Identifier: Unlicense
Expand All @@ -24,6 +30,14 @@

ROOTDIR="$(pwd)"

UNLOCODE_DATE="2020-12" # https://unece.org/sites/default/files/2020-12/loc202mdb.zip
UNLOCODE_UID="loc202" # "loc202" on loc202mdb.zip
UNLOCODE_PREFIX="2020-2" # "2020-2" on "2020-2 UNLOCODE CodeList.mdb"

FONTEM_UNLOCODE_MDB_URL="https://unece.org/sites/default/files/${UNLOCODE_DATE}/${UNLOCODE_UID}mdb.zip"
# FONTEM_UNLOCODE_MDB_URL="https://unece.org/sites/default/files/2020-12/loc202mdb.zip"


# @see https://data.humdata.org/dataset/hxl-core-schemas
ONTOLOGIA_CODICEM_LOCUM_UN_LOCODE="https://proxy.hxlstandard.org/data.csv?dest=data_edit&strip-headers=on&url=https%3A%2F%2Fdocs.google.com%2Fspreadsheets%2Fd%2F1En9FlmM8PrbTWgl3UHPF_MXnJ6ziVZFhBbojSJzBdLI%2Fpub%3Fgid%3D319251406%26single%3Dtrue%26output%3Dcsv"
# ONTOLOGIA_CODICEM_HXL_STANDARD_CORE_ATTRIBUTE="https://proxy.hxlstandard.org/data.csv?dest=data_view&url=https%3A%2F%2Fdocs.google.com%2Fspreadsheets%2Fd%2F1En9FlmM8PrbTWgl3UHPF_MXnJ6ziVZFhBbojSJzBdLI%2Fpub%3Fgid%3D1810309357%26single%3Dtrue%26output%3Dcsv&strip-headers=on"
Expand All @@ -41,3 +55,13 @@ ONTOLOGIA_CODICEM_LOCUM_UN_LOCODE="https://proxy.hxlstandard.org/data.csv?dest=d
# wget -qO- "$ONTOLOGIA_CODICEM_HXL_STANDARD_CORE_ATTRIBUTE" > "${ROOTDIR}/ontologia/codicem/hxl/standard/core/attribute.hxl.csv"
# wget -qO- "$ONTOLOGIA_CODICEM_HXL_STANDARD_MASTER_VOCABULARY" > "${ROOTDIR}/ontologia/codicem/hxl/standard/master-vocabulary.hxl.csv"
# wget -qO- "$ONTOLOGIA_CODICEM_HXL_CPLP_HXL2TAB" > "${ROOTDIR}/ontologia/codicem/hxl/cplp/hxl2tab.hxl.csv"


#### Ignore after here ________________________________________________________
# https://github.com/mdbtools/mdbtools
# sudo apt install mdbtools

if [ ! -f "${ROOTDIR}/ontologia/codicem/locum/un-locode/temp/${UNLOCODE_UID}mdb.zip" ]; then
wget -qO- "$FONTEM_UNLOCODE_MDB_URL" > "${ROOTDIR}/ontologia/codicem/locum/un-locode/temp/${UNLOCODE_UID}mdb.zip"
unzip "${ROOTDIR}/ontologia/codicem/locum/un-locode/temp/${UNLOCODE_UID}mdb.zip" -d "${ROOTDIR}/ontologia/codicem/locum/un-locode/temp/"
fi
23 changes: 15 additions & 8 deletions ontologia/urn/defallo.urn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# - https://en.wikipedia.org/wiki/Uniform_Resource_Name
# - "fontem"
# - https://en.wiktionary.org/wiki/fons#Latin
# - "synōnymum"
# - https://en.wiktionary.org/wiki/synonymum#Latin
# - "auxilium"
# - https://en.wiktionary.org/wiki/auxilium#Latin
# - "dēscrīptiōnem"
Expand Down Expand Up @@ -297,16 +299,21 @@


### UN/LOCODE -----------------------------------------------------------------
# urn:data:un:locode -> urn:data:un:unece:locode -> urn:data--i:un:unece:locode
# -> urn:data--i:un:unece:locode
- urn: urn:data:un:locode
fontem:
- urn:data:un:unece:locode
synonymum: urn:data:un:unece:locode

- urn: urn:data:un:unece:locode
auxilium:
- https://unece.org/trade/cefact/UNLOCODE-Download
- https://github.com/HXL-CPLP/forum/issues/57
fontem:
- urn:data--i:un:unece:locode
- ontologia/codicem/locum/un-locode.hxl.csv

- urn: urn:data--i:un:unece:locode
fontem:
- https://unece.org/trade/uncefact/unlocode

# - urn: urn:data:un:unece:unlocode
# fontem:
# - urn:data--i:un:unece:locode

# - urn: urn:data--i:un:unece:locode
# fontem:
# - https://unece.org/trade/uncefact/unlocode

0 comments on commit 28191f7

Please sign in to comment.