Skip to content

Nearby item descriptions not working in v2.5.0 (beta) #823

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

Closed
misaochan opened this issue Jul 30, 2017 · 11 comments · Fixed by #1034
Closed

Nearby item descriptions not working in v2.5.0 (beta) #823

misaochan opened this issue Jul 30, 2017 · 11 comments · Fixed by #1034

Comments

@misaochan
Copy link
Member

Posting on behalf of @VojtechDostal who is unable to do so at the moment:

Item descriptions in Nearby Places do not work for him after the recent patch. For instance, this description used to beinstance of (P31)(which admittedly isn't the best description, haha, but still) but now only says ?

vojtech_nearby

@VojtechDostal
Copy link
Collaborator

Thanks for posting this.

@misaochan
Copy link
Member Author

Does anyone still encounter this in the current master build?

@VojtechDostal
Copy link
Collaborator

I still do.

@misaochan
Copy link
Member Author

Thanks for the feedback @VojtechDostal . We'll try to work on this ASAP.

@maskaravivek
Copy link
Member

I am unable to find a issue with item descriptions not showing up in general. Is the issue specific to this particular data point? Also the last change in the query was done in May itself ie during the hackathon.

@VojtechDostal I tried to reproduce the issue by checking places around the item posted in the screenshot. Somehow that item doesn't show up in my list.

  • Can you help me with its geo coordinates.
  • Also as you are good with queries it would be great if you could give a link to this item's wikidata entry.

item_desc

@VojtechDostal
Copy link
Collaborator

VojtechDostal commented Nov 16, 2017

I think this problem is language-specific. If your language is English, you won't have problems. But my app loads in Czech and is unable to retrieve Czech descriptions even if they exist.

Will explore the problem more in the morning.

@nicolas-raoul
Copy link
Member

nicolas-raoul commented Nov 17, 2017

Please note that what is shown on the screenshot above as "description" is actually not the item's description, but the label of the class of which the item is an instance of. In this case it is "gymnasium", which has a Czech label, so there is still a problem.

The Wikidata query gives the correct class label.

NearbyController.loadAttractionsFromLocation sends the language in the Java's locale format, whose codes Javadoc says it should not be relied on.
On the other side, Wikidata expects a language from this list.
For Czech, the first one is "cs" or "ces" or "cze" depending on the variant, and the second one is "cs".
That might be the problem?

@VojtechDostal
Copy link
Collaborator

Thanks @nicolas-raoul for explanation. I did not know the description is based on P31. In that case it is clear that it's not just a language-specific problem. Look at @maskaravivek 's screenshot from yesterday. For example, the "Orlová (usedlost)" item (Q30067555) has a P31 "homestead" which should show in English. But instead it says "no description found".

Why does it only work for "Pěvecká konzervatoř Praha" (Q12047866), which it correctly says is a secondary school based on instance? I don't know.

@maskaravivek
Copy link
Member

Thanks @nicolas-raoul @nicolas-raoul. Lots of insights from your comments about this issue. Should help us fix the queries for all languages.

@nicolas-raoul
Copy link
Member

Our query works (giving "usedlost") if the language is cs.
But it also works (giving "Seosko gospodarstvo") when using the language codes iamsurethiscodedoesnotexist.

So it is not the problem I was thinking about. There must be another problem.
Could someone get the HTTP request/response when that happens? It would tell us on what side is the problem. Thanks!

@misaochan
Copy link
Member Author

misaochan commented Dec 30, 2017

Errr... I think I might have solved this while working on Nearby uploads. It appears that we are calling place.getDescription().getText(); to get the description, but getDescription() actually returns an enum (which is used for selecting the icon), and I don't think getText() is converting that appropriately. Instead, AFAIK, what we really want is the longDescription .

The PR I submitted solves the problem for me. I had initially included it in my feature branch, but figured I should submit this to master now so people can test it and to prevent others from wasting further time on it (if my PR indeed works).

Could anyone (especially those with a non-English phone language) help test and see? Thanks!

@misaochan misaochan self-assigned this Jan 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants