query-03a68e09ec8875ebc328ed747cff37d6
Doronuziel
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 bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?image ?imgLicense ?imgArtist
WHERE
{
?item wdt:P214 "96987389".
OPTIONAL { ?item wdt:P18 ?image. }
BIND (wikibase:decodeUri(SUBSTR(STR(?image),52)) AS ?image_name)
SERVICE wikibase:mwapi
{
bd:serviceParam wikibase:endpoint "commons.wikimedia.org".
bd:serviceParam wikibase:api "Generator".
bd:serviceParam wikibase:limit "once".
bd:serviceParam mwapi:generator "allpages".
bd:serviceParam mwapi:gapfrom ?image_name.
bd:serviceParam mwapi:gaplimit "1".
bd:serviceParam mwapi:gapnamespace "6".
bd:serviceParam mwapi:prop "imageinfo".
bd:serviceParam mwapi:iiprop "extmetadata".
?imgLicense wikibase:apiOutput "imageinfo/ii/extmetadata/LicenseShortName/@value".
?imgArtist wikibase:apiOutput "imageinfo/ii/extmetadata/Artist/@value".
}
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;
v2("?image"):::projected
v3("?image_name")
v5("?imgArtist"):::projected
v4("?imgLicense"):::projected
v1("?item"):::projected
c22(["extmetadata"]):::literal
c25(["imageinfo/ii/extmetadata/Artist/@value"]):::literal
c5(["bd:serviceParam"]):::iri
c13(["allpages"]):::literal
c24(["imageinfo/ii/extmetadata/LicenseShortName/@value"]):::literal
c7(["commons.wikimedia.org"]):::literal
c16(["1"]):::literal
c11(["once"]):::literal
c18(["6"]):::literal
c20(["imageinfo"]):::literal
c28(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c2(["96987389"]):::literal
c9(["Generator"]):::literal
v1 --"wdt:P214"--> c2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P18".-> v2
end
bind0[/"http://wikiba.se/ontology#decodeUri(substring(str(?image),'52^^xsd:integer'))"/]
v2 --o bind0
bind0 --as--o v3
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c5 --"mwapi:endpoint"--> c7
c5 --"mwapi:api"--> c9
c5 --"mwapi:limit"--> c11
c5 --"mwapi:generator"--> c13
c5 --"mwapi:gapfrom"--> v3
c5 --"mwapi:gaplimit"--> c16
c5 --"mwapi:gapnamespace"--> c18
c5 --"mwapi:prop"--> c20
c5 --"mwapi:iiprop"--> c22
v4 --"mwapi:apiOutput"--> c24
v5 --"mwapi:apiOutput"--> c25
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c5 --"mwapi:language"--> c28
end