query-dc8f4c0f17606b0a0fc5e5bb163b7f78
Piotrus
Use at
- https://query.wikidata.org/sparql
PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?article_pl ?title_pl ?article_en ?title_en
WHERE
{
{
SERVICE wikibase:mwapi
{
bd:serviceParam wikibase:endpoint "pl.wikipedia.org".
bd:serviceParam wikibase:api "Generator".
bd:serviceParam mwapi:generator "categorymembers".
bd:serviceParam mwapi:gcmtitle "Kategoria:Absolwenci Szkoły Głównej Gospodarstwa Wiejskiego".
bd:serviceParam mwapi:gcmnamespace "0".
bd:serviceParam mwapi:gcmlimit "max".
?item wikibase:apiOutputItem mwapi:item.
?title_pl wikibase:apiOutput mwapi:title.
}
FILTER BOUND(?item) # This filter is very important. If some category members don't have items, without it
# the following triplets will try to get all wikipedia articles which inevitably will cause timeout
?article_pl schema:about ?item.
?article_pl schema:isPartOf <https://pl.wikipedia.org/>.
?article_en schema:about ?item.
?article_en schema:isPartOf <https://en.wikipedia.org/>.
?article_en schema:name ?title_en.
}
MINUS
{
SERVICE wikibase:mwapi
{
bd:serviceParam wikibase:endpoint "en.wikipedia.org".
bd:serviceParam wikibase:api "Generator".
bd:serviceParam mwapi:generator "categorymembers".
bd:serviceParam mwapi:gcmtitle "Category:Warsaw University of Life Sciences alumni".
bd:serviceParam mwapi:gcmnamespace "0".
bd:serviceParam mwapi:gcmlimit "max".
?item wikibase:apiOutputItem mwapi:item.
}
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?article_en"):::projected
v3("?article_pl"):::projected
v1("?item"):::projected
v5("?title_en"):::projected
v2("?title_pl"):::projected
c16(["mwapi:item"]):::iri
c25(["Category:Warsaw University of Life Sciences alumni"]):::literal
c22([https://en.wikipedia.org/]):::iri
c24(["en.wikipedia.org"]):::literal
c2(["bd:serviceParam"]):::iri
c21([https://pl.wikipedia.org/]):::iri
c10(["Kategoria:Absolwenci Szkoły Głównej Gospodarstwa Wiejskiego"]):::literal
c14(["max"]):::literal
c8(["categorymembers"]):::literal
c12(["0"]):::literal
c4(["pl.wikipedia.org"]):::literal
c18(["mwapi:title"]):::iri
c6(["Generator"]):::literal
f0[["bound(?item)"]]
f0 --> v1
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c2 --"mwapi:endpoint"--> c4
c2 --"mwapi:api"--> c6
c2 --"mwapi:generator"--> c8
c2 --"mwapi:gcmtitle"--> c10
c2 --"mwapi:gcmnamespace"--> c12
c2 --"mwapi:gcmlimit"--> c14
v1 --"mwapi:apiOutputItem"--> c16
v2 --"mwapi:apiOutput"--> c18
end
v3 --"schema:about"--> v1
v3 --"schema:isPartOf"--> c21
v4 --"schema:about"--> v1
v4 --"schema:isPartOf"--> c22
v4 --"schema:name"--> v5
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c2 --"mwapi:endpoint"--> c24
c2 --"mwapi:api"--> c6
c2 --"mwapi:generator"--> c8
c2 --"mwapi:gcmtitle"--> c25
c2 --"mwapi:gcmnamespace"--> c12
c2 --"mwapi:gcmlimit"--> c14
v1 --"mwapi:apiOutputItem"--> c16
end
end