Skip to content

Commit 7d99f01

Browse files
authored
add custom vocabularies (#14)
add custom vocabularies
1 parent eb7dc02 commit 7d99f01

File tree

9 files changed

+197
-4
lines changed

9 files changed

+197
-4
lines changed

opendata.swiss/metadata/.env.example

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
PIVEAU_HUB_SEARCH_SERVICE='{"enabled":true,"url":"piveau-hub-search","port":8080,"api_key":"secret-search-api-key"}'
2+
PIVEAU_HUB_SEARCH_ES_CONFIG='{
3+
"host": "elasticsearch",
4+
"port": 9200,
5+
"vocabulary": {
6+
"ch-licenses": {
7+
"fields": [
8+
"license"
9+
],
10+
"replacements": [
11+
"label:pref_label.en",
12+
"resource:resource"
13+
]
14+
}
15+
}
16+
}'
217
PIVEAU_HUB_API_KEY="secret-hub-api-key"
318
PIVEAU_HUB_AUTHORIZATION_PROCESS_DATA='{"issuer":"http://keycloak.example.com/realms/ods","clientId":"piveau-hub-repo","clientSecret":"client-secret","tokenServerConfig":{"keycloak":{"serverUrl":"https://keycloak.example.com/","realm":"ods"}}}'
419

opendata.swiss/metadata/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- `piveau_catalogues/`: Piveau catalogues
88
- `piveau_pipes/`: Piveau pipes
99
- `piveau_scripts/`: Piveau scripts
10+
- `piveau_vocabularies/`: Piveau vocabularies
1011

1112
### Other resources
1213

@@ -35,6 +36,15 @@ To create the catalogues, run:
3536
./scripts/catalogues.sh
3637
```
3738

39+
To install the default vocabularies, open the shell at [http://localhost:8085/shell.html](http://localhost:8085/shell.html) and run `installVocabularies`.
40+
41+
To add custom vocabularies, run:
42+
43+
```sh
44+
./scripts/vocabularies.sh
45+
```
46+
47+
3848
And to trigger a harvest, run:
3949

4050
```sh

