query-e74a5b25c59f3a065101302cf8cecf40

rq turtle/ttl

List words

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
#defaultView:BubbleChart
#Bubblechart and list of words in titles of articles about Zika. Limited to English titles, first 42 words, some words filtered.
#by Jura1, 7 March 2020

SELECT ?word (COUNT(DISTINCT ?title) as ?count)


WHERE
{

{    SELECT * { 
{  SELECT ?title (REPLACE(CONCAT(REPLACE(REPLACE(REPLACE(str(?title),'[\\.:,\\? %";\\]\\[]',""),"[\\(\\)–“—”]"," "),"’","'"), 
  " Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z")
  ,"[ ]{2,100}"," ") as ?input)
   {  [] wdt:P921 wd:Q202864 ; wdt:P1476 ?title . FILTER(lang(?title)="en") } #  LIMIT 100
} 
{    SELECT ?re ?nv { ?n wdt:P5176 []; wdt:P1181 ?nv . FILTER( ?nv < 43) 
     BIND( CONCAT( "^([^ ]+ ){", str( ?nv - 1 ),"}([^ ]+) .*") as ?re) }
} BIND( REPLACE(?input, ?re, "$2") as ?word) }
}    FILTER ( ?word != "Z" && ?word != "Zika" && ?word != "Corona" 
            && strlen(?word) > 3 
            && ?word != "pandemic" && ?word != "virus" && lcase(?word) != "infection" && ?word != "mortality"
           )               
}
GROUP BY ?word

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?count") v3("?input") v5("?n") v4("?nv") v6("?re") v2("?title"):::projected v7("?word"):::projected a1((" ")) a2((" ")) c11(["wd:Q202864"]):::iri f0[["?word != 'Z'?word != 'Zika'?word != 'Corona'string-length(?word) > '3^^xsd:integer'?word != 'pandemic'?word != 'virus'lower-case(?word) != 'infection'?word != 'mortality'"]] f0 --> v7 f1[["?title = 'en'"]] f1 --> v2 a1 --"wdt:P921"--> c11 a1 --"wdt:P1476"--> v2 bind2[/"replace(concat(replace(replace(replace(str(?title),'#91;\.:,\? %";\#93;\#91;#93;',''),'#91;\(\)–“—”#93;',' '),'’','''),' Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z'),'#91; #93;{2,100}',' ')"/] v2 --o bind2 bind2 --as--o v3 f3[["?nv < '43^^xsd:integer'"]] f3 --> v4 v5 --"wdt:P5176"--> a2 v5 --"wdt:P1181"--> v4 bind4[/"concat('^(#91;^ #93;+ ){',str(?nv - '1^^xsd:integer'),'}(#91;^ #93;+) .*')"/] v4 --o bind4 bind4 --as--o v6 bind5[/"replace(?input,?re,'$2')"/] v3 --o bind5 v6 --o bind5 bind5 --as--o v7 bind7[/"count(?title)"/] v2 --o bind7 bind7 --as--o v7