query-de30367830acd5bcb0241835828849bf
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 wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT distinct ?item ?itemLabel ?name where
{
VALUES ?category {wd:Q86333319 wd:Q86333359 wd:Q86333287}
?article schema:about ?category ;
schema:isPartOf <https://ja.wikipedia.org/> .
?sitelink ^schema:name ?article .
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:endpoint "ja.wikipedia.org";
wikibase:api "Generator";
mwapi:generator "categorymembers";
mwapi:gcmtitle ?sitelink ;
mwapi:gcmprop "ids|title|type";
mwapi:gcmlimit "max".
# out
?name wikibase:apiOutput mwapi:title. # ja-wikipedia article / category name
?item wikibase:apiOutputItem mwapi:item. # wikidata QId for the person's item
}
filter not exists {?item wdt:P39 wd:Q20011928. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],ja". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?article")
v2("?category")
v1("?item"):::projected
v5("?name"):::projected
v4("?sitelink")
c23(["mwapi:item"]):::iri
c8(["bd:serviceParam"]):::iri
c10(["ja.wikipedia.org"]):::literal
c19(["max"]):::literal
c2(["wd:Q20011928"]):::iri
c26(["#91;AUTO_LANGUAGE#93;,ja"]):::literal
c14(["categorymembers"]):::literal
c5([https://ja.wikipedia.org/]):::iri
c21(["mwapi:title"]):::iri
c17(["ids|title|type"]):::literal
c12(["Generator"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P39"--> e0c2
e0v1("?item"):::projected
e0c2(["wd:Q20011928"]):::iri
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> c2
v1 --"wdt:P39"--> c2
bind1[/VALUES ?category/]
bind1-->v2
bind10(["wd:Q86333319"])
bind10 --> bind1
bind11(["wd:Q86333359"])
bind11 --> bind1
bind12(["wd:Q86333287"])
bind12 --> bind1
v3 --"schema:about"--> v2
v3 --"schema:isPartOf"--> c5
v3 --"schema:name"--> v4
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c8 --"mwapi:endpoint"--> c10
c8 --"mwapi:api"--> c12
c8 --"mwapi:generator"--> c14
c8 --"mwapi:gcmtitle"--> v4
c8 --"mwapi:gcmprop"--> c17
c8 --"mwapi:gcmlimit"--> c19
v5 --"mwapi:apiOutput"--> c21
v1 --"mwapi:apiOutputItem"--> c23
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c8 --"mwapi:language"--> c26
end