.. _section-Predicate Dependencies: Predicate Dependencies ~~~~~~~~~~~~~~~~~~~~~~ The **Predicate Dependencies** plugin displays dependency replationships in the KB. As shown in :numref:`figure-Predicate-source-menu.png`, there are 4 possible scopes for displaying this graph. Dependencies can be from the current file only, or from the current file plus imports with or without the core, or from the entire KB or import closure. .. _figure-Predicate-source-menu.png: .. figure:: ../../figs/Predicate-source-menu.png :alt: **Predicate Dependencies** source pull-down menu **Predicate Dependencies** source pull-down menu In addition, dependencies can also be restricted to defined only, or both defined and asserted, as seen in :numref:`figure-Predicate-defined-and-asserted-menu.png`. .. _figure-Predicate-defined-and-asserted-menu.png: .. figure:: ../../figs/Predicate-defined-and-asserted-menu.png :alt: **Predicate Dependencies** defined and defined+asserted menu **Predicate Dependencies** defined and defined+asserted menu In the **Sunflower** project navigation tree, double click family.flr to load it. Then click **Predicate Dependencies** to launch the plugin. A predicate dependency graph for family.flr is shown in default modes **All from entire KB** and **Defined only**. The predicate dependencies displayed are based on the entire set of rules defined in the KB for family.flr. This is seen in :numref:`figure-Predicate-all-from-kb-and-defined.png`. .. _figure-Predicate-all-from-kb-and-defined.png: .. figure:: ../../figs/Predicate-all-from-kb-and-defined.png :alt: **Predicate Dependencies** graph for family.flr in default modes **All from entire KB** and **Defined only** **Predicate Dependencies** graph for family.flr in default modes **All from entire KB** and **Defined only** Switch from **Defined only** to **Both defined and asserted**. Additional predicate dependencies such as those involving **child** are now added to the graph. These additional dependencies are from direct assertions made in family.flr. .. figure:: ../../figs/Predicate-all-from-kb-and-defined-asserted.png :alt: **Predicate Dependencies** graph for family.flr showing **Both defined and asserted** dependencies **Predicate Dependencies** graph for family.flr showing **Both defined and asserted** dependencies Similar to the **KB Graph** plugin described in Section :ref:`section-KB Graph`, **Predicate Dependencies** also has **View Dependencies from Selected Node** and **View Dependencies to Selected Node** checkboxes to filter dependency relationships from/to a selected node, and a **Reset** button to restore the full dependency graph. Look for the node **grandparent** in the graph. Click to highlight it. The node turns yellow indicating that it is selected. Other nodes which have predicate relationships with it are also highlighted, as seen in :numref:`figure-Predicate-grandparent.png`. .. _figure-Predicate-grandparent.png: .. figure:: ../../figs/Predicate-grandparent.png :alt: **Predicate Dependencies** graph with **grandparent** selected **Predicate Dependencies** graph with **grandparent** selected Uncheck the **View Dependencies to Selected Node** checkbox. The graph shows only dependencies from the **grandparent** node, as in :numref:`figure-Predicate-depend-from-grandparent.png`. Similarly, **Reset** to restore the full graph, then uncheck **View Dependencies from Selected Node**. The graph shows only dependencies from other nodes to **grandparent**, as in :numref:`figure-Predicate-depend-to-grandparent.png`. .. _figure-Predicate-depend-from-grandparent.png: .. figure:: ../../figs/Predicate-depend-from-grandparent.png :alt: Predicate dependencies from **grandparent** Predicate dependencies from **grandparent** .. _figure-Predicate-depend-to-grandparent.png: .. figure:: ../../figs/Predicate-depend-to-grandparent.png :alt: Predicate dependencies to **grandparent** Predicate dependencies to **grandparent** As also in the case of the **KB Graph** plugin, a **Quick Search** utility is available at the bottom of the **Predicate Dependencies** window to quickly highlight nodes of interest. Typing **CTRL + Space** in the **Quick Search** input bar pops up a list of possible search choices. The little **blue i** icon to the left of the **Quick Search** input bar shows a helpful reminder message when hovered over with a mouse. Lastly, the **Export** option, as shown in :numref:`figure-Predicate-export.png`, allows the graph to be saved to a user-specified location as a .png file. .. _figure-Predicate-export.png: .. figure:: ../../figs/Predicate-export.png :alt: The **Export** option in **Predicate Dependencies** The **Export** option in **Predicate Dependencies**