query: SELECT ?item ?itemLabel ?type ?typeLabel WHERE {
    {
      SELECT ?item WHERE {
        hint:SubQuery hint:optimizer "None".
        BIND(wd:Q5638917 AS ?template)
        ?templateArticle schema:isPartOf ?wikiProjectUrl;
                         schema:about ?template;
                         schema:name ?templateTitleWithNamespace.
        BIND(STRBEFORE(STRAFTER(?wikiProjectUrl, "https://"), "/") AS ?endpoint)
        BIND(STRAFTER(?templateTitleWithNamespace, ":") AS ?templateTitleWithoutNamespace)
        BIND(CONCAT("hastemplate:\"", ?templateTitleWithoutNamespace, "\"") AS ?gsrsearch)
        SERVICE wikibase:mwapi {
          bd:serviceParam wikibase:endpoint ?endpoint;
                          wikibase:api "Generator";
                          mwapi:generator "search";
                          mwapi:gsrsearch ?gsrsearch;
                          mwapi:gsrlimit "max".
          ?item wikibase:apiOutputItem mwapi:item.
        }
      }
      LIMIT 100
    }
    hint:Prior hint:runFirst "true".
    ?item wdt:P31|wdt:P279 ?type .
    SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
  }
  LIMIT 100