Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validating or basing expected count on quantity (P1114) #460

Open
Ainali opened this issue Nov 29, 2024 · 1 comment
Open

Validating or basing expected count on quantity (P1114) #460

Ainali opened this issue Nov 29, 2024 · 1 comment
Labels
enhancement 🥇 New feature or request

Comments

@Ainali
Copy link
Member

Ainali commented Nov 29, 2024

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

@Ainali Ainali added the enhancement 🥇 New feature or request label Nov 29, 2024
@Abbe98
Copy link
Member

Abbe98 commented Jan 24, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🥇 New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants