From 1f3c8c8deb86586bf0394c80251d3be3d86b306e Mon Sep 17 00:00:00 2001 From: neslihanturan Date: Tue, 8 Oct 2019 17:33:50 +0300 Subject: [PATCH] Edit nearby query --- app/src/main/resources/queries/nearby_query.rq | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/resources/queries/nearby_query.rq b/app/src/main/resources/queries/nearby_query.rq index 9806a55a5..9555c63c9 100644 --- a/app/src/main/resources/queries/nearby_query.rq +++ b/app/src/main/resources/queries/nearby_query.rq @@ -8,6 +8,7 @@ SELECT ?wikipediaArticle ?commonsArticle (SAMPLE(?commonsCategory) as ?commonsCategory) + (SAMPLE(?pic) as ?pic) WHERE { # Around given location... SERVICE wikibase:around { @@ -16,9 +17,6 @@ SELECT bd:serviceParam wikibase:radius "${RAD}" . # Radius in kilometers. } - # ... and without an image. - 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 ?itemLabelPreferredLanguage. FILTER (lang(?itemLabelPreferredLanguage) = "${LANG}")} OPTIONAL {?item rdfs:label ?itemLabelAnyLanguage} @@ -26,6 +24,9 @@ SELECT # Get Commons category (P373) OPTIONAL { ?item wdt:P373 ?commonsCategory. } + # Get (P18) + OPTIONAL { ?item wdt:P18 ?pic. } + # 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.