opendata.swiss/metadata/docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ services:
3434
condition: service_healthy
3535
environment:
3636
- PIVEAU_HUB_SEARCH_API_KEY=${PIVEAU_HUB_SEARCH_API_KEY}
37-
- PIVEAU_HUB_SEARCH_ES_CONFIG={"host":"elasticsearch","port":9200}
37+
- PIVEAU_HUB_SEARCH_ES_CONFIG=${PIVEAU_HUB_SEARCH_ES_CONFIG}
3838
- PIVEAU_HUB_SEARCH_GAZETTEER_CONFIG={"url":"http://doesnotmatter.eu"}
3939
- JAVA_OPTS=-Xms1g -Xmx2g
4040

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
@prefix cc: <http://creativecommons.org/ns#>.
2+
@prefix owl: <http://www.w3.org/2002/07/owl#> .
3+
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
4+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
5+
@prefix dct: <http://purl.org/dc/terms/> .
6+
@prefix dc: <http://purl.org/dc/elements/1.1/> .
7+
@prefix skosxl: <http://www.w3.org/2008/05/skos-xl#> .
8+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
9+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
10+
11+
<http://dcat-ap.ch/vocabulary/licenses>
12+
a owl:Ontology, skos:ConceptScheme ;
13+
owl:versionInfo "20240716" ;
14+
owl:versionIRI <http://dcat-ap.ch/vocabulary/licenses/20240716/> ;
15+
rdfs:comment "Liste der Lizenzen, die im Feld dct:license einer DCAT-AP CH-konformen dcat:distribution für die Zulieferung an opendata.swiss erlaubt sind."@de ,
16+
"List of licenses that are allowed in the field dct:license for delivering a dcat:Distribution in a way that conforms to DCAT-AP CH"@en ;
17+
rdfs:label "Liste der Lizenzen"@de, "List of Licenses"@en;
18+
skos:prefLabel "Liste der Lizenzen"@de ;
19+
dct:identifier "http://dcat-ap.ch/vocabulary/licenses" .
20+
21+
<http://dcat-ap.ch/vocabulary/licenses/terms_open>
22+
a skos:Concept ;
23+
skos:prefLabel "Opendata OPEN: Open use."@en,
24+
"Opendata OPEN: Utilisation libre."@fr,
25+
"Opendata OPEN: Freie Nutzung."@de,
26+
"Opendata OPEN: Libero utilizzo."@it ;
27+
skos:altLabel "Freie Nutzung"@de,
28+
"Utilisation libre"@fr ;
29+
skosxl:prefLabel [
30+
a skosxl:Label ;
31+
skosxl:literalForm "NonCommercialAllowed-CommercialAllowed-ReferenceNotRequired"@en ;
32+
rdfs:label "NonCommercialAllowed-CommercialAllowed-ReferenceNotRequired"@en
33+
] ;
34+
foaf:homepage <https://opendata.swiss/terms-of-use#terms_open> .
35+
36+
<http://dcat-ap.ch/vocabulary/licenses/terms_by>
37+
a skos:Concept ;
38+
skos:prefLabel "Opendata BY: Open use. Must provide the source."@en,
39+
"Opendata BY: Utilisation libre. Obligation d’indiquer la source."@fr,
40+
"Opendata BY: Freie Nutzung. Quellenangabe ist Pflicht."@de,
41+
"Opendata BY: Libero utilizzo. Indicazione della fonte obbligatoria. Utilizzo a fini commerciali ammesso soltanto previo consenso del titolare dei dati"@it ;
42+
skos:altLabel "Freie Nutzung. Quellenangabe ist Pflicht."@de,
43+
"Utilisation libre. Obligation d’indiquer la source."@fr ;
44+
skosxl:prefLabel [
45+
a skosxl:Label ;
46+
skosxl:literalForm "NonCommercialAllowed-CommercialAllowed-ReferenceRequired"@en ;
47+
rdfs:label "NonCommercialAllowed-CommercialAllowed-ReferenceRequired"@de
48+
] ;
49+
foaf:homepage <https://opendata.swiss/en/terms-of-use#terms_by> .
50+
51+
<http://dcat-ap.ch/vocabulary/licenses/terms_ask>
52+
a skos:Concept ;
53+
skos:prefLabel "Opendata ASK: Open use. Use for commercial purposes requires permission of the data owner."@en,
54+
"Opendata ASK: Utilisation libre. Utilisation à des fins commerciales uniquement avec l’autorisation du fournisseur des données."@fr,
55+
"Opendata ASK: Freie Nutzung. Kommerzielle Nutzung nur mit Bewilligung des Datenlieferanten zulässig."@de,
56+
"Opendata ASK: Libero utilizzo. Utilizzo a fini commerciali ammesso soltanto previo consenso del titolare dei dati."@it ;
57+
skos:altLabel "Freie Nutzung. Kommerzielle Nutzung nur mit Bewilligung des Datenlieferanten zulässig."@de,
58+
"Utilisation libre. Utilisation à des fins commerciales uniquement avec l’autorisation du fournisseur des données."@fr ;
59+
skosxl:prefLabel [
60+
a skosxl:Label ;
61+
skosxl:literalForm "NonCommercialAllowed-CommercialWithPermission-ReferenceNotRequired"@en ;
62+
rdfs:label "NonCommercialAllowed-CommercialWithPermission-ReferenceNotRequired"@de
63+
] ;
64+
foaf:homepage <https://opendata.swiss/en/terms-of-use#terms_ask> .
65+
66+
<http://dcat-ap.ch/vocabulary/licenses/terms_by_ask>
67+
a skos:Concept ;
68+
skos:prefLabel "Opendata BY ASK: Open use. Must provide the source. Use for commercial purposes requires permission of the data owner."@en,
69+
"Opendata BY ASK: Utilisation libre. Obligation d’indiquer la source. Utilisation commerciale uniquement avec l’autorisation du fournisseur des données."@fr,
70+
"Opendata BY ASK: Freie Nutzung. Quellenangabe ist Pflicht. Kommerzielle Nutzung nur mit Bewilligung des Datenlieferanten zulässig."@de,
71+
"Opendata BY ASK: Libero utilizzo. Indicazione della fonte obbligatoria. Utilizzo a fini commerciali ammesso soltanto previo consenso del titolare dei dati."@it ;
72+
skos:altLabel "Freie Nutzung. Quellenangabe ist Pflicht. Kommerzielle Nutzung nur mit Bewilligung des Datenlieferanten zulässig."@de,
73+
"Utilisation libre. Obligation d’indiquer la source. Utilisation commerciale uniquement avec l’autorisation du fournisseur des données."@fr ;
74+
skosxl:prefLabel [
75+
a skosxl:Label ;
76+
skosxl:literalForm "NonCommercialAllowed-CommercialWithPermission-ReferenceRequired"@en ;
77+
rdfs:label "NonCommercialAllowed-CommercialWithPermission-ReferenceRequired"@de
78+
] ;
79+
foaf:homepage <https://opendata.swiss/en/terms-of-use#terms_by_ask> .
80+
81+
<https://creativecommons.org/publicdomain/zero/1.0/>
82+
a skos:Concept, cc:License ;
83+
dc:identifier "cc-zero" ;
84+
skos:prefLabel "Creative Commons Zero 1.0 Universal (CC0 1.0)"@en,
85+
"Creative Commons Zero 1.0 Universell (CC0 1.0)"@de,
86+
"Creative Commons Zero 1.0 Universel (CC0 1.0)"@fr,
87+
"Creative Commons Zero 1.0 Universale (CC0 1.0)"@it ;
88+
skos:altLabel "cc-zero"@en,
89+
"CC Zero"@en,
90+
"CC0"@en ;
91+
skosxl:prefLabel [
92+
a skosxl:Label ;
93+
skosxl:literalForm "Creative Commons Zero 1.0 Universal (CC0 1.0)"@en ;
94+
rdfs:label "Creative Commons Zero 1.0 Universell (CC0 1.0)"@de
95+
] ;
96+
foaf:homepage <http://www.opendefinition.org/licenses/cc-zero> ;
97+
dct:references <http://www.opendefinition.org/licenses/cc-zero> ;
98+
cc:legalcode <http://creativecommons.org/publicdomain/zero/1.0/legalcode.de> ;
99+
cc:legalcode <http://creativecommons.org/publicdomain/zero/1.0/legalcode.en> ;
100+
cc:legalcode <http://creativecommons.org/publicdomain/zero/1.0/legalcode.fr> ;
101+
cc:legalcode <http://creativecommons.org/publicdomain/zero/1.0/legalcode.it> .
102+
103+
<https://creativecommons.org/licenses/by/4.0/>
104+
a skos:Concept, cc:License ;
105+
dc:identifier "cc-by/4.0" ;
106+
skos:prefLabel "Creative Commons Attribution 4.0 International(CC BY 4.0)"@en,
107+
"Creative Commons Namensnennung 4.0 International (CC BY 4.0)"@de,
108+
"Creative Commons Attribution 4.0 International (CC BY 4.0)"@fr,
109+
"Creative Commons Attribuzione 4.0 Internazionale (CC BY 4.0)"@it ;
110+
skos:altLabel "cc-by/4.0"@en,
111+
"cc-by"@en,
112+
"CC BY 4.0"@en,
113+
"CC-BY-4.0"@en ;
114+
skosxl:prefLabel [
115+
a skosxl:Label ;
116+
skosxl:literalForm "Creative Commons Attribution 4.0 International(CC BY 4.0)"@en ;
117+
rdfs:label "Creative Commons Namensnennung 4.0 International (CC BY 4.0)"@de
118+
] ;
119+
foaf:homepage <http://www.opendefinition.org/licenses/cc-by/> ;
120+
dct:references <http://www.opendefinition.org/licenses/cc-by/> ;
121+
cc:legalcode <http://creativecommons.org/licenses/by/4.0/legalcode.de> ;
122+
cc:legalcode <http://creativecommons.org/licenses/by/4.0/legalcode.en> ;
123+
cc:legalcode <http://creativecommons.org/licenses/by/4.0/legalcode.fr> ;
124+
cc:legalcode <http://creativecommons.org/licenses/by/4.0/legalcode.it> .
125+
126+
<https://creativecommons.org/licenses/by-sa/4.0/>
127+
a skos:Concept, cc:License ;
128+
dc:identifier "cc-by-sa/4.0" ;
129+
skos:prefLabel "Creative Commons Attribution-Sharealike 4.0 International (CC BY-SA 4.0)"@en,
130+
"Creative Commons Namensnennung-Share Alike 4.0 International (CC BY-SA 4.0)"@de,
131+
"Creative Commons Attribution-Partage Dans les Mêmes Conditions 4.0 International (CC BY-SA 4.0)"@fr,
132+
"Creative Commons Attribuzione-Condividiallostessomodo 4.0 Internazionale (CC BY-SA 4.0)"@it ;
133+
skos:altLabel "cc-by-sa/4.0"@en,
134+
"cc-by-sa"@en,
135+
"CC BY-SA 4.0"@en,
136+
"CC-BY-SA-4.0"@en ;
137+
skosxl:prefLabel [
138+
a skosxl:Label ;
139+
skosxl:literalForm "Creative Commons Attribution-Sharealike 4.0 International (CC BY-SA 4.0)"@en ;
140+
rdfs:label "Creative Commons Namensnennung-Share Alike 4.0 International (CC BY-SA 4.0)"@de
141+
] ;
142+
foaf:homepage <http://www.opendefinition.org/licenses/cc-by-sa> ;
143+
dct:references <http://www.opendefinition.org/licenses/cc-by-sa> ;
144+
cc:legalcode <http://creativecommons.org/licenses/by-sa/4.0/legalcode.de> ;
145+
cc:legalcode <http://creativecommons.org/licenses/by-sa/4.0/legalcode.en> ;
146+
cc:legalcode <http://creativecommons.org/licenses/by-sa/4.0/legalcode.fr> ;
147+
cc:legalcode <http://creativecommons.org/licenses/by-sa/4.0/legalcode.it> .

opendata.swiss/metadata/scripts/catalogues.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Automatically export all variables
44
set -a
5-
source .env
5+
. ./.env
66
set +a
77

88
set -eu

opendata.swiss/metadata/scripts/catalogues_delete.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Automatically export all variables
44
set -a
5-
source .env
5+
. ./.env
66
set +a
77

88
set -eu

opendata.swiss/metadata/scripts/harvest.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Automatically export all variables
44
set -a
5-
source .env
5+
. ./.env
66
set +a
77

88
set -eu
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
# Automatically export all variables
4+
set -a
5+
. ./.env
6+
set +a
7+
8+
9+
10+
curl -i -X PUT -H "X-API-Key: $PIVEAU_HUB_API_KEY" -H "Content-Type: text/turtle" --data @piveau_vocabularies/licenses-20240716.ttl "${HUB_REPO_ENDPOINT}/vocabularies/ch-licenses"
11+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
# Automatically export all variables
4+
set -a
5+
. ./.env
6+
set +a
7+
8+
9+
10+
curl -i -X DELETE -H "X-API-Key: $PIVEAU_HUB_API_KEY" "${HUB_REPO_ENDPOINT}/vocabularies/ch-licenses"

0 commit comments

Comments
 (0)