query-9f1095a1ccac524842510d1676c219b3

rq turtle/ttl

PropertiesCommons Creator page (P1472)

Use at

PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT (IRI(concat("https://commons.wikimedia.org/wiki/", ?template)) as ?templateLink) ?templateName ?creatorItem ?creatorItemLabel {
  SERVICE wikibase:mwapi {
     bd:serviceParam wikibase:api "Generator" .
     bd:serviceParam wikibase:endpoint "commons.wikimedia.org" .
     bd:serviceParam mwapi:gcmtitle "Category:Creator templates without Wikidata link" .
     bd:serviceParam mwapi:generator "categorymembers" .
     bd:serviceParam mwapi:gcmtype "page" .
     bd:serviceParam mwapi:gcmlimit "max" .
     bd:serviceParam mwapi:gcmsort "timestamp" .
     bd:serviceParam mwapi:gcmdir "descending" .
     ?template wikibase:apiOutput mwapi:title  .
  }
  BIND(substr(?template,9) as ?templateName) .
  OPTIONAL { 
    ?creatorItem wdt:P1472 ?templateName .
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
  }
  FILTER ( BOUND(?creatorItem) ) .
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?creatorItem"):::projected v2("?template"):::projected v4("?templateLink") v3("?templateName"):::projected c14(["max"]):::literal c18(["descending"]):::literal c8(["Category:Creator templates without Wikidata link"]):::literal c10(["categorymembers"]):::literal c2(["bd:serviceParam"]):::iri c24(["#91;AUTO_LANGUAGE#93;,en"]):::literal c12(["page"]):::literal c20(["mwapi:title"]):::iri c6(["commons.wikimedia.org"]):::literal c4(["Generator"]):::literal c16(["timestamp"]):::literal f0[["bound(?creatorItem)"]] f0 --> v1 subgraph s1["http://wikiba.se/ontology#mwapi"] style s1 stroke-width:4px; c2 --"mwapi:api"--> c4 c2 --"mwapi:endpoint"--> c6 c2 --"mwapi:gcmtitle"--> c8 c2 --"mwapi:generator"--> c10 c2 --"mwapi:gcmtype"--> c12 c2 --"mwapi:gcmlimit"--> c14 c2 --"mwapi:gcmsort"--> c16 c2 --"mwapi:gcmdir"--> c18 v2 --"mwapi:apiOutput"--> c20 end bind1[/"substring(?template,'9^^xsd:integer')"/] v2 --o bind1 bind1 --as--o v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P1472".-> v3 subgraph s2["http://wikiba.se/ontology#label"] style s2 stroke-width:4px; c2 --"mwapi:language"--> c24 end end bind2[/"concat('https://commons.wikimedia.org/wiki/',?template)"/] v2 --o bind2 bind2 --as--o v4