.. _section-Query Results Table: Query Results Table ~~~~~~~~~~~~~~~~~~~ After executing a query, the query results are presented in the **Query Results** window. In this window, the number of results returned for the query, the time it took to execute the query, and the overall query execution status are included, as shown in :numref:`figure-QueryResults-ui.png`. .. _figure-QueryResults-ui.png: .. figure:: ../../figs/QueryResults-ui.png :alt: **Query Results** window for ’What are all the grandparent/grandson pairs?’ **Query Results** window for ’What are all the grandparent/grandson pairs?’ Results in the **Query Results** window are by default presented in a table format. Each row in the table represents a result found. Each column within a row contains the returned value of the column variable for that row. :numref:`figure-QueryResults-grandparent-grandson-default.png` shows query results displayed in this default view for the query **What are all the grandparent/grandson pairs?** .. _figure-QueryResults-grandparent-grandson-default.png: .. figure:: ../../figs/QueryResults-grandparent-grandson-default.png :alt: **Query Results** window default view for ’What are all the grandparent/grandson pairs?’ **Query Results** window default view for ’What are all the grandparent/grandson pairs?’ Also by default, results are sorted in ascending order by the first column of the table. In the case of **What are all the grandparent/grandson pairs?**, the results are sorted in ascending alphabetical order of the variable **?Grandparent**, as seen in :numref:`figure-QueryResults-grandparent-grandson-default.png`. To sort the results by another column variable, click the corresponding column header. For example, click the column header **?Grandson**, and the results will be presented in ascending alphabetical order of the variable **?Grandson**, as illustrated in :numref:`figure-QueryResults-Table-sorted-by-grandson.png`. .. _figure-QueryResults-Table-sorted-by-grandson.png: .. figure:: ../../figs/QueryResults-Table-sorted-by-grandson.png :alt: Results for ’What are all the grandparent/grandson pairs?’ are sorted by column variable **?Grandson** in ascending order Results for ’What are all the grandparent/grandson pairs?’ are sorted by column variable **?Grandson** in ascending order Click a column variable a second time reverses the sort order by that column variable. For example, click the column header **?Grandson** again, the results will be sorted in descending alphabetical order by **?Grandson**, as shown in :numref:`figure-QueryResults-Table-sorted-by-grandson.png`. .. _figure-QueryResults-Table-sorted-by-grandson-reverse.png: .. figure:: ../../figs/QueryResults-Table-sorted-by-grandson-reverse.png :alt: Results for ’What are all the grandparent/grandson pairs?’ are sorted by column variable **?Grandson** in descending order Results for ’What are all the grandparent/grandson pairs?’ are sorted by column variable **?Grandson** in descending order Each row in the results table is accompanied by a **?** button. This button, when clicked, provides an explanation for the result in the corresponding row. For example, click the **?** button to the right of the result row **Florian** as grandparent and **Peter** as grandson, as shown in :numref:`figure-QueryResults-Florian-Peter.png`. .. _figure-QueryResults-Florian-Peter.png: .. figure:: ../../figs/QueryResults-Florian-Peter.png :alt: Click **?** to the right of the result row **Florian** as grandparent and **Peter** as grandson Click **?** to the right of the result row **Florian** as grandparent and **Peter** as grandson A new tab is created to explain the result. Click this new tab to see the explanation tree. Expand the tree to see all the rules and facts used to derive the result. The fully expanded explanation tree for the result **Florian** as grandparent and **Peter** as grandson is shown in :numref:`figure-QueryResults-Florian-Peter-explained.png`. .. _figure-QueryResults-Florian-Peter-explained.png: .. figure:: ../../figs/QueryResults-Florian-Peter-explained.png :alt: Result explanation for **Florian** as grandparent and **Peter** as grandson Result explanation for **Florian** as grandparent and **Peter** as grandson