query-669fc57b8d73ea3ab86c9af56001b635
Looking for items where category saved in sitelink to Commons does not match P373 TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX schema: <http://schema.org/>
SELECT ?item ?commonsCategory ?commonsSitelink ?category WHERE {
?item wdt:P373 ?commonsCategory .
?commonsSitelink schema:about ?item; schema:isPartOf <https://commons.wikimedia.org/>; schema:name ?sitelink_label .
FILTER(STRSTARTS(STR(?commonsSitelink), "https://commons.wikimedia.org/wiki/Category")) . # sitelink to a category
BIND(str(substr(?sitelink_label,10)) as ?category) . # strip "Category:" part
FILTER( false = (?category = ?commonsCategory) )
} LIMIT 10
Query found at
- https://www.wikidata.org/wiki/User:Jarekt/queries
- https://www.wikidata.org/wiki/User:Vislupus
- https://www.wikidata.org/wiki/Wikidata:Request_a_query/Archive/2017/10
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?category"):::projected
v2("?commonsCategory"):::projected
v3("?commonsSitelink"):::projected
v4("?item"):::projected
v5("?sitelink_label")
c6([https://commons.wikimedia.org/]):::iri
f0[["'false^^xsd:boolean' = ?category = ?commonsCategory"]]
f0 --> v6
f0 --> v2
f1[["starts-with(str(?commonsSitelink),'https://commons.wikimedia.org/wiki/Category')"]]
f1 --> v3
v4 --"wdt:P373"--> v2
v3 --"schema:about"--> v4
v3 --"schema:isPartOf"--> c6
v3 --"schema:name"--> v5
bind2[/"str(substring(?sitelink_label,'10^^xsd:integer'))"/]
v5 --o bind2
bind2 --as--o v6