[CWB] CQPweb Collocations SQL error (CQPweb 3.2.42)

Thilo Wiertz thilo.wiertz at geographie.uni-freiburg.de
Fri Dec 18 08:49:52 CET 2020


Indeed, the server could not run R. After reinstalling the R packages it works. Thanks a lot for the hint!

Thilo

> Am 18.12.2020 um 00:53 schrieb Hardie, Andrew <a.hardie at lancaster.ac.uk>:
> 
> This arises from an error calculating the LL that corresponds to a given alpha. Thus, a null value is embedded into the SQL query after “having LogLikelihood >=  ”.
>  
> I‘m not sure what that error is; it could be with your R installation.
>  
> There may be a PHP warning (or several) in your http server error log that could shed light on the nature of the problem ; if you can dig up any such warnings, I can probably give a closer diagnosis.
>  
> best
>  
> Andrew.
>  
> From: cwb-bounces at sslmit.unibo.it <cwb-bounces at sslmit.unibo.it> On Behalf Of Thilo Wiertz
> Sent: 17 December 2020 20:44
> To: cwb at sslmit.unibo.it
> Subject: [CWB] CQPweb Collocations SQL error (CQPweb 3.2.42)
>  
> Dear Andrew, 
>  
> I encounter an error trying to create collocations on CQPweb 3.2.42. I haven’t used our CQPweb install in a while and it is possible that the server environment (Mariadb version?) has changed. But this segment of the SQL statement also looks suspicious to me: "having LogLikelihood >=  and observed >= 5“ (missing value after LogLikelihood?). 
>  
> Thanks so much for your help!
> Thilo
>  
> CQPweb encountered an error and could not continue.
> An SQL query did not run successfully!
> 
> Original query: select `db_colloc_glri2o63ehp`.`word`, count(`db_colloc_glri2o63ehp`.`word`) as observed, (22122 * (freq_corpus_tagesschau_word.freq) / 12754596) as expected, log2( (1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) / 22122) / (IF(((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) > 0, ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)), 0.5) / 12732474) ) as significance , sign(1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) - (22122 * (freq_corpus_tagesschau_word.freq) / 12754596)) * 2 * ( IF(1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) > 0, 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) * log(1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) / (22122 * (freq_corpus_tagesschau_word.freq) / 12754596)), 0) + IF((22122 - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) > 0, (22122 - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) * log((22122 - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) / (22122 * (12754596 - (freq_corpus_tagesschau_word.freq)) / 12754596)), 0) + IF(((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) > 0, ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) * log(((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) / (12732474 * (freq_corpus_tagesschau_word.freq) / 12754596)), 0) + IF((12732474 - ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`))) > 0, (12732474 - ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`))) * log((12732474 - ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`))) / (12732474 * (12754596 - (freq_corpus_tagesschau_word.freq)) / 12754596)), 0) ) as LogLikelihood, freq_corpus_tagesschau_word.freq, count(distinct(text_id)) as text_id_count from db_colloc_glri2o63ehp, freq_corpus_tagesschau_word where `db_colloc_glri2o63ehp`.`word` = freq_corpus_tagesschau_word.`item` and dist between -3 and 3 and freq_corpus_tagesschau_word.`freq` >= 5 group by `db_colloc_glri2o63ehp`.`word` having LogLikelihood >= and observed >= 5 order by significance desc LIMIT 0, 50 /* from User: thilo | Function: require() | 2020-Dec-17 21:35 */
> 
> Error # 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and observed >= 5 order by significance desc LIMIT 0, 50 /* from Use' at line 16
> 
> PHP debugging backtrace
> array(4) {
>   [1]=>
>   array(4) {
>     ["file"]=>
>     string(43) "/var/www/html/diskurs/lib/exiterror-lib.php"
>     ["line"]=>
>     int(367)
>     ["function"]=>
>     string(9) "exiterror"
>     ["args"]=>
>     array(3) {
>       [0]=>
>       array(3) {
>         [0]=>
>         string(38) "An SQL query did not run successfully!"
>         [1]=>
>         string(2291) "Original query: 
>  
> select `db_colloc_glri2o63ehp`.`word`, count(`db_colloc_glri2o63ehp`.`word`) as observed, (22122 * (freq_corpus_tagesschau_word.freq) / 12754596) as expected,
>                        log2( (1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) / 22122) / (IF(((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) > 0, ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)), 0.5) / 12732474) ) as significance ,
>                        sign(1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) - (22122 * (freq_corpus_tagesschau_word.freq) / 12754596)) * 2 * (
>                                IF(1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) > 0, 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) * log(1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) / (22122 * (freq_corpus_tagesschau_word.freq) / 12754596)), 0) +
>                                IF((22122 - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) > 0, (22122 - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) * log((22122 - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) / (22122 * (12754596 - (freq_corpus_tagesschau_word.freq)) / 12754596)), 0) +
>                                IF(((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) > 0, ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) * log(((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) / (12732474 * (freq_corpus_tagesschau_word.freq) / 12754596)), 0) +
>                                IF((12732474 - ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`))) > 0, (12732474 - ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`))) * log((12732474 - ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`))) / (12732474 * (12754596 - (freq_corpus_tagesschau_word.freq)) / 12754596)), 0)
>                        ) as LogLikelihood,
>                        freq_corpus_tagesschau_word.freq, count(distinct(text_id)) as text_id_count
>                        from db_colloc_glri2o63ehp, freq_corpus_tagesschau_word
>                        where `db_colloc_glri2o63ehp`.`word` = freq_corpus_tagesschau_word.`item`
>                        and dist between -3 and 3
>                        
>                        and freq_corpus_tagesschau_word.`freq` >= 5
>                        group by `db_colloc_glri2o63ehp`.`word`
>                        having LogLikelihood >=  and observed >= 5
>                        order by significance desc
>                        LIMIT 0, 50
>                         
>         /* from User: thilo | Function: require() | 2020-Dec-17 21:35 */
>  
> "
>         [2]=>
>         string(242) "Error # 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and observed >= 5
>                        order by significance desc
>                        LIMIT 0, 50
>                         
>         /* from Use' at line 16 "
>       }
>       [1]=>
>       NULL
>       [2]=>
>       NULL
>     }
>   }
>   [2]=>
>   array(4) {
>     ["file"]=>
>     string(37) "/var/www/html/diskurs/lib/sql-lib.php"
>     ["line"]=>
>     int(216)
>     ["function"]=>
>     string(18) "exiterror_sqlquery"
>     ["args"]=>
>     array(3) {
>       [0]=>
>       int(1064)
>       [1]=>
>       string(227) "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and observed >= 5
>                        order by significance desc
>                        LIMIT 0, 50
>                         
>         /* from Use' at line 16"
>       [2]=>
>       string(2271) "select `db_colloc_glri2o63ehp`.`word`, count(`db_colloc_glri2o63ehp`.`word`) as observed, (22122 * (freq_corpus_tagesschau_word.freq) / 12754596) as expected,
>                        log2( (1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) / 22122) / (IF(((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) > 0, ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)), 0.5) / 12732474) ) as significance ,
>                        sign(1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) - (22122 * (freq_corpus_tagesschau_word.freq) / 12754596)) * 2 * (
>                                IF(1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) > 0, 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) * log(1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) / (22122 * (freq_corpus_tagesschau_word.freq) / 12754596)), 0) +
>                                IF((22122 - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) > 0, (22122 - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) * log((22122 - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) / (22122 * (12754596 - (freq_corpus_tagesschau_word.freq)) / 12754596)), 0) +
>                                IF(((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) > 0, ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) * log(((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) / (12732474 * (freq_corpus_tagesschau_word.freq) / 12754596)), 0) +
>                                IF((12732474 - ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`))) > 0, (12732474 - ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`))) * log((12732474 - ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`))) / (12732474 * (12754596 - (freq_corpus_tagesschau_word.freq)) / 12754596)), 0)
>                        ) as LogLikelihood,
>                        freq_corpus_tagesschau_word.freq, count(distinct(text_id)) as text_id_count
>                        from db_colloc_glri2o63ehp, freq_corpus_tagesschau_word
>                        where `db_colloc_glri2o63ehp`.`word` = freq_corpus_tagesschau_word.`item`
>                        and dist between -3 and 3
>                        
>                        and freq_corpus_tagesschau_word.`freq` >= 5
>                        group by `db_colloc_glri2o63ehp`.`word`
>                        having LogLikelihood >=  and observed >= 5
>                        order by significance desc
>                        LIMIT 0, 50
>                         
>         /* from User: thilo | Function: require() | 2020-Dec-17 21:35 */"
>     }
>   }
>   [3]=>
>   array(4) {
>     ["file"]=>
>     string(44) "/var/www/html/diskurs/lib/collocation-ui.php"
>     ["line"]=>
>     int(512)
>     ["function"]=>
>     string(12) "do_sql_query"
>     ["args"]=>
>     array(1) {
>       [0]=>
>       string(2271) "select `db_colloc_glri2o63ehp`.`word`, count(`db_colloc_glri2o63ehp`.`word`) as observed, (22122 * (freq_corpus_tagesschau_word.freq) / 12754596) as expected,
>                        log2( (1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) / 22122) / (IF(((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) > 0, ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)), 0.5) / 12732474) ) as significance ,
>                        sign(1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) - (22122 * (freq_corpus_tagesschau_word.freq) / 12754596)) * 2 * (
>                                IF(1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) > 0, 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) * log(1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`) / (22122 * (freq_corpus_tagesschau_word.freq) / 12754596)), 0) +
>                                IF((22122 - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) > 0, (22122 - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) * log((22122 - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) / (22122 * (12754596 - (freq_corpus_tagesschau_word.freq)) / 12754596)), 0) +
>                                IF(((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) > 0, ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) * log(((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`)) / (12732474 * (freq_corpus_tagesschau_word.freq) / 12754596)), 0) +
>                                IF((12732474 - ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`))) > 0, (12732474 - ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`))) * log((12732474 - ((freq_corpus_tagesschau_word.freq) - 1e0 * COUNT(`db_colloc_glri2o63ehp`.`word`))) / (12732474 * (12754596 - (freq_corpus_tagesschau_word.freq)) / 12754596)), 0)
>                        ) as LogLikelihood,
>                        freq_corpus_tagesschau_word.freq, count(distinct(text_id)) as text_id_count
>                        from db_colloc_glri2o63ehp, freq_corpus_tagesschau_word
>                        where `db_colloc_glri2o63ehp`.`word` = freq_corpus_tagesschau_word.`item`
>                        and dist between -3 and 3
>                        
>                        and freq_corpus_tagesschau_word.`freq` >= 5
>                        group by `db_colloc_glri2o63ehp`.`word`
>                        having LogLikelihood >=  and observed >= 5
>                        order by significance desc
>                        LIMIT 0, 50
>                         
>         /* from User: thilo | Function: require() | 2020-Dec-17 21:35 */"
>     }
>   }
>   [4]=>
>   array(4) {
>     ["file"]=>
>     string(41) "/var/www/html/diskurs/exe/collocation.php"
>     ["line"]=>
>     int(1)
>     ["args"]=>
>     array(1) {
>       [0]=>
>       string(44) "/var/www/html/diskurs/lib/collocation-ui.php"
>     }
>     ["function"]=>
>     string(7) "require"
>   }
> }
> CQPweb v3.2.42 © 2008-2020
> Help! on CQPweb <https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdiskurs.geographie.uni-freiburg.de%2Ftagesschau%2Fhelp.php%3Fui%3Dhello&data=04%7C01%7Ca.hardie%40lancaster.ac.uk%7C067b6a0feb0d4b64878d08d8a2d038ea%7C9c9bcd11977a4e9ca9a0bc734090164a%7C0%7C0%7C637438362501705546%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=AB%2FBYTd5yf8G5LAagBwvBVnUM0Hy3DkN9eMdwwNFlSU%3D&reserved=0>	
> You are logged in as user [thilo]
>  
>  
>  
>  
>  
> _______________________________________________
> CWB mailing list
> CWB at sslmit.unibo.it <mailto:CWB at sslmit.unibo.it>
> http://liste.sslmit.unibo.it/mailman/listinfo/cwb <http://liste.sslmit.unibo.it/mailman/listinfo/cwb>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://liste.sslmit.unibo.it/pipermail/cwb/attachments/20201218/6e0b9722/attachment-0001.html>


More information about the CWB mailing list