query-70536677c8a8d1018db5099b94faa8cc
MargaretRDonald
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 ?item ?itemLabel ?image ?article ?image_title
WHERE
{
{
SELECT ?item ?image ?article ?image_title
WHERE
{
?article schema:about ?item ;
schema:isPartOf <https://vi.wikipedia.org/> .
?item wdt:P31 wd:Q16521 .
?item wdt:P18 ?image .
?item wdt:P5984 ?apni .
FILTER (CONTAINS(STR(?image),"FilePath/P"))
FILTER (CONTAINS(STR(?article),"wiki/P"))
BIND (SUBSTR(wikibase:decodeUri(STR(?image)), 52) AS ?image_title)
}
}
{
SELECT ?image_title
WHERE
{
SERVICE wikibase:mwapi
{
bd:serviceParam wikibase:endpoint "commons.wikimedia.org" .
bd:serviceParam wikibase:api "Generator" .
bd:serviceParam mwapi:generator "categorymembers" .
bd:serviceParam mwapi:gcmtitle "Category:Photographs by Kevin Thiele" .
bd:serviceParam mwapi:gcmtype "file" .
bd:serviceParam mwapi:gcmprop "title" .
bd:serviceParam mwapi:gcmlimit "max" .
?file wikibase:apiOutput mwapi:title .
}
BIND (SUBSTR(?file, 6) AS ?image_title)
}
} FILTER NOT EXISTS
{
?article2 schema:about ?item ;
schema:isPartOf <https://en.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;
v5("?apni")
v3("?article"):::projected
v1("?article2")
v7("?file")
v4("?image"):::projected
v8("?image_title"):::projected
v2("?item"):::projected
c24(["title"]):::literal
c3([https://en.wikipedia.org/]):::iri
c12(["bd:serviceParam"]):::iri
c22(["file"]):::literal
c14(["commons.wikimedia.org"]):::literal
c26(["max"]):::literal
c18(["categorymembers"]):::literal
c6([https://vi.wikipedia.org/]):::iri
c31(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c20(["Category:Photographs by Kevin Thiele"]):::literal
c8(["wd:Q16521"]):::iri
c28(["mwapi:title"]):::iri
c16(["Generator"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"schema:about"--> e0v2
e0v1 --"schema:isPartOf"--> e0c3
e0v1("?article2"):::projected
e0v2("?item"):::projected
e0c3([https://en.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
f1[["contains(str(?article),'wiki/P')"]]
f1 --> v3
f2[["contains(str(?image),'FilePath/P')"]]
f2 --> v4
v3 --"schema:about"--> v2
v3 --"schema:isPartOf"--> c6
v2 --"wdt:P31"--> c8
v2 --"wdt:P18"--> v4
v2 --"wdt:P5984"--> v5
bind3[/"substring(http://wikiba.se/ontology#decodeUri(str(?image)),'52^^xsd:integer')"/]
v4 --o bind3
bind3 --as--o v8
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c12 --"mwapi:endpoint"--> c14
c12 --"mwapi:api"--> c16
c12 --"mwapi:generator"--> c18
c12 --"mwapi:gcmtitle"--> c20
c12 --"mwapi:gcmtype"--> c22
c12 --"mwapi:gcmprop"--> c24
c12 --"mwapi:gcmlimit"--> c26
v7 --"mwapi:apiOutput"--> c28
end
bind4[/"substring(?file,'6^^xsd:integer')"/]
v7 --o bind4
bind4 --as--o v8
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c12 --"mwapi:language"--> c31
end