Skip to content

Detailed flow of a query

dej611 edited this page May 26, 2013 · 6 revisions

Detailed Flow of a Query:

  1. Keyword Search on LingsProperty
  2. Find Selected Lings, Properties, LingsProperty (ANY)
  3. Filters
  4. LingsProperty by Ling Depth
  5. LingsProperty by Ling Parent ID
  6. Showing Criteria
  7. Keyword Search on Example
  8. Group By (ALL)
  9. Link LingsPropVal with Lings and Props
  10. Advanced Features

Check for invalid combinations, e.g. all on some selector box and Example clicked. That is invalid.

Keyword Search on LingsProperty

Fold any keyword searches on lingpropval into their appropriate selector box, e.g. a keyword search on word initial "G" for ling name will be a selection on Greek and German among others (if lings are languages).
This will be intersected with any other selections in that selector box to give a net set of selections.


Find Selected Lings, Properties, LingsProperty (ANY)

Perform disjunctions ("any") from selection boxes. (If there are conjunctions ("all") treat these as disjunctions ("any") for the purposes of this step. This saves work for later.)


Filters

Each such disjunction gives a set of LingPropVal rows. They may be at different depths, e.g. sentence-property-value, speaker-property-value. So we need to tie these together.

LingsProperty by Ling Depth

First intersect rows having lingids at the same depth. This gives a set of LingPropVal rows at each depth.

LingsProperty by Ling Parent ID

Tie together the rows at different depths based on Ling.parentid. This can give a join result having more than three columns.
In the result, a row concerning a sentence survives only if the speaker of that sentence survives the demographic query and a row concerning a speaker survives only if a sentence survives the linguistic query.


Showing Criteria

Keyword Search on Example (if showing examples)

If examples are clicked, then join with the results of the LingPropVal queries based on LingPropValID and filter further based on keyword searches on example attributes.

Group By (ALL)

If all is clicked for at least one selection box, then perform a group by on the fields of the ShowClickboxes.
Call those fields the ShowFields. This group by is unusual in that there are no aggregates. Instead, for each distinct value of the ShowFields (i.e. each distinct combination of values), we associate a vector of values for each field F on which there is an all.
So, for each such distinct value combination c, we have a vector v of F values.
We check whether the selected F values in the selector box is a subset of v.
If so, then c passes into the solution. Otherwise, it doesn't.


Link LingsPropVal with Lings and Props

Link up with attributes table based on lingid and possibly exampleid as appropriate. Order by language-property.


Advanced Features

Advanced Features are mutually exclusive and can all be handled as a postprocessing step. List of Advanced Features:

  1. Cross Search
  2. Compare Search
  3. Similarity tree
  4. Universal Implication