query-4b895ad64acabcc6500f49e64b27692c

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:gcmlimit "max" .
     ?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 c12(["max"]):::literal c8(["Category:Creator templates without Wikidata link"]):::literal c10(["categorymembers"]):::literal c2(["bd:serviceParam"]):::iri c18(["#91;AUTO_LANGUAGE#93;,en"]):::literal c14(["mwapi:title"]):::iri c6(["commons.wikimedia.org"]):::literal c4(["Generator"]):::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:gcmlimit"--> c12 v2 --"mwapi:apiOutput"--> c14 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"--> c18 end end bind2[/"concat('https://commons.wikimedia.org/wiki/',?template)"/] v2 --o bind2 bind2 --as--o v4