I use the following query:
SELECT DISTINCT (SAMPLE(?image)as ?image) ?item ?itemLabel ?itemDescription (SAMPLE(?DR) AS ?DRSample) (SAMPLE(?article) AS ?articleSample)
WHERE{ ?article schema:about ?item ; schema:inLanguage "en" ; schema:isPartOf <https://en.wikipedia.org/>
FILTER ( ?item = <//www.wikidata.org/entity/Q303> )
OPTIONAL { ?item wdt:P569 ?DR }
OPTIONAL { ?item wdt:P570 ?RIP }
OPTIONAL { ?item wdt:P18 ?image }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en"}}
GROUP BY ?item ?itemLabel ?itemDescription
If I copy image url from result, I get:
https://commons.wikimedia.org/wiki/File:Elvis%20Presley%20promoting%20Jailhouse%20Rock.jpg
but if I look at query response (in Dev Tools), I get:
http://commons.wikimedia.org/wiki/Special:FilePath/Elvis%20Presley%20promoting%20Jailhouse%20Rock.jpg
Why different urls?
Why second http, not https?
Running query in my application I get second result too, but I want first.
And why I get second image from Elvis Presley profile, not first?