Skip to content

Commit

Permalink
🇩🇪 Add German agencies abroad (govdirectory#466)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ainali authored Jan 3, 2025
1 parent 7dffae2 commit 18b2abc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion queries/countries.rq
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ WHERE {
(wd:Q35 'Denmark' 'denmark' 'Current content includes, ministries, regions and municipalities.' '')
(wd:Q20 'Norway' 'norway' 'Current content includes municipalities, district courts, ministries and embassies.' '')
(wd:Q117 'Ghana' 'ghana' 'Current content includes regions and districts.' '')
(wd:Q183 'Germany' 'germany' 'Current content includes ministries, federated states and governmental districts.' '')
(wd:Q183 'Germany' 'germany' 'Current content includes ministries, agencies abroad, federated states and governmental districts.' '')
(wd:Q258 'South Africa' 'south-africa' 'Current content includes departments, independent constitutional bodies, provinces and municipalities.' '')
(wd:Q55 'Netherlands' 'netherlands' 'Current content includes ministries, courts, water boards, the Kings cabinet, provinces and municipalities.' '')
(wd:Q664 'New Zealand' 'new-zealand' 'Current content includes public service departments, departmental agencies, wānangas, state-owned enterprises, regional councils, territorial authorities, autonomous crown entities, independent crown entities and crown research institutes.' '')
Expand Down
19 changes: 15 additions & 4 deletions queries/generators/germany.rq
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# expected_result_count: 50
# expected_result_count: 262
SELECT DISTINCT
?qid
?orgLabel
Expand All @@ -9,7 +9,8 @@ SELECT DISTINCT
?cofog
WHERE {
BIND(wd:Q183 AS ?country)

{
# agencies with country set to Germany
VALUES ?type {
wd:Q1221156 # state of Germany (16)
wd:Q896375 # federal ministry (15)
Expand All @@ -20,9 +21,19 @@ WHERE {

?org wdt:P31 ?type ;
wdt:P17 ?country .
} UNION {
# German agencies which does not necessarily have country set to Germany
VALUES ?type {
wd:Q3917681 # embassies (154)
wd:Q372690 # consulate generals (49)
wd:Q7843791 # consulats (7)
wd:Q5244910 # de facto embassies (2)
}

MINUS { ?org wdt:P576 [] }
MINUS { ?org wdt:P1366 [] }
?org wdt:P31 ?type; wdt:P137 ?country .
}
MINUS { ?org wdt:P576 [] MINUS { ?org wdt:P31 wd:Q3917681 } } # To get the embassy in Yemen
MINUS { ?org wdt:P1366 [] MINUS { ?org wdt:P5817 wd:Q55654238 } } # To get the embassy in Belgrade
MINUS { ?org wdt:P3999 [] }

OPTIONAL {
Expand Down

0 comments on commit 18b2abc

Please sign in to comment.