query-52c067a355374aeeca8e2fba9ed26849

rq turtle/ttl

Search in category SELECT DISTINCT ?item ?itemLabel (GROUP_CONCAT(?endpoint; SEPARATOR=", ") AS ?found_in) { ?cat schema:about wd:Q8882780. ?cat schema:isPartOf ?wikimedia_site. ?cat schema:name ?category_title. BIND (STRBEFORE(STRAFTER(STR(?wikimedia_site), "https://"), "/") AS ?endpoint) OPTIONAL { SERVICE wikibase:mwapi { bd:serviceParam wikibase:endpoint ?endpoint. bd:serviceParam wikibase:api "Generator". bd:serviceParam mwapi:generator "categorymembers". bd:serviceParam mwapi:gcmtitle ?category_title. bd:serviceParam mwapi:gcmlimit "max". ?item wikibase:apiOutputItem mwapi:item. ?title wikibase:apiOutput mwapi:title. } } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],it". } } GROUP BY ?item ?itemLabel

Use at

PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Search in category
SELECT DISTINCT ?item ?itemLabel (GROUP_CONCAT(?endpoint; SEPARATOR=", ") AS ?found_in)
{
  ?cat schema:about wd:Q8882780.
  ?cat schema:isPartOf ?wikimedia_site.
  ?cat schema:name ?category_title.
  BIND (STRBEFORE(STRAFTER(STR(?wikimedia_site), "https://"), "/") AS ?endpoint)
  OPTIONAL
  {
    SERVICE wikibase:mwapi
    {
      bd:serviceParam wikibase:endpoint ?endpoint.
      bd:serviceParam wikibase:api "Generator".
      bd:serviceParam mwapi:generator "categorymembers".
      bd:serviceParam mwapi:gcmtitle ?category_title.
      bd:serviceParam mwapi:gcmlimit "max".
      ?item wikibase:apiOutputItem mwapi:item.
      ?title wikibase:apiOutput mwapi:title.
    }
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],it". }
}
GROUP BY ?item ?itemLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?cat") v3("?category_title") v4("?endpoint"):::projected v7("?found_in") v5("?item"):::projected v6("?title") v2("?wikimedia_site") c2(["wd:Q8882780"]):::iri c16(["mwapi:item"]):::iri c14(["max"]):::literal c11(["categorymembers"]):::literal c6(["bd:serviceParam"]):::iri c21(["#91;AUTO_LANGUAGE#93;,it"]):::literal c18(["mwapi:title"]):::iri c9(["Generator"]):::literal v1 --"schema:about"--> c2 v1 --"schema:isPartOf"--> v2 v1 --"schema:name"--> v3 bind0[/"substring-before(substring-after(str(?wikimedia_site),'https://'),'/')"/] v2 --o bind0 bind0 --as--o v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; subgraph s1["http://wikiba.se/ontology#mwapi"] style s1 stroke-width:4px; c6 -."mwapi:endpoint".-> v4 c6 --"mwapi:api"--> c9 c6 --"mwapi:generator"--> c11 c6 --"mwapi:gcmtitle"--> v3 c6 --"mwapi:gcmlimit"--> c14 v5 --"mwapi:apiOutputItem"--> c16 v6 --"mwapi:apiOutput"--> c18 end end subgraph s2["http://wikiba.se/ontology#label"] style s2 stroke-width:4px; c6 --"mwapi:language"--> c21 end bind2[/"?endpoint"/] v4 --o bind2 bind2 --as--o v7