Open garethrees opened 2 years ago
Probably want to hinge this on public body tags, e.g. wikidata:Q4916650
.
See
https://github.com/mysociety/alaveteli/issues/235#issuecomment-977070532
which I think is about obtaining geographical coordinates for public bodies via the WikiData links.
We are working on this with madada.fr right now, we've kept track of our conversation around this with a wikidata expert who's helping us on our forum (in French): https://forum.madada.fr/t/suivi-du-travail-nlnet-2-1-lien-avec-wikidata/654/10
I wish I has searched the issues here before :(
What ID do you use for the WhatDoTheyKnow organisation ID? We were thinking of using the internal db id, which seems to be the only stable ID that alaveteli
has. url_name
for instance changes when an organisation is renamed. Do you see any major issues with this?
I was thinking of adding a url such as /body/by_id/:id
which would redirect to the public page of the body on our site, so that it becomes possible to link from wikidata to madada.fr (or any other alaveteli site then).
I wish I has searched the issues here before
It is a goldmine!
What ID do you use for the WhatDoTheyKnow organisation ID
We use url_name
by the looks of it.
Alaveteli redirects from an old url_name
to the current version.
I was thinking of adding a url such as
/body/by_id/:id
I'd go with /body/:id
to mimic the way that it works with requests if you go down this route (i.e. https://www.whatdotheyknow.com/request/872106 → https://www.whatdotheyknow.com/request/reserves_11). Can take a look at the code that does that for inspiration.
We use
url_name
I should add that there is some appetite to use the internal ID in places (e.g. for https://mysociety.github.io/uk_local_authority_names_and_codes/ I think).
I'd go with
/body/:id
Could route this to a separate action to keep the code cleaner instead of jamming it in to the existing PublicBodyController#show
:
# Routes
match '/body/:id' => 'public_body#by_id' # …
# Controller
def by_id
redirect_to show_public_body_path(PublicBody.find(params[:id]).url_name)
end
I should add that there is some appetite to use the internal ID in places (e.g. for https://mysociety.github.io/uk_local_authority_names_and_codes/ I think).
From a WDTK perspective, this would have been my preference!
Using the slug (url_name) is a little bit of a nuisance, as it can make for out-of-date data[^1], or in the case of bodies we've renamed [^2], misleading information, as the identifier points to a body which isn't the one the Wikidata entry refers to.
If we implement mapping of identifiers in Alaveteli, it'll let the WDTK team work to correct this historic anomaly - it should be a reasonably simple data matching exercise we can do (OpenRefine might work).
[^1]: NHS organisations, for example - where there is a renaming which didn't otherwise affect the constitution of the entity, we'd simply rename them. Whereas, for Schools, conversion to academy status is a brand new entity on WDTK. [^2]: For example, where a successor entity uses the trading name of the predecessor - we've been known to swap the url_name around (for example, East West Rail Consortium's url_name was reused for East West Railway Company, and Abellio ScotRail's url_name was reused for ScotRail Trains).
Just updating this ticket to mention the newly created Ma Dada Organisation ID
which we ended up creating using the same logic as WDTK (using url_name
) to favour compatibility between sites. We are in the process of marking our 50k authorities with it starting this week.
There's already a WhatDoTheyKnow organisation ID.
This would enable things like Adding an authority logo, pulling in a Twitter handle, and updating home pages.
We should consider how we make this usable for all Alavetelis.