query-438d60df06e66e86ca6350231beddd7a
Resolution of image (on item for painting)? a list of paintingsIs there a good way to add an indication of the resolution of the available image to Maybe there are three or four basic resolutions: 4. printing quality (same size as original, dpi?). 3. zoomable on details: depends on actual painting size (there are columns with W and H in cm), not sure what a good measure would be 2. Commons/Wikipedia file description page: is that 800px ? )sample1. Wikipedia infobox resolution: maybe 300px wide (How to call the resolutions? 4 very high < 4 high < 3 medium < 2 low < 1 very low 05:35, 13 November 2021 (UTC) Jura--- 10:31, 14 November 2021 (UTC) Jura. --- c:Commons:Village_pump#determine_available_image_resolution_(for_a_list_of_paintings)I asked for help on (3) and (4) at
Use at
- https://query.wikidata.org/sparql
PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psn: <http://www.wikidata.org/prop/statement/value-normalized/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?itemDescription
(ROUND(?height*100) as ?h_cm) (ROUND(?width*100) as ?w_cm) (ROUND(?height * 10 * ?width)/10 as ?size)
?img0 ?imgh ?imgw ?imgsize ?available_img_res
WHERE
{
?item wdt:P31 wd:Q3305213;
wdt:P170 wd:Q725681.
OPTIONAL { ?item p:P2048 /psn:P2048 [wikibase:quantityAmount ?height ; wikibase:quantityUnit wd:Q11573 ] }
OPTIONAL { ?item p:P2049 /psn:P2049 [wikibase:quantityAmount ?width ; wikibase:quantityUnit wd:Q11573 ]. }
OPTIONAL {
?item wdt:P18 ?img0
BIND(replace(wikibase:decodeUri(SUBSTR(STR(?img0), 52)),"_"," ") AS ?img)
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:endpoint "commons.wikimedia.org" .
bd:serviceParam wikibase:api "Generator" .
bd:serviceParam mwapi:generator "allpages" .
bd:serviceParam mwapi:prop "imageinfo" .
bd:serviceParam mwapi:gapprefix ?img .
bd:serviceParam mwapi:gapnamespace "6" .
bd:serviceParam mwapi:iiprop "timestamp|user|mediatype|metadata|dimensions" .
?imgsize wikibase:apiOutput "imageinfo/ii/@size".
?imgw wikibase:apiOutput "imageinfo/ii/@width".
?imgh wikibase:apiOutput "imageinfo/ii/@height".
?imgmediatype wikibase:apiOutput "imageinfo/ii/@mediatype".
}
BIND(xsd:integer(?imgw) as ?imgwi)
BIND(
IF(?imgwi < 290, "very low",
IF(?imgwi < 750, "low",
"medium or higher"))
as ?available_img_res)
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}