query-e8894f2a122538a7213cd2b064ae55e8
title:Commons files in Category:Audio files of poetry WITHOUT anything in its P180 SELECT ?file ?title WHERE { SERVICE wikibase:mwapi { bd:serviceParam wikibase:api "Generator" . bd:serviceParam wikibase:endpoint "commons.wikimedia.org" . bd:serviceParam mwapi:gcmtitle "Category:Audio files of poetry" . bd:serviceParam mwapi:generator "categorymembers" . bd:serviceParam mwapi:gcmtype "file" . bd:serviceParam mwapi:gcmlimit "max" . ?title wikibase:apiOutput mwapi:title . ?pageid wikibase:apiOutput "@pageid" . } BIND (URI(CONCAT('https://commons.wikimedia.org/entity/M', ?pageid)) AS ?file). MINUS {?file wdt:P180 [] .} }
Use at
- https://query.wikidata.org/sparql
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#>
#title:Commons files in Category:Audio files of poetry WITHOUT anything in its P180
SELECT ?file ?title
WHERE
{
SERVICE wikibase:mwapi
{
bd:serviceParam wikibase:api "Generator" .
bd:serviceParam wikibase:endpoint "commons.wikimedia.org" .
bd:serviceParam mwapi:gcmtitle "Category:Audio files of poetry" .
bd:serviceParam mwapi:generator "categorymembers" .
bd:serviceParam mwapi:gcmtype "file" .
bd:serviceParam mwapi:gcmlimit "max" .
?title wikibase:apiOutput mwapi:title .
?pageid wikibase:apiOutput "@pageid" .
}
BIND (URI(CONCAT('https://commons.wikimedia.org/entity/M', ?pageid)) AS ?file).
MINUS {?file wdt:P180 [] .}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?file"):::projected
v2("?pageid")
v1("?title"):::projected
a1((" "))
c14(["max"]):::literal
c10(["categorymembers"]):::literal
c2(["bd:serviceParam"]):::iri
c12(["file"]):::literal
c16(["mwapi:title"]):::iri
c6(["commons.wikimedia.org"]):::literal
c17(["@pageid"]):::literal
c4(["Generator"]):::literal
c8(["Category:Audio files of poetry"]):::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
v2 --"mwapi:apiOutput"--> c17
end
bind0[/"concat('https://commons.wikimedia.org/entity/M',?pageid)"/]
v2 --o bind0
bind0 --as--o v3
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P180"--> a1
end