.. _section-Query Results Explanation: Query Results Explanation ~~~~~~~~~~~~~~~~~~~~~~~~~ Execute query 'What are all the grandparent/grandson pairs?'. In the **Queries Results** window, click **?** in the row with **Aaron** as **?Grandparent** and **Darryn** as **?Grandson** to see an explanation for this result. As seen in :numref:`figure-QueryResults-explanation-tree.png`, an explanation shows up in a new tab in the **Query Results** window. By default, it is presented in a tree format. Expand the explanation tree to see each reasoning step along with the rules and instances used. .. _figure-QueryResults-explanation-tree.png: .. figure:: ../../figs/QueryResults-explanation-tree.png :alt: Explanation in a **Tree** for query result **Aaron** and **Darryn** Explanation in a **Tree** for query result **Aaron** and **Darryn** Two other views of an explanation are available: **Graph** and **English**. **Graph** presents the explanation in a connected graph, as shown in :numref:`figure-QueryResults-explanation-graph.png`, and **English** presents the explanation, to the extent possible, in everyday English, as shown in :numref:`figure-QueryResults-explanation-english.png`. .. _figure-QueryResults-explanation-graph.png: .. figure:: ../../figs/QueryResults-explanation-graph.png :alt: Explanation in a **Graph** for query result **Aaron** and **Darryn** Explanation in a **Graph** for query result **Aaron** and **Darryn** .. _figure-QueryResults-explanation-english.png: .. figure:: ../../figs/QueryResults-explanation-english.png :alt: Explanation in **English** for query result **Aaron** and **Darryn** Explanation in **English** for query result **Aaron** and **Darryn** Query result explanations can be shown in a more user-friendly language such as everyday English. See Section :ref:`section-NL` on how to use manual annotations to do this. Query Results Explanations with Notrace Option ---------------------------------------------- To exclude execution steps of a specific rule in the query results explanation, the notrace option can be used. For example, suppose we are not interested in seeing the steps of 'GrandSonRule' in the explanation, we can specify the notrace option in the rule. That is, edit 'GrandSonRule' to look like: .. code-block:: flora @!{GrandsonRule [notrace]} ?Person [grandson -> ?Grandson] :- ?Grandson : Man [grandparent -> ?Person]. Save family.flr and execute the query 'What are all the grandparent/grandson pairs?' again. This time in the **Query Results** window, click the **?** corresponding to the answer pair **Aaron** and **Darryn**, and you will see a one level deep explanation, with no sub steps included for the 'GrandSonRule', as seen in :numref:`figure-QueryResults-explanation-notrace.png`. .. _figure-QueryResults-explanation-notrace.png: .. figure:: ../../figs/QueryResults-explanation-notrace.png :alt: Explanation for query result **Aaron** and **Darryn** when **notrace** is used in GrandSonRule Explanation for query result **Aaron** and **Darryn** when **notrace** is used in GrandSonRule