query-0b52f5cb14f6586f2d84bcc4a9302f73
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 schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?image ?article ?sitelink
WHERE
{
{
?item wdt:P181 ?image.
filter(strstarts(str(?image),"http://commons.wikimedia.org/wiki/Special:FilePath/Acacia"))
?sitelink ^schema:name ?article .
?article schema:about ?item ;
schema:isPartOf <https://en.wikipedia.org/> .
}
MINUS
{
SERVICE wikibase:mwapi
{
bd:serviceParam wikibase:api "Search" .
bd:serviceParam wikibase:endpoint "en.wikipedia.org" .
bd:serviceParam mwapi:srnamespace "0" .
bd:serviceParam mwapi:srlimit "max" .
bd:serviceParam mwapi:srwhat "text" .
bd:serviceParam mwapi:srsearch 'insource:"range_map = Acacia"' .
?title wikibase:apiOutput mwapi:title .
}
BIND (STRLANG(?title, "en") as ?sitelink)
}
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("?article"):::projected
v1("?image"):::projected
v2("?item"):::projected
v6("?sitelink"):::projected
v5("?title")
c6([https://en.wikipedia.org/]):::iri
c12(["en.wikipedia.org"]):::literal
c8(["bd:serviceParam"]):::iri
c10(["Search"]):::literal
c18(["text"]):::literal
c16(["max"]):::literal
c20(["insource:"range_map = Acacia""]):::literal
c14(["0"]):::literal
c25(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c22(["mwapi:title"]):::iri
f0[["starts-with(str(?image),'http://commons.wikimedia.org/wiki/Special:FilePath/Acacia')"]]
f0 --> v1
v2 --"wdt:P181"--> v1
v3 --"schema:name"--> v6
v3 --"schema:about"--> v2
v3 --"schema:isPartOf"--> c6
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c8 --"mwapi:api"--> c10
c8 --"mwapi:endpoint"--> c12
c8 --"mwapi:srnamespace"--> c14
c8 --"mwapi:srlimit"--> c16
c8 --"mwapi:srwhat"--> c18
c8 --"mwapi:srsearch"--> c20
v5 --"mwapi:apiOutput"--> c22
end
bind2[/"STRLANG(?title,'en')"/]
v5 --o bind2
bind2 --as--o v6
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c8 --"mwapi:language"--> c25
end