query-20464f76448d8ac69fefae2d258ac227
]reply[07:12, 18 June 2020 (UTC) Jura I had been using, though it doesn't have that many members either. --- (Q8682545)Category:Rose gardens Indeed. Maybe it's a problem with ]reply[07:20, 18 June 2020 (UTC) Jura , maybe that throws it off. --- https://en.wikipedia.org/wiki/Mills_Rose_GardenThere are 4 redirects in these categories without an associated them, e.g. ]reply[07:24, 18 June 2020 (UTC) JuraFILTER(BOUND(?item) ) fixes it .. (and !BOUND crashed it) ---
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 wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?wp ?title ?item ?inst ?instLabel
{
?cat wdt:P301 wd:Q291177 .
[] schema:about ?cat ; schema:isPartOf ?wp ; schema:name ?catname .
BIND(strbefore(strafter(str(?wp),"//"),"/") as ?wiki)
BIND(str(?catname) as ?cstr)
FILTER(BOUND(?cstr) )
SERVICE wikibase:mwapi
{
bd:serviceParam wikibase:endpoint ?wiki ; wikibase:api "Generator".
bd:serviceParam mwapi:generator "categorymembers".
bd:serviceParam mwapi:gcmtitle ?cstr ; mwapi:gcmnamespace "0".
bd:serviceParam mwapi:gcmlimit "max".
?item wikibase:apiOutputItem mwapi:item.
?title wikibase:apiOutput mwapi:title.
}
FILTER(BOUND(?item) )
OPTIONAL { ?item wdt:P31 ?inst }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?cat")
v5("?catname")
v7("?cstr")
v8("?inst"):::projected
v1("?item"):::projected
v7("?title"):::projected
v6("?wiki")
v4("?wp"):::projected
a1((" "))
c19(["mwapi:item"]):::iri
c2(["wd:Q291177"]):::iri
c7(["bd:serviceParam"]):::iri
c17(["max"]):::literal
c12(["categorymembers"]):::literal
c15(["0"]):::literal
c25(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c21(["mwapi:title"]):::iri
c10(["Generator"]):::literal
f0[["bound(?item)"]]
f0 --> v1
f1[["bound(?cstr)"]]
f1 --> v7
v3 --"wdt:P301"--> c2
a1 --"schema:about"--> v3
a1 --"schema:isPartOf"--> v4
a1 --"schema:name"--> v5
bind2[/"substring-before(substring-after(str(?wp),'//'),'/')"/]
v4 --o bind2
bind2 --as--o v6
bind3[/"str(?catname)"/]
v5 --o bind3
bind3 --as--o v7
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c7 --"mwapi:endpoint"--> v6
c7 --"mwapi:api"--> c10
c7 --"mwapi:generator"--> c12
c7 --"mwapi:gcmtitle"--> v7
c7 --"mwapi:gcmnamespace"--> c15
c7 --"mwapi:gcmlimit"--> c17
v1 --"mwapi:apiOutputItem"--> c19
v7 --"mwapi:apiOutput"--> c21
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P31".-> v8
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c7 --"mwapi:language"--> c25
end