query-3075405ebdfc324dfdbc502c94e05236
TODO
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 DISTINCT ?item ?itemLabel ?sitelink ?article
WHERE {
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:api "Search";
wikibase:endpoint "en.wikipedia.org";
mwapi:srsearch "water pollution".
?name wikibase:apiOutput mwapi:title.
}
BIND (URI(CONCAT('https://en.wikipedia.org/wiki/', ?name)) AS ?article)
# have an en wiki article
?article schema:about ?item ;
schema:isPartOf <https://en.wikipedia.org/> ;
schema:name ?sitelink .
#lack a sitelink to somewhere else
filter not exists {?article2 schema:about ?item ;
schema:isPartOf <https://de.wikipedia.org/> .}
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;
v4("?article"):::projected
v1("?article2")
v2("?item"):::projected
v3("?name")
v5("?sitelink"):::projected
c3([https://de.wikipedia.org/]):::iri
c11(["water pollution"]):::literal
c9(["en.wikipedia.org"]):::literal
c14([https://en.wikipedia.org/]):::iri
c5(["bd:serviceParam"]):::iri
c7(["Search"]):::literal
c18(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c13(["mwapi:title"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"schema:about"--> e0v2
e0v1 --"schema:isPartOf"--> e0c3
e0v1("?article2"):::projected
e0v2("?item"):::projected
e0c3([https://de.wikipedia.org/]):::iri
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> v2
f0 --> c2
f0 --> c3
v1 --"schema:about"--> v2
v1 --"schema:isPartOf"--> c3
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c5 --"mwapi:api"--> c7
c5 --"mwapi:endpoint"--> c9
c5 --"mwapi:srsearch"--> c11
v3 --"mwapi:apiOutput"--> c13
end
bind1[/"concat('https://en.wikipedia.org/wiki/',?name)"/]
v3 --o bind1
bind1 --as--o v4
v4 --"schema:about"--> v2
v4 --"schema:isPartOf"--> c14
v4 --"schema:name"--> v5
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c5 --"mwapi:language"--> c18
end