Issue with Jupyter Notebook

classic Classic list List threaded Threaded
2 messages Options
Neo
Reply | Threaded
Open this post in threaded view
|

Issue with Jupyter Notebook

Neo
This post was updated on .
I'm not sure if it's something wrong with the compatibility with Jupyter Notebook or I'm using Owlready the wrong way, but when I tried to execute the following code (Fruit is the only class I created in the ontology, and Apple is Fruit's only subclass):

Fruit.descendants()
Apple.ancestors()

in the same code cell, all I got is

{onto_empty.Apple, onto_empty.Fruit, owl.Thing}

The problem is the result of Fruit.descendants() disappeared for no reason, though running Fruit.descendants() alone works fine, it returns

{onto_empty.Apple, onto_empty.Fruit}

Reply | Threaded
Open this post in threaded view
|

Re: Issue with Jupyter Notebook

Jiba
Administrator
Hello,

I'm not used to Jupyter, but maybe you cannot ask two values as you did.

Possibly you can try :

Fruit.descendants(), Apple.ancestors()

Jiba