Hello,
When running the following code I get some unexpected property restriction:
from owlready2 import *
onto = get_ontology("http://test.org/onto.owl")
with onto:
class Drug(Thing):
pass
Drug.iri = "http://test.org/onto.owl#SomeDrugIri"
class Ingredient(Thing):
pass
Ingredient.iri = "http://test.org/onto.owl#SomeIngredientIRI"
class has_for_ingredient(ObjectProperty):
domain = [Drug]
range = [Ingredient]
has_for_ingredient.iri = "http://test.org/onto.owl#Somehas_for_ingredientIri"
with onto:
class has_for_ingredient(Drug >> Ingredient):
pass
with onto:
class subDrug(Drug):
pass
subDrug.iri = 'http://test.org/onto.owl#yoplaboum'
drugIndividual = Drug(name='magicDrug')
ingredientIndividual = Ingredient(name='guarana')
has_for_ingredient[drugIndividual].append(Ingredient)
has_for_ingredient[drugIndividual].append(ingredientIndividual)
has_for_ingredient[subDrug].append(ingredientIndividual)
print(ingredientIndividual.is_a)
onto.save(r'c:\temp\drug.owl')
the output of the print function is:
[onto.SomeIngredientIRI, Inverse(onto.has_for_ingredient).some(onto.yoplaboum)], note the Inverse property restrictions, which is then serialized accordingly in the export file.
I did not expect this restriction from the code, did I miss something here?
Cheers,
Guillaume