query-65169493316f955b07961231fc89adc0

rq turtle/ttl

Results from multiple wikis, possibly in multiple languages?: (Q5638917)Template:Current , I was trying to get a Listeria list for items with sitelinks that have been tagged with the local version of Wikidata:WikiProject Humanitarian WikidataOver at

Use at

PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
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

Query found at