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.