query-99a77eb33a9e75d97baad2212fdd0ac8

rq turtle/ttl

More queries840 instances where an item and its P279 parent both have the same Commons category:

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?parent ?parentLabel ?commonscat WHERE {
    ?item wdt:P373 ?commonscat .
    ?parent wdt:P373 ?commonscat .
    ?item wdt:P279 ?parent .
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?parentLabel ?itemLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?commonscat"):::projected v3("?item"):::projected v2("?itemLabel"):::projected v5("?parent"):::projected v1("?parentLabel"):::projected c4(["bd:serviceParam"]):::iri c6(["#91;AUTO_LANGUAGE#93;,en"]):::literal v3 --"wdt:P373"--> v4 v5 --"wdt:P373"--> v4 v3 --"wdt:P279"--> v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c4 --"wikibase:language"--> c6 end