query-cb55678456d8ed08cf95841832611f0b

rq turtle/ttl

Commons category and sitelinks for paintingsHi Jarekt, I'm helping Pharos with the MET upload on Commons. One of the things we want to do is for works where we have more than 4 images, we want to put it in a separate category. As preparation I'm doing a bit of house keeping:

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
SELECT ?item ?commonscat ?sitelink ?lang ?site WHERE {
  ?item wdt:P31 wd:Q3305213 .
  #?item wdt:P195 wd:Q160236 .
  #?item wdt:P170 wd:Q41264 .
  ?item wdt:P373 ?commonscat .
  MINUS { 
  ?sitelink schema:about ?item .
  ?sitelink schema:inLanguage ?lang . 
  ?sitelink schema:isPartOf <https://commons.wikimedia.org/> } .
  }

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?commonscat"):::projected v1("?item"):::projected v4("?lang"):::projected v3("?sitelink"):::projected c2(["wd:Q3305213"]):::iri c7([https://commons.wikimedia.org/]):::iri v1 --"wdt:P31"--> c2 v1 --"wdt:P373"--> v2 subgraph minus0["MINUS"] style minus0 stroke-width:6px,fill:pink,stroke:red; v3 --"schema:about"--> v1 v3 --"schema:inLanguage"--> v4 v3 --"schema:isPartOf"--> c7 end