query-de0f2c6b4ce084e39b1b8d5cdc2661f5

rq turtle/ttl

List of all text pages in Dutch in Category:Flora Batava - KB copy, and its subcategories SELECT ?category ?categoryName ?plate ?file ?title 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" . bd:serviceParam mwapi:generator "categorymembers" . bd:serviceParam mwapi:gcmlimit "max" . ?categoryName wikibase:apiOutput mwapi:title . ?pageid wikibase:apiOutput "@pageid" . ?ns wikibase:apiOutput "@ns". } FILTER (?ns = "14") # (sub)categories only BIND (URI(CONCAT('https://commons.wikimedia.org/entity/M', ?pageid)) AS ?category)

SERVICE wikibase:mwapi { bd:serviceParam wikibase:api "Generator" . bd:serviceParam wikibase:endpoint "commons.wikimedia.org" . bd:serviceParam mwapi:gcmtitle ?categoryName. bd:serviceParam mwapi:generator "categorymembers" . bd:serviceParam mwapi:gcmtype "file" . bd:serviceParam mwapi:gcmlimit "max" . ?title wikibase:apiOutput mwapi:title . ?pageid2 wikibase:apiOutput "@pageid" . } BIND(STRBEFORE(STRAFTER(?title," - Pl")," - DescriptionNL") AS ?plate) BIND (URI(CONCAT('https://commons.wikimedia.org/entity/M', ?pageid2)) AS ?file) FILTER(REGEX(?title,"(DescriptionNL[0-9]+ - FloraBatava-KB-v[0-9]{2}.jpg)$")) } ORDER BY ?category ?plate

Use at

PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX bd: <http://www.bigdata.com/rdf#>
# List of all text pages in Dutch in Category:Flora Batava - KB copy, and its subcategories
SELECT ?category ?categoryName ?plate ?file ?title
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" .
    bd:serviceParam mwapi:generator "categorymembers" .
    bd:serviceParam mwapi:gcmlimit "max" .
    ?categoryName wikibase:apiOutput mwapi:title .
    ?pageid wikibase:apiOutput "@pageid" .
    ?ns wikibase:apiOutput "@ns".
  }
  FILTER (?ns = "14") # (sub)categories only
  BIND (URI(CONCAT('https://commons.wikimedia.org/entity/M', ?pageid)) AS ?category)

  SERVICE wikibase:mwapi
  {
    bd:serviceParam wikibase:api "Generator" .
    bd:serviceParam wikibase:endpoint "commons.wikimedia.org" .
    bd:serviceParam mwapi:gcmtitle ?categoryName.
    bd:serviceParam mwapi:generator "categorymembers" .
    bd:serviceParam mwapi:gcmtype "file" .
    bd:serviceParam mwapi:gcmlimit "max" .
    ?title wikibase:apiOutput mwapi:title .
    ?pageid2 wikibase:apiOutput "@pageid" .
  }
  BIND(STRBEFORE(STRAFTER(?title," - Pl")," - DescriptionNL") AS ?plate)
  BIND (URI(CONCAT('https://commons.wikimedia.org/entity/M', ?pageid2)) AS ?file)
  FILTER(REGEX(?title,"(DescriptionNL[0-9]+ - FloraBatava-KB-v[0-9]{2}.jpg)$")) 
} ORDER BY ?category ?plate

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?category"):::projected v5("?categoryName"):::projected v8("?file"):::projected v4("?ns") v6("?pageid") v7("?pageid2") v8("?plate"):::projected v3("?title"):::projected c14(["max"]):::literal c18(["@ns"]):::literal c10(["Category:Flora Batava - KB copy"]):::literal c12(["categorymembers"]):::literal c4(["bd:serviceParam"]):::iri c20(["file"]):::literal c16(["mwapi:title"]):::iri c8(["commons.wikimedia.org"]):::literal c17(["@pageid"]):::literal c6(["Generator"]):::literal f0[["regex(?title,'(DescriptionNL#91;0-9#93;+ - FloraBatava-KB-v#91;0-9#93;{2}.jpg)$')"]] f0 --> v3 f1[["?ns = '14'"]] f1 --> v4 subgraph s1["http://wikiba.se/ontology#mwapi"] style s1 stroke-width:4px; c4 --"mwapi:api"--> c6 c4 --"mwapi:endpoint"--> c8 c4 --"mwapi:gcmtitle"--> c10 c4 --"mwapi:generator"--> c12 c4 --"mwapi:gcmlimit"--> c14 v5 --"mwapi:apiOutput"--> c16 v6 --"mwapi:apiOutput"--> c17 v4 --"mwapi:apiOutput"--> c18 end bind2[/"concat('https://commons.wikimedia.org/entity/M',?pageid)"/] v6 --o bind2 bind2 --as--o v7 subgraph s1["http://wikiba.se/ontology#mwapi"] style s1 stroke-width:4px; c4 --"mwapi:api"--> c6 c4 --"mwapi:endpoint"--> c8 c4 --"mwapi:gcmtitle"--> v5 c4 --"mwapi:generator"--> c12 c4 --"mwapi:gcmtype"--> c20 c4 --"mwapi:gcmlimit"--> c14 v3 --"mwapi:apiOutput"--> c16 v7 --"mwapi:apiOutput"--> c17 end bind3[/"substring-before(substring-after(?title,' - Pl'),' - DescriptionNL')"/] v3 --o bind3 bind3 --as--o v8 bind4[/"concat('https://commons.wikimedia.org/entity/M',?pageid2)"/] v7 --o bind4 bind4 --as--o v8