query-d69e3bd0b92c3f02e14a36e440c9de76
Query shows entries, which should be filter out; number of entries in result set changes when executed repeatedlyTask T267175PhabricatorTracked in Hello, the following query should return all german streets, which have a Commons-sitelink, but no Commonscat-Property (P373):
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
SELECT ?item ?commonscat ?sitelink WHERE {
?item wdt:P31 wd:Q79007. # Innerortsstraße
?item wdt:P17 wd:Q183. # Deutschland
?sitelink schema:about ?item .
?sitelink schema:isPartOf <https://commons.wikimedia.org/> .
OPTIONAL {?item wdt:P373 ?commonscat }
FILTER (!bound(?commonscat)) # nur jene OHNE commonscat-Property (P373)
}
Query found at
- https://www.wikidata.org/wiki/Wikidata:Contact_the_development_team/Query_Service_and_search/Archive/2020/11
- https://www.wikidata.org/wiki/Wikidata:Project_chat/Archive/2020/11
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?commonscat"):::projected
v2("?item"):::projected
v3("?sitelink"):::projected
c2(["wd:Q79007"]):::iri
c7([https://commons.wikimedia.org/]):::iri
c4(["wd:Q183"]):::iri
f0[["not bound(?commonscat)"]]
f0 --> v1
v2 --"wdt:P31"--> c2
v2 --"wdt:P17"--> c4
v3 --"schema:about"--> v2
v3 --"schema:isPartOf"--> c7
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P373".-> v1
end