query-c235494834691561edf0fe8e7290cac9

rq turtle/ttl

Pmt

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 DISTINCT ?item ?itemLabel
WHERE
{

{
  SELECT ?sitelink ?site
  WHERE
  {

{
  SELECT ?title ?site ?language_code
  WHERE
  {
    [] schema:about wd:Q9064755 ; # Category:Norwegian people of World War II (Q8788931)
       schema:isPartOf ?site ;
       schema:name ?category_title ;
       schema:inLanguage ?language_code .
    BIND (STRBEFORE(STRAFTER(STR(?site), "https://"), "/") AS ?endpoint)
    BIND (CONCAT('deepcat:"', STRAFTER(?category_title, ':'), '"') AS ?search_string)
    SERVICE wikibase:mwapi
    {
      bd:serviceParam wikibase:api "Search" .
      bd:serviceParam wikibase:endpoint ?endpoint .
      bd:serviceParam mwapi:srnamespace "0" .
      bd:serviceParam mwapi:srsearch ?search_string  .
      ?title wikibase:apiOutput mwapi:title .
    }
  }
}    BIND (STRLANG(?title, ?language_code) AS ?title_with_language)
    ?sitelink schema:name ?title_with_language .
  }
}  ?sitelink schema:about ?item ;
            schema:isPartOf ?site .
  ?item wdt:P27 wd:Q20 .
  ?item wdt:P106 wd:Q42973 .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . } 
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?category_title") v4("?endpoint") v9("?item"):::projected v3("?language_code") v5("?search_string") v1("?site") v8("?sitelink") v6("?title") v7("?title_with_language") a1((" ")) c2(["wd:Q9064755"]):::iri c17(["wd:Q20"]):::iri c19(["wd:Q42973"]):::iri c12(["0"]):::literal c7(["bd:serviceParam"]):::iri c9(["Search"]):::literal c22(["#91;AUTO_LANGUAGE#93;,en"]):::literal c15(["mwapi:title"]):::iri a1 --"schema:about"--> c2 a1 --"schema:isPartOf"--> v1 a1 --"schema:name"--> v2 a1 --"schema:inLanguage"--> v3 bind0[/"substring-before(substring-after(str(?site),'https://'),'/')"/] v1 --o bind0 bind0 --as--o v4 bind1[/"concat('deepcat:"',substring-after(?category_title,':'),'"')"/] v2 --o bind1 bind1 --as--o v5 subgraph s1["http://wikiba.se/ontology#mwapi"] style s1 stroke-width:4px; c7 --"mwapi:api"--> c9 c7 --"mwapi:endpoint"--> v4 c7 --"mwapi:srnamespace"--> c12 c7 --"mwapi:srsearch"--> v5 v6 --"mwapi:apiOutput"--> c15 end bind2[/"STRLANG(?title,?language_code)"/] v6 --o bind2 v3 --o bind2 bind2 --as--o v7 v8 --"schema:name"--> v7 v8 --"schema:about"--> v9 v8 --"schema:isPartOf"--> v1 v9 --"wdt:P27"--> c17 v9 --"wdt:P106"--> c19 subgraph s2["http://wikiba.se/ontology#label"] style s2 stroke-width:4px; c7 --"mwapi:language"--> c22 end