query-085232444d27390b17245b9e0ee4b434
Andrew Gray?item
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel
WHERE
{
VALUES ?term { wd:Q56285355 }
?item wdt:P31 wd:Q5 .
?item p:P39 / ps:P39 ?term .
[] schema:about ?item; schema:isPartOf <https://en.wikipedia.org/>;
MINUS
{
{
SELECT ?item
WHERE
{
VALUES ?term { wd:Q56285355 }
?term wdt:P910 ?category .
?link schema:about ?category; schema:isPartOf <https://en.wikipedia.org/>; schema:name ?cat_title .
SERVICE wikibase:mwapi
{
# in
bd:serviceParam wikibase:endpoint "en.wikipedia.org";
wikibase:api "Generator";
mwapi:generator "categorymembers";
mwapi:gcmtitle ?cat_title;
mwapi:gcmprop "ids|title|type";
mwapi:gcmlimit "max".
# out
?item wikibase:apiOutputItem mwapi:item.
}
}
} }
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;
v5("?cat_title")
v3("?category")
v2("?item"):::projected
v4("?link")
v3("?term")
a2((" "))
a1((" "))
c24(["mwapi:item"]):::iri
c7([https://en.wikipedia.org/]):::iri
c13(["en.wikipedia.org"]):::literal
c11(["bd:serviceParam"]):::iri
c2(["wd:Q5"]):::iri
c22(["max"]):::literal
c17(["categorymembers"]):::literal
c27(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c20(["ids|title|type"]):::literal
c15(["Generator"]):::literal
bind0[/VALUES ?term/]
bind0-->v3
bind00(["wd:Q56285355"])
bind00 --> bind0
v2 --"p:direct/P31"--> c2
v2 --"p:P39"--> a1
a1 --"p:statement/P39"--> v3
a2 --"schema:about"--> v2
a2 --"schema:isPartOf"--> c7
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
bind2[/VALUES ?term/]
bind2-->v3
bind20(["wd:Q56285355"])
bind20 --> bind2
v3 --"p:direct/P910"--> v3
v4 --"schema:about"--> v3
v4 --"schema:isPartOf"--> c7
v4 --"schema:name"--> v5
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c11 --"mwapi:endpoint"--> c13
c11 --"mwapi:api"--> c15
c11 --"mwapi:generator"--> c17
c11 --"mwapi:gcmtitle"--> v5
c11 --"mwapi:gcmprop"--> c20
c11 --"mwapi:gcmlimit"--> c22
v2 --"mwapi:apiOutputItem"--> c24
end
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c11 --"mwapi:language"--> c27
end