Fix #1334: Refactor variable names of nearby_query.rq (#2583)

* all variables were refactored to camelCase
This commit is contained in:
Vitaly V. Pinchuk 2019-03-16 15:39:39 +00:00 committed by Ujjwal Agrawal
parent a8fac9d160
commit a26b62f51b
2 changed files with 10 additions and 10 deletions

View file

@ -10,8 +10,8 @@ public class NearbyResultItem {
private final ResultTuple label;
private final ResultTuple icon;
@SerializedName("class") private final ResultTuple className;
@SerializedName("class_label") private final ResultTuple classLabel;
@SerializedName("Commons_category") private final ResultTuple commonsCategory;
@SerializedName("classLabel") private final ResultTuple classLabel;
@SerializedName("commonsCategory") private final ResultTuple commonsCategory;
public NearbyResultItem(ResultTuple item,
ResultTuple wikipediaArticle,

View file

@ -1,13 +1,13 @@
SELECT
(SAMPLE(?location) as ?location)
?item
(SAMPLE(COALESCE(?item_label_preferred_language, ?item_label_any_language)) as ?label)
(SAMPLE(COALESCE(?itemLabelPreferredLanguage, ?itemLabelAnyLanguage)) as ?label)
(SAMPLE(?classId) as ?class)
(SAMPLE(COALESCE(?class_label_preferred_language, ?class_label_any_language, "?")) as ?class_label)
(SAMPLE(COALESCE(?classLabelPreferredLanguage, ?classLabelAnyLanguage, "?")) as ?classLabel)
(SAMPLE(COALESCE(?icon0, ?icon1)) as ?icon)
?wikipediaArticle
?commonsArticle
(SAMPLE(?Commons_category) as ?Commons_category)
(SAMPLE(?commonsCategory) as ?commonsCategory)
WHERE {
# Around given location...
SERVICE wikibase:around {
@ -20,17 +20,17 @@ SELECT
MINUS {?item wdt:P18 []}
# Get the label in the preferred language of the user, or any other language if no label is available in that language.
OPTIONAL {?item rdfs:label ?item_label_preferred_language. FILTER (lang(?item_label_preferred_language) = "${LANG}")}
OPTIONAL {?item rdfs:label ?item_label_any_language}
OPTIONAL {?item rdfs:label ?itemLabelPreferredLanguage. FILTER (lang(?itemLabelPreferredLanguage) = "${LANG}")}
OPTIONAL {?item rdfs:label ?itemLabelAnyLanguage}
# Get Commons category (P373)
OPTIONAL { ?item wdt:P373 ?Commons_category. }
OPTIONAL { ?item wdt:P373 ?commonsCategory. }
# Get the class label in the preferred language of the user, or any other language if no label is available in that language.
OPTIONAL {
?item p:P31/ps:P31 ?classId.
OPTIONAL {?classId rdfs:label ?class_label_preferred_language. FILTER (lang(?class_label_preferred_language) = "${LANG}")}
OPTIONAL {?classId rdfs:label ?class_label_any_language}
OPTIONAL {?classId rdfs:label ?classLabelPreferredLanguage. FILTER (lang(?classLabelPreferredLanguage) = "${LANG}")}
OPTIONAL {?classId rdfs:label ?classLabelAnyLanguage}
OPTIONAL {
?wikipediaArticle schema:about ?item ;