Jupyter Notebook Usage
Using PyReason in a Jupyter Notebook can be a little tricky. And it is recommended to run PyReason in a normal python file. However, if you want to use PyReason in a Jupyter Notebook, make sure you understand the points below.
When using functions like
add_ruleoradd_factin a Jupyter Notebook, make sure to run the cell only once. Running the cell multiple times will add the same rule/fact multiple times. It is recommended to store all the rules and facts in an array and then add them all at once in one cell towards the endFunctions like
load_graphandload_graphmlwhich are run multiple times can also have the same issue. Make sure to run them only once.