-
Notifications
You must be signed in to change notification settings - Fork 3
MQL Quickref
Full guide: MQL Query Guide
The general shape of a query is as follows (the line numbers are not part of the query)
1 select all objects
2 in {1-40}
3 where
4 [sentence
5 [phrase
6 [word sp=verb]
7 [word sp=subs]
8 ]
9 ..
10 [phrase
11 [word g_cons = 'H']
12 [word focus]
13 ]
14 ]
Here is the explanation, line by line.
- All queries start this way.
- Optionally restrict results to a subset of the text, in this case: words 1-40.
- This is also fixed.
- Look for a sentence ...
- with a phrase inside ...
- which contains a word having value
verb
for featuresp
wheresps
is part-of-speech, consult the feature documentation ... -
directly followed by a word having value
subs
for featuresp
wheresubs
= noun, see the feature documentation again ... - and no more constraints on this phrase ...
- followed by any material within the same sentence ...
- followed by an other phrase ...
- which contains a word having value
H
for featureg_cons
... -
directly followed by an other word,
and we say
focus
to require that this word will be highlighted in the results ... - and no more constraints for this phrase ...
- and no more constraints for this sentence.
It is easy to write down queries with very many results, more than you and the system can handle. A typical pattern to watch out for is this:
select all objects where
[word]
..
[word]
..
[word]
This query has over 10,000,000,000,000,000 results. You need a million 1 TB external disks to store them all. SHEBANQ cannot deliver this. Probably it is not what you want anyway. SHEBANQ will give up when you try this. Even so, it may cost several minutes for the system to do so.
The number of results can be reduced greatly by saying
select all objects where
[sentence
[word]
..
[word]
..
[word]
]
This query has roughly 1,000,000 results. A million results is perfectly doable for SHEBANQ.
Consult the Ulrik Petersen's MQL Query Guide for really understanding the details.