Hi, I want to know which could be the best approach for using CQP as backend. I have look the section 7 of the CQP Manual, the CQi Tutorial, the CQi Specification, the man of cqpserver and the code of cqpserver.c, and I still find this implementation confusing.
The intention is to have a Django platform to replace CQPweb. In the test that I have made, I managed to connect to cqpserver via socket, but when I attempt to initiate a connection with CQI_CTRL_CONNECT the connection hangs with the message “Connected. Waiting for CONNECT request.” I tried to send the user and the password after CQI_CTRL_CONNECT but I get the same result.
The tests was like this:
import socket
HOST = '0.0.0.0'
PORT = 4877
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((HOST, PORT))
s.sendall(bytes.fromhex("1101"))
s.sendall(b'user')
s.sendall(b'password')
data = s.recv(1024)
Finally, reviewing this platform, I found that in https://sourceforge.net/p/cwb/support-requests/2/ Stephanie Evert commented that “CQi has fallen back behind CWB development over the last years.”
With this information, what would be the best approach to accomplish this?
Thanks
Since you're working in Python, you should use the native API provided by cwb-ccc package. It is well-maintained and up to date, but doesn't support Windows platforms yet (help wanted!).
Thanks, I just tried and it works like a charm. Now, just for my acknowledge, what is the status of CQi?
Thanks again, we don't use windows, but little by little we are going to find a way to help with the project since our Django is gonna depend on that :)
We don't currently have plans to continue the development of CQi, though cqpserver and the Perl client are still fully functional. CQi doesn't wrap all relevant CQP functionality yet and has a few suboptimal design choices, and currently there doesn't seem to be much demand for a client-server API of this type. Direct APIs such as the ones available for Python, Perl and R are more efficient and convenient to use.
As a point of interest, the R API (RCppCWB) is modeled after CQi, but accesses the internal C functions directly.
Thanks, @schtepf, this information has been very helpful. I have more questions, but I will open a new ticket for that.