mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Switch Commons categories to the end of the query to prevent cases with >1 cat from messing up wikipedia and commons articles
This commit is contained in:
parent
b600f51564
commit
a2db562476
2 changed files with 4 additions and 10 deletions
|
|
@ -100,12 +100,6 @@ public class NearbyPlaces {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Fields: ["Point(153.073 -27.6111)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>, <http://www.wikidata.org/entity/Q7271010>, "Queensland State Archives"@en, <http://www.wikidata.org/entity/Q327333>, "government agency"@en, , , Images from the Queensland State Archives, <https://en.wikipedia.org/wiki/Queensland_State_Archives>, <https://commons.wikimedia.org/wiki/Category:Images_from_the_Queensland_State_Archives>
|
|
||||||
// Produces: 02-11 21:32:45.015: V/NearbyPlaces(9300): Name: Queensland State Archives, type: government agency, category: Images from the Queensland State Archives, wikipediaSitelink: <https://en.wikipedia.org/wiki/Queensland_State_Archives>, commonsSitelink: <https://commons.wikimedia.org/wiki/Category:Images_from_the_Queensland_State_Archives>
|
|
||||||
|
|
||||||
//TODO: What about items with more than 1 Commons category??? Might need to rearrange categories to the end of the string
|
|
||||||
|
|
||||||
String[] fields = line.split("\t");
|
String[] fields = line.split("\t");
|
||||||
Timber.v("Fields: " + Arrays.toString(fields));
|
Timber.v("Fields: " + Arrays.toString(fields));
|
||||||
String point = fields[0];
|
String point = fields[0];
|
||||||
|
|
@ -113,9 +107,9 @@ public class NearbyPlaces {
|
||||||
String name = Utils.stripLocalizedString(fields[2]);
|
String name = Utils.stripLocalizedString(fields[2]);
|
||||||
String type = Utils.stripLocalizedString(fields[4]);
|
String type = Utils.stripLocalizedString(fields[4]);
|
||||||
String icon = fields[5];
|
String icon = fields[5];
|
||||||
String category = Utils.stripLocalizedString(fields[7]);
|
String wikipediaSitelink = Utils.stripLocalizedString(fields[7]);
|
||||||
String wikipediaSitelink = Utils.stripLocalizedString(fields[8]);
|
String commonsSitelink = Utils.stripLocalizedString(fields[8]);
|
||||||
String commonsSitelink = Utils.stripLocalizedString(fields[9]);
|
String category = Utils.stripLocalizedString(fields[9]);
|
||||||
|
|
||||||
Timber.v("Name: " + name + ", type: " + type + ", category: " + category + ", wikipediaSitelink: " + wikipediaSitelink + ", commonsSitelink: " + commonsSitelink);
|
Timber.v("Name: " + name + ", type: " + type + ", category: " + category + ", wikipediaSitelink: " + wikipediaSitelink + ", commonsSitelink: " + commonsSitelink);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@ SELECT
|
||||||
(SAMPLE(COALESCE(?class_label_preferred_language, ?class_label_any_language, "?")) as ?class_label)
|
(SAMPLE(COALESCE(?class_label_preferred_language, ?class_label_any_language, "?")) as ?class_label)
|
||||||
(SAMPLE(COALESCE(?icon0, ?icon1)) as ?icon)
|
(SAMPLE(COALESCE(?icon0, ?icon1)) as ?icon)
|
||||||
(SAMPLE(COALESCE(?emoji0, ?emoji1)) as ?emoji)
|
(SAMPLE(COALESCE(?emoji0, ?emoji1)) as ?emoji)
|
||||||
(SAMPLE(?Commons_category) as ?Commons_category)
|
|
||||||
?wikipediaArticle
|
?wikipediaArticle
|
||||||
?commonsArticle
|
?commonsArticle
|
||||||
|
(SAMPLE(?Commons_category) as ?Commons_category)
|
||||||
WHERE {
|
WHERE {
|
||||||
# Around given location...
|
# Around given location...
|
||||||
SERVICE wikibase:around {
|
SERVICE wikibase:around {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue