query-8df2866fe59233d741481af5ebb48e94
TODO
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT
?file
?title
(GROUP_CONCAT(DISTINCT ?en_label; separator=", ") as ?labels_en)
(GROUP_CONCAT(DISTINCT ?mi_label; separator=", ") as ?labels_mi)
?content
WHERE {
{
SELECT * WHERE {
{
SELECT * WHERE {
BIND (URI(CONCAT('https://commons.wikimedia.org/entity/M', ?pageid)) AS ?file)
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:api "Generator";
wikibase:endpoint "commons.wikimedia.org";
mwapi:gcmtitle "Category:1930s photographs in Auckland Museum";
mwapi:generator "categorymembers";
mwapi:gcmtype "file";
mwapi:gcmlimit "50";
mwapi:prop "revisions";
mwapi:rvslots "main";
mwapi:rvprop "content";
wikibase:limit "once".
?title wikibase:apiOutput mwapi:title.
?pageid wikibase:apiOutput mwapi:pageid.
?content wikibase:apiOutput 'revisions/rev/slots/slot/text()'.
}
}
}.
?file wdt:P180 ?depicts .
}
}.
SERVICE <https://query.wikidata.org/sparql> {
OPTIONAL {?depicts rdfs:label ?mi_label . filter(lang(?mi_label) = "mi")}
OPTIONAL {?depicts rdfs:label ?en_label . filter(lang(?en_label) = "en")}
}
}
GROUP BY ?file ?title ?content
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?content"):::projected
v5("?depicts")
v6("?en_label"):::projected
v1("?file"):::projected
v8("?labels_en")
v9("?labels_mi")
v7("?mi_label"):::projected
v3("?pageid")
v2("?title"):::projected
c25(["mwapi:pageid"]):::iri
c18(["main"]):::literal
c20(["content"]):::literal
c2(["bd:serviceParam"]):::iri
c12(["file"]):::literal
c16(["revisions"]):::literal
c14(["50"]):::literal
c6(["commons.wikimedia.org"]):::literal
c8(["Category:1930s photographs in Auckland Museum"]):::literal
c10(["categorymembers"]):::literal
c22(["once"]):::literal
c24(["mwapi:title"]):::iri
c26(["revisions/rev/slots/slot/text()"]):::literal
c4(["Generator"]):::literal
bind0[/"concat('https://commons.wikimedia.org/entity/M',?pageid)"/]
v3 --o bind0
bind0 --as--o 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:prop"--> c16
c2 --"mwapi:rvslots"--> c18
c2 --"mwapi:rvprop"--> c20
c2 --"mwapi:limit"--> c22
v2 --"mwapi:apiOutput"--> c24
v3 --"mwapi:apiOutput"--> c25
v4 --"mwapi:apiOutput"--> c26
end
v1 --"wdt:P180"--> v5
subgraph s2["https://query.wikidata.org/sparql"]
style s2 stroke-width:4px;
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v5 -."rdfs:label".-> v7
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v5 -."rdfs:label".-> v6
end
end
bind3[/"?en_label"/]
v6 --o bind3
bind3 --as--o v8
bind4[/"?mi_label"/]
v7 --o bind4
bind4 --as--o v9