query-00ec73163208eed00c7df5a0fe2fa4fb

rq turtle/ttl

For File:Agrostis Spica venti (modern=Apera spica-venti) - Pl0151 - FloraBatava-KB-v02.jpg

- MediaID = M132800954 (see [https://commons.wikimedia.org/w/index.php?title=File:Agrostis_Spica_venti_(modern%3DApera_spica-venti)-_Pl0151-_FloraBatava-KB-v02.jpg&action=info this page])

- Title (as string)= File:Agrostis Spica venti (modern=Apera spica-venti) - Pl0151 - FloraBatava-KB-v02.jpg

- FullimageUrl1 = https://upload.wikimedia.org/wikipedia/commons/e/e8/Agrostis_Spica_venti_%28modern%3DApera_spica-venti%29_-Pl0151-_FloraBatava-KB-v02.jpg

- FullimageUrl2, via Special:Redirect = https://commons.wikimedia.org/w/index.php?title=Special:Redirect/file&wpvalue=File:Agrostis_Spica_venti_(modern%3DApera_spica-venti)-_Pl0151-_FloraBatava-KB-v02.jpg

- PageUrl = https://commons.wikimedia.org/wiki/File:Agrostis_Spica_venti_(modern%3DApera_spica-venti)-_Pl0151-_FloraBatava-KB-v02.jpg

- PageShortUrl = https://commons.wikimedia.org/w/index.php?curid=132800954

- PageShortUrl2, via the concept URI = https://commons.wikimedia.org/entity/M132800954

See for help https://www.mediawiki.org/wiki/Wikidata_Query_Service/User_Manual/MWAPI

SELECT ?MediaID ?Title ?FullimageUrl1 ?FullimageUrl2 ?PageUrl ?PageShortUrl1 ?PageShortUrl2 WITH { SELECT ?Title ?pageid ?FullimageUrl1 WHERE { SERVICE wikibase:mwapi { bd:serviceParam wikibase:api "Generator" . bd:serviceParam wikibase:endpoint "commons.wikimedia.org" . bd:serviceParam mwapi:gcmtitle "Category:Flora_Batava_-KB_copy,_Volume_2,_1807" . bd:serviceParam mwapi:generator "categorymembers" . bd:serviceParam mwapi:gcmlimit "500" . bd:serviceParam mwapi:prop "imageinfo". bd:serviceParam mwapi:iiprop "url". ?Title wikibase:apiOutput mwapi:title . ?pageid wikibase:apiOutput "@pageid" . ?ns wikibase:apiOutput "@ns". ?FullimageUrl1 wikibase:apiOutputURI "imageinfo/ii/@url". } FILTER (?ns = "6") #Files only } } AS %get_files WHERE { INCLUDE %get_files BIND(CONCAT('M', ?pageid) AS ?MediaID)
BIND(REPLACE(?Title, " ", "
", "i") AS ?p)
BIND(URI(CONCAT("https://commons.wikimedia.org/w/index.php?title=Special:Redirect/file&wpvalue=", ?p)) AS ?FullimageUrl2)
BIND(URI(CONCAT('https://commons.wikimedia.org/wiki/', ?p)) AS ?PageUrl). BIND(URI(CONCAT('https://commons.wikimedia.org/w/index.php?curid=', ?pageid)) AS ?PageShortUrl1) BIND(URI(CONCAT('https://commons.wikimedia.org/entity/', ?MediaID)) AS ?PageShortUrl2) } ORDER BY ?MediaID #approx the same order as the plate numbers

Use at

PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX bd: <http://www.bigdata.com/rdf#>
# For File:Agrostis Spica venti (modern=Apera spica-venti) - Pl0151 - FloraBatava-KB-v02.jpg
# - MediaID = M132800954 (see [https://commons.wikimedia.org/w/index.php?title=File:Agrostis_Spica_venti_(modern%3DApera_spica-venti)_-_Pl0151_-_FloraBatava-KB-v02.jpg&action=info this page])
# - Title (as string)= File:Agrostis Spica venti (modern=Apera spica-venti) - Pl0151 - FloraBatava-KB-v02.jpg
# - FullimageUrl1 = https://upload.wikimedia.org/wikipedia/commons/e/e8/Agrostis_Spica_venti_%28modern%3DApera_spica-venti%29_-_Pl0151_-_FloraBatava-KB-v02.jpg 
# - FullimageUrl2, via Special:Redirect = https://commons.wikimedia.org/w/index.php?title=Special:Redirect/file&wpvalue=File:Agrostis_Spica_venti_(modern%3DApera_spica-venti)_-_Pl0151_-_FloraBatava-KB-v02.jpg
# - PageUrl = https://commons.wikimedia.org/wiki/File:Agrostis_Spica_venti_(modern%3DApera_spica-venti)_-_Pl0151_-_FloraBatava-KB-v02.jpg
# - PageShortUrl = https://commons.wikimedia.org/w/index.php?curid=132800954
# - PageShortUrl2, via the concept URI = https://commons.wikimedia.org/entity/M132800954
#
# See for help https://www.mediawiki.org/wiki/Wikidata_Query_Service/User_Manual/MWAPI

SELECT ?MediaID ?Title ?FullimageUrl1 ?FullimageUrl2 ?PageUrl ?PageShortUrl1 ?PageShortUrl2
WHERE
{

{
  SELECT ?Title ?pageid  ?FullimageUrl1 
  WHERE
{
  SERVICE wikibase:mwapi
  {
    bd:serviceParam wikibase:api "Generator" .
    bd:serviceParam wikibase:endpoint "commons.wikimedia.org" .
    bd:serviceParam mwapi:gcmtitle "Category:Flora_Batava_-_KB_copy,_Volume_2,_1807" .
    bd:serviceParam mwapi:generator "categorymembers" .
    bd:serviceParam mwapi:gcmlimit "500" .
    bd:serviceParam mwapi:prop "imageinfo".
    bd:serviceParam mwapi:iiprop "url".
    ?Title wikibase:apiOutput mwapi:title .
    ?pageid wikibase:apiOutput "@pageid" .
    ?ns wikibase:apiOutput "@ns".
    ?FullimageUrl1 wikibase:apiOutputURI "imageinfo/ii/@url".
  }
  FILTER (?ns = "6")  #Files only
  }
}  BIND(CONCAT('M', ?pageid) AS ?MediaID)    
  BIND(REPLACE(?Title, " ", "_", "i") AS ?p)      
  BIND(URI(CONCAT("https://commons.wikimedia.org/w/index.php?title=Special:Redirect/file&wpvalue=", ?p)) AS ?FullimageUrl2)      
  BIND(URI(CONCAT('https://commons.wikimedia.org/wiki/', ?p)) AS ?PageUrl). 
  BIND(URI(CONCAT('https://commons.wikimedia.org/w/index.php?curid=', ?pageid)) AS ?PageShortUrl1)
  BIND(URI(CONCAT('https://commons.wikimedia.org/entity/', ?MediaID)) AS ?PageShortUrl2)
} 
ORDER BY ?MediaID #approx the same order as the plate numbers

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?FullimageUrl1"):::projected v7("?FullimageUrl2"):::projected v6("?MediaID"):::projected v9("?PageShortUrl1"):::projected v10("?PageShortUrl2"):::projected v8("?PageUrl"):::projected v3("?Title"):::projected v2("?ns") v6("?p") v4("?pageid") c21(["@ns"]):::literal c23(["imageinfo/ii/@url"]):::literal c17(["url"]):::literal c9(["Category:Flora_Batava_-_KB_copy,_Volume_2,_1807"]):::literal c11(["categorymembers"]):::literal c3(["bd:serviceParam"]):::iri c13(["500"]):::literal c15(["imageinfo"]):::literal c19(["mwapi:title"]):::iri c7(["commons.wikimedia.org"]):::literal c20(["@pageid"]):::literal c5(["Generator"]):::literal f0[["?ns = '6'"]] f0 --> v2 subgraph s1["http://wikiba.se/ontology#mwapi"] style s1 stroke-width:4px; c3 --"mwapi:api"--> c5 c3 --"mwapi:endpoint"--> c7 c3 --"mwapi:gcmtitle"--> c9 c3 --"mwapi:generator"--> c11 c3 --"mwapi:gcmlimit"--> c13 c3 --"mwapi:prop"--> c15 c3 --"mwapi:iiprop"--> c17 v3 --"mwapi:apiOutput"--> c19 v4 --"mwapi:apiOutput"--> c20 v2 --"mwapi:apiOutput"--> c21 v5 --"mwapi:apiOutputURI"--> c23 end bind1[/"concat('M',?pageid)"/] v4 --o bind1 bind1 --as--o v6 bind2[/"replace(?Title,' ','_','i')"/] v3 --o bind2 bind2 --as--o v6 bind3[/"concat('https://commons.wikimedia.org/w/index.php?title=Special:Redirect/file&wpvalue=',?p)"/] v6 --o bind3 bind3 --as--o v7 bind4[/"concat('https://commons.wikimedia.org/wiki/',?p)"/] v6 --o bind4 bind4 --as--o v8 bind5[/"concat('https://commons.wikimedia.org/w/index.php?curid=',?pageid)"/] v4 --o bind5 bind5 --as--o v9 bind6[/"concat('https://commons.wikimedia.org/entity/',?MediaID)"/] v6 --o bind6 bind6 --as--o v10