query-7063e0cac9ca61ff8430399843b2ad0c

rq turtle/ttl

List of all non-plate, non-text pages in Category:Flora Batava - KB copy, and its subcategories SELECT ?category ?categoryName ?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 (URI(CONCAT('https://commons.wikimedia.org/entity/M', ?pageid2)) AS ?file) FILTER(!REGEX(?title,"(Pl[0-9]{4} - FloraBatava-KB-v[0-9]{2}.jpg)$")) FILTER(!REGEX(?title,"(DescriptionFR[0-9]+ - FloraBatava-KB-v[0-9]{2}.jpg)$")) FILTER(!REGEX(?title,"(DescriptionNL[0-9]+ - FloraBatava-KB-v[0-9]{2}.jpg)$")) } ORDER BY ?category ?title

Use at

PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX bd: <http://www.bigdata.com/rdf#>
# List of all non-plate, non-text pages in Category:Flora Batava - KB copy, and its subcategories
SELECT ?category ?categoryName ?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 (URI(CONCAT('https://commons.wikimedia.org/entity/M', ?pageid2)) AS ?file)
  FILTER(!REGEX(?title,"(Pl[0-9]{4} - FloraBatava-KB-v[0-9]{2}.jpg)$")) 
  FILTER(!REGEX(?title,"(DescriptionFR[0-9]+ - FloraBatava-KB-v[0-9]{2}.jpg)$")) 
  FILTER(!REGEX(?title,"(DescriptionNL[0-9]+ - FloraBatava-KB-v[0-9]{2}.jpg)$")) 
} ORDER BY ?category ?title

Query found at

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