fix(WikidataCommand): Always process P138#75
Merged
jbelien merged 2 commits intoEqualStreetNames:masterfrom Jan 21, 2026
Merged
fix(WikidataCommand): Always process P138#75jbelien merged 2 commits intoEqualStreetNames:masterfrom
jbelien merged 2 commits intoEqualStreetNames:masterfrom
Conversation
Contributor
Author
|
@jbelien Any chance this can be merged before the next updates (i.e. this year)? |
jbelien
requested changes
Jan 21, 2026
Member
jbelien
left a comment
There was a problem hiding this comment.
Thanks a lot for your contribution!
Could you rebase your branch with the latest changes (unrelated) and look at the following comment?
Thanks.
The latest update for Budapest [0] complained about `data/wikidata/Q44377.json` missing. This is probably the result of the following: 1. It discovered https://www.openstreetmap.org/relation/19901264. 2. Based on its `name:etymology:wikidata` tag, it downloaded Q850862. Since we’re not interested in what the namesakes are named after, it didn’t bother about P138. 3. Later it also discovered https://www.openstreetmap.org/way/156974362. 4. It saw that Q850862 has already been downloaded, so it skipped downloading it – and it also skipped downloading its namesake, Q44377. 5. Subsequently GeoJSONCommand couldn’t find `Q44377.json`. To fix this, simply don’t skip reading back the entity and trying to extract P138 from it. This also allows moving the `file_exists()` check to `save()`, reducing code duplication. This might result in a slight performance degradation (more local disk I/O if a street with its own Wikidata item consists of multiple ways not bundled in a relation), but no increase in HTTP requests (except for now doing the one or two HTTP requests per city that used to be erronously skipped), and correctness is worth that slight performance degradation. I confirmed that running on Budapest locally, the warning is printed without the fix, and not printed with the fix. I also confirmed that with the fix, `gender.csv` correctly includes `Q44377` for Budavári alagút. Please note that while the current example doesn’t involve people, so it may seem borderline out of scope, it’s very possible for similar cases to involve people: e.g. https://www.openstreetmap.org/way/335395340 (Flórián tér overpass) could have `name:etymology:wikidata=Q65215958` (Flórián tér) – I’m not 100% sure if this would be right, but arguably yes –, and that would potentially (depending on the processing order) break the yellow color of https://www.openstreetmap.org/way/908080555. [0] https://github.com/EqualStreetNames/equalstreetnames-budapest/actions/runs/19877172828/job/56967142726
759fe6d to
7e536c5
Compare
jbelien
approved these changes
Jan 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The latest update for Budapest [0] complained about
data/wikidata/Q44377.jsonmissing. This is probably the result of the following:name:etymology:wikidatatag, it downloaded Q850862. Since we’re not interested in what the namesakes are named after, it didn’t bother about P138.Q44377.json.To fix this, simply don’t skip reading back the entity and trying to extract P138 from it. This also allows moving the
file_exists()check tosave(), reducing code duplication.This might result in a slight performance degradation (more local disk I/O if a street with its own Wikidata item consists of multiple ways not bundled in a relation), but no increase in HTTP requests (except for now doing the one or two HTTP requests per city that used to be erronously skipped), and correctness is worth that slight performance degradation.
I confirmed that running on Budapest locally, the warning is printed without the fix, and not printed with the fix. I also confirmed that with the fix,
gender.csvcorrectly includesQ44377for Budavári alagút.Please note that while the current example doesn’t involve people, so it may seem borderline out of scope, it’s very possible for similar cases to involve people: e.g. https://www.openstreetmap.org/way/335395340 (Flórián tér overpass) could have
name:etymology:wikidata=Q65215958(Flórián tér) – I’m not 100% sure if this would be right, but arguably yes –, and that would potentially (depending on the processing order) break the yellow color of https://www.openstreetmap.org/way/908080555.[0] https://github.com/EqualStreetNames/equalstreetnames-budapest/actions/runs/19877172828/job/56967142726