owl_inverse_property problem

Posted by ZhaoPengya2 on
URL: http://owlready.306.s1.nabble.com/owl-inverse-property-problem-tp229.html

hi, I tried the example of "Drug and Ingredient" on the official website, but there is a mistake. According to the documentation of the official website, after writing the statement of "inverse_property = has_for_ingredient", we can use print(aspirin.is_ingredient_of) to get the relationship, but it got null. Many thanks.

Code:
my_drug2 = Drug("my_drug2")
aspirin = Ingredient("aspirin")
my_drug2.has_for_ingredient.append(aspirin)
print(my_drug2.has_for_ingredient)
print(aspirin.is_ingredient_of)

Output:
[owl.aspirin]
[] #this value should be [owl.my_drug2], right?