query-0da005852ccfc8a2bca87b3cef905ada
Finding mismatched P373 and commons category sitelinks, following P910 links to a redirect that points to the category linked to through the commons sitelink: (P373)Commons category currently uses this query to look for cases where Pi botHi all.
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX schema: <http://schema.org/>
SELECT ?item ?commonscat ?sitelink ?name WHERE { ?item wdt:P373 ?commonscat. ?sitelink schema:about ?item; schema:isPartOf <https://commons.wikimedia.org/>; schema:name ?name . FILTER( CONTAINS(STR(?sitelink), 'Category:') = true ) . FILTER( ?commonscat != SUBSTR(STR(?name), 10) ) .} LIMIT 500 OFFSET 0
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?commonscat"):::projected
v4("?item"):::projected
v2("?name"):::projected
v3("?sitelink"):::projected
c7([https://commons.wikimedia.org/]):::iri
f0[["?commonscat != substring(str(?name),'10^^xsd:integer')"]]
f0 --> v1
f0 --> v2
f1[["contains(str(?sitelink),'Category:') = 'true^^xsd:boolean'"]]
f1 --> v3
v4 --"wdt:P373"--> v1
v3 --"schema:about"--> v4
v3 --"schema:isPartOf"--> c7
v3 --"schema:name"--> v2