Using non-atomic concepts on the left-hand side of a statement

Posted by stelios on
URL: http://owlready.306.s1.nabble.com/Using-non-atomic-concepts-on-the-left-hand-side-of-a-statement-tp2706.html

Hi all,

I have come upon this error:


Traceback (most recent call last):
  File "/usr/share/pycharm/plugins/python-ce/helpers/pydev/pydevd.py", line 1483, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/usr/share/pycharm/plugins/python-ce/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/media/CaviarBlue/Data/University/UOA_MSc/Thesis/ProverPlayground/src/main.py", line 64, in <module>
    (Human | Infected).is_a.append(Infectious)
AttributeError: 'tuple' object has no attribute 'append'


The code that creates it is:


from owlready2 import *

on = get_ontology("http://tetete.com/ontology.owl")

class Human(Thing):
    namespace = on

class Infected(Thing):
    namespace = on

class Infectious(Thing):
    namespace = on

(Human | Infected).is_a.append(Infectious)


I have managed to use conjunction (with &) on the left-hand side, but not disjunction.

Before I actually run this, I get this warning:


Unresolved attribute reference 'is_a' for class 'Union'



My setup is:

Python 3.9
Owlready2 0.35

and for java -version:

openjdk version "11.0.13" 2021-10-19
OpenJDK Runtime Environment (build 11.0.13+8)
OpenJDK 64-Bit Server VM (build 11.0.13+8, mixed mode)

Do you have any insight?

Stelios