[CWB] CQL Visualization Script

Maarten Janssen maartenpt at gmail.com
Sat Sep 8 12:16:20 CEST 2018


For easy of use, I wrote a JS script that can take a CQL query (yes I know you object to that name, but it is what everybody uses), and create a DIV with boxes representing the query in  a (hopefully)  ore easy to read fashion. It comes together with a query builder that helps to build a CQL query - this is done in TEITOK, so the QB can use much more data than you would have based merely on the registry file (I could make a public version where you can paste a registry file and it will create a QB from that if there is any interest in such a tool). You can see it in action for instance in the Postscriptum corpus (it is very recent addition, there might still be issues with it):

	http://ps.clul.ul.pt/index.php?action=cqp

For the queries built with the QB, the visualization works quite nicely. But the visualizer also works with CQL queries typed in manually - and of course, CQL is much richer than what the QB can generate. So there are quite a few parts of CQL that the visualizer does not handle. Now visualizing very complex queries (including groupings of tokens and such) is probably not very useful to start with since anyone writing those is likely to be much more at ease just reading the CQL than with any visualization mode. But the visualizer also gives a warning that there is something wrong with the query - which will hence sometimes be an error of the tool and not of the CQL. 

I know there are a lot of CQL tools out there - not only including the various CWB based web interfaces (Korp, Bwananet, etc.), but also most other corpus engines (NoSKE, Corpuscle, and TEITOK’s own TT-CQP) use CQL or something close to it. So before delving into all the nasty little bits of CQL - does anyone know of a JS-based Query builder, visualisation mode, or at least CQL parser out there? Or a parser in a more readable format than the C-version inside the CWB source codes?


More information about the CWB mailing list