query-ec115abbcfe97da51b1d4e9e472f9815
MargaretRDonald
Use at
- https://query.wikidata.org/sparql
PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?file ?filelink
WHERE
{
{
SELECT ?file
WHERE
{
SERVICE wikibase:mwapi
{
bd:serviceParam wikibase:api "Generator" .
bd:serviceParam wikibase:endpoint "commons.wikimedia.org" .
bd:serviceParam mwapi:gcmtitle "Category:Photographs by Kevin Thiele" .
bd:serviceParam mwapi:generator "categorymembers" .
bd:serviceParam mwapi:gcmtype "file" .
bd:serviceParam mwapi:gcmlimit "max" .
?file wikibase:apiOutput mwapi:title .
}
}
} MINUS {
{
SELECT ?file
WHERE
{
SERVICE wikibase:mwapi
{
bd:serviceParam wikibase:api "Generator" .
bd:serviceParam wikibase:endpoint "commons.wikimedia.org" .
bd:serviceParam mwapi:gcmtitle "Category:Photographs by Kevin Thiele" .
bd:serviceParam mwapi:generator "categorymembers" .
bd:serviceParam mwapi:gcmtype "file" .
bd:serviceParam mwapi:gcmlimit "max" .
bd:serviceParam mwapi:prop "globalusage" .
bd:serviceParam mwapi:gulimit "max" .
?file wikibase:apiOutput mwapi:title .
?use wikibase:apiOutput "globalusage/gu/@wiki" .
}
FILTER BOUND(?use)
}
}}
BIND (IRI(CONCAT("https://commons.wikimedia.org/wiki/", ENCODE_FOR_URI(?file))) AS ?filelink)
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?file"):::projected
v3("?filelink"):::projected
v2("?use")
c14(["max"]):::literal
c10(["categorymembers"]):::literal
c2(["bd:serviceParam"]):::iri
c12(["file"]):::literal
c18(["globalusage"]):::literal
c20(["globalusage/gu/@wiki"]):::literal
c8(["Category:Photographs by Kevin Thiele"]):::literal
c16(["mwapi:title"]):::iri
c6(["commons.wikimedia.org"]):::literal
c4(["Generator"]):::literal
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
v1 --"mwapi:apiOutput"--> c16
end
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
f1[["bound(?use)"]]
f1 --> v2
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:prop"--> c18
c2 --"mwapi:gulimit"--> c14
v1 --"mwapi:apiOutput"--> c16
v2 --"mwapi:apiOutput"--> c20
end
end
bind2[/"concat('https://commons.wikimedia.org/wiki/',encode-for-uri(?file))"/]
v1 --o bind2
bind2 --as--o v3