You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Wikidata, each type of organization can have quantity (P1114) on them, showing how many of these exists. We could use that to validate our query results, either instead of the manual, or perhaps even better, as an extra column.
I am not sure if it is better to create an extra query to compare with (that may be redundant data stored and making it more complex to add a new country), bake it into the country query (I don't know if that can be done without being redundant in the same query, but that is probably better than in a different file), or create it on-the-fly in a script by extracting the types from the country query or the results (this would be elegant, but I don't know how to do it).
Why?
By using the data provided in Wikidata, the community can help us discover changes, and it may give an additional way to investigate differences.
I started to play around with this by getting any government agency type and checking "all of them"(https://w.wiki/Cpvp). Interestingly the (somewhat early) results highlight some "complete" types which we don't have in Govdirectory:
abbe@knockturn-alley ~/P/g/detect-agency-types-ready-for-inclusion> python generate-report.py
Analyzing government agency types...
Results:
--------------------------------------------------------------------------------
Type Expected Actual Country Status
--------------------------------------------------------------------------------
summary court 438 439 Japan !
Q44269577 27 2 Japan !
emergency zone 34 35 Belgium !
ministry of Finland 12 12 Finland ✓
ministry of Andorra 11 9 Andorra !
wizarate of Saudi Arabia 24 4 Saudi Arabia !
ministries of Denmark 21 21 Kingdom of Denmark ✓
ministry of Malaysia 27 28 Malaysia !
ministry of Nepal 21 21 Nepal ✓
ministry of Bangladesh 39 39 Bangladesh ✓
water board in the Netherlands 22 24 Netherlands !
State Historic Preservation Office 59 53 United States !
house secretariat 2 2 Japan ✓
Q27962302 9 9 Belgium ✓
District election commission 225 0 Ukraine !
state corporate register 55 1 United States !
ministries of Denmark 21 21 Kingdom of Denmark ✓
ministry of Bangladesh 39 39 Bangladesh ✓
Directorate-General of the European Commission 31 34 - !
Report saved to: agency_report_20250124_160453.csv
The feature
In Wikidata, each type of organization can have quantity (P1114) on them, showing how many of these exists. We could use that to validate our query results, either instead of the manual, or perhaps even better, as an extra column.
I am not sure if it is better to create an extra query to compare with (that may be redundant data stored and making it more complex to add a new country), bake it into the country query (I don't know if that can be done without being redundant in the same query, but that is probably better than in a different file), or create it on-the-fly in a script by extracting the types from the country query or the results (this would be elegant, but I don't know how to do it).
Why?
By using the data provided in Wikidata, the community can help us discover changes, and it may give an additional way to investigate differences.
Examples and inspiration
The text was updated successfully, but these errors were encountered: