query-d78af461858aa0bd3289214f307b7fa3
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 ?title ?item (GROUP_CONCAT(?causeLabel;SEPARATOR=", ") AS ?causes)
WHERE
{
SERVICE wikibase:mwapi
{
bd:serviceParam wikibase:api "Generator" .
bd:serviceParam wikibase:endpoint "fr.wikipedia.org" .
bd:serviceParam mwapi:gcmtitle "Catégorie:Mort de la grippe de 1918" .
bd:serviceParam mwapi:generator "categorymembers" .
?title wikibase:apiOutput mwapi:title .
?ns wikibase:apiOutput "@ns" .
?item wikibase:apiOutputItem mwapi:item .
}
FILTER(?ns = "0")
OPTIONAL { ?item wdt:P509 ?cause . }
SERVICE wikibase:label
{
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],fr,en".
?cause rdfs:label ?causeLabel .
}
}
GROUP BY ?item ?title
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?cause")
v5("?causeLabel"):::projected
v6("?causes")
v3("?item"):::projected
v1("?ns")
v2("?title"):::projected
c16(["mwapi:item"]):::iri
c14(["@ns"]):::literal
c9(["Catégorie:Mort de la grippe de 1918"]):::literal
c20(["#91;AUTO_LANGUAGE#93;,fr,en"]):::literal
c11(["categorymembers"]):::literal
c7(["fr.wikipedia.org"]):::literal
c3(["bd:serviceParam"]):::iri
c13(["mwapi:title"]):::iri
c5(["Generator"]):::literal
f0[["?ns = '0'"]]
f0 --> v1
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c3 --"mwapi:api"--> c5
c3 --"mwapi:endpoint"--> c7
c3 --"mwapi:gcmtitle"--> c9
c3 --"mwapi:generator"--> c11
v2 --"mwapi:apiOutput"--> c13
v1 --"mwapi:apiOutput"--> c14
v3 --"mwapi:apiOutputItem"--> c16
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P509".-> v4
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c3 --"mwapi:language"--> c20
v4 --"rdfs:label"--> v5
end
bind2[/"?causeLabel"/]
v5 --o bind2
bind2 --as--o v6