query-f0b60872f67e7a698a49bc4e2c666b89
Propertiestaxon name (P225)Commons category (P373)Commons gallery (P935)
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX schema: <http://schema.org/>
SELECT ?item ?article
WHERE
{
?item wdt:P225 ?taxonName .
OPTIONAL {?item wdt:P373 ?commonscat} .
#OPTIONAL {?item wdt:P935 ?commonsgal} .
?article schema:about ?item .
?article schema:isPartOf <https://commons.wikimedia.org/> .
FILTER (STRSTARTS(STR(?article), "https://commons.wikimedia.org/wiki/Category"))
FILTER (!bound(?commonscat))
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?article"):::projected
v1("?commonscat")
v3("?item"):::projected
v4("?taxonName")
c6([https://commons.wikimedia.org/]):::iri
f0[["not bound(?commonscat)"]]
f0 --> v1
f1[["starts-with(str(?article),'https://commons.wikimedia.org/wiki/Category')"]]
f1 --> v2
v3 --"wdt:P225"--> v4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P373".-> v1
end
v2 --"schema:about"--> v3
v2 --"schema:isPartOf"--> c6