Edit nearby query

This commit is contained in:
neslihanturan 2019-10-08 17:33:50 +03:00
parent b96f8a68ce
commit 1f3c8c8deb

View file

@ -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.