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

Prefer name statements over Wikidata labels #679

Open
1ec5 opened this issue Oct 2, 2023 · 2 comments
Open

Prefer name statements over Wikidata labels #679

1ec5 opened this issue Oct 2, 2023 · 2 comments

Comments

@1ec5
Copy link

1ec5 commented Oct 2, 2023

Wikidata fetches the label of each linked Wikidata item in each available language:

JsonNode label = row.get("label");
map.put(
label.get("xml:lang").asText(),
label.get("value").asText()
);

This is suboptimal because Wikidata labels are technically mainly for labeling items on the Wikidata site. Even though a label usually corresponds to a concept’s common name, it may sometimes contain some modifications to be recognizable on the site. (The closest analogy in OSM would be the name of a route relation that a mapper has optimized for display in the osm.org sidebar or JOSM’s relation list.)

A better alternative is the name (P2561) property. When an item has statements for this property, the query should prefer those statements. If there’s no statement for a given language, it should fall back to the label in that language.

If there are multiple name statements in a given language, the query should prefer the one with preferred rank, or without an end time (P582). Better yet, it should prefer the statement with the object has role (P3831) qualifier set to map label (Q104642575). For example, this will avoid adding an extra “D.C.” disambiguator to Washington, D.C. (which is correct in most written mediums, just not maps).

/ref openmaptiles/openmaptiles-tools#437 ZeLonewolf/openstreetmap-americana#592 (comment)

@msbarry
Copy link
Contributor

msbarry commented Oct 2, 2023

Thanks @1ec5 - We want the default behavior to match openmaptiles, so I think we'd want to wait for a decision there to replicate it downstream to planetiler-openmaptiles. But if we run into any issues with that or want to do it sooner we can change that behavior in planetiler/planetiler-openmaptiles and enable the behavior change behind a command-line flag.

Also this is helpful: openmaptiles/openmaptiles-tools#437 (comment)

The current query is:

SELECT ?id ?label where {
  VALUES ?id { wd:Q1 wd:Q2 ... } ?id (owl:sameAs* / rdfs:label) ?label
}

@1ec5
Copy link
Author

1ec5 commented Oct 3, 2023

Out of curiosity, is the owl:sameAs* having a significant impact on the quantity or quality of results? OpenMapTiles doesn’t include that path in its query.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants