[CWB] CQi / cqpserver questions

Stefan Evert stefanML at collocations.de
Mon Mar 18 13:21:12 CET 2013


> I want to set up a CQI server for a corpus of ours. I have found that cqpserver coming
> with cwpweb can do this for me.
> 
> I have found the "CQPserver quick installation notes" telling me how to write an init file
> for cqpserver. This document tells me to run cqpserver in a terminal window which is OK for
> testing but not for production. I will need a CQI server started as a linux service running all the
> time in the background. How can I achieve this?

With the usual Linux tools for setting up system services. I'm afraid I am not a Linux sysadmin, so I can't help you with this.  All the service has to do is start cqpserver once in its standard mode -- it will keep accepting clients on the specified port and fork a new process for each connection. To stop the service, you'll have to send a kill signal to the process.

> I went on testing by doing
> 
> telnet localhost 4877
> 
> to connect with the CQI server, but all tries failed with the rather boring error message from the cqpserver:
> "Connection refused".

Perhaps you've misunderstood what the CQi protocol is.  It's not a Web service or a telnet CQP session, but a custom binary protocol.  In order to access CQPserver, You'll have to use a suitable client library for your programming language of choice.

So far, there's the reference implementation for Perl, which you can find in the CWB::CQI package (see http://cwb.sourceforge.net/download.php). There is also a Java implementation as part of the TXM project: https://sourceforge.net/projects/txm

I seem to recall that somebody was working on a Python client, but I'm not sure whether it is available (yet).

> Is the CQi protocol documented somewhere?

Unfortunately, there isn't a complete documentation of the protocol available yet, though you should be able to guess most of it from the partial specs and tutorial available from http://cwb.sourceforge.net/cqi.php

> Are there better testing methods that the CQi server is doing what is should do?

Easiest thing to do is to install the CWB::CQI package and run its test scripts as well as two example programs included in the package.

If you're still having problems, try running cqpserver with debugging activated (ServerLog, ServerDebug and in extreme cases Snoop).  This will show you exactly what is passed between the client and server.

Hope this helps,
Stefan


More information about the CWB mailing list