Re: adding a swrl rule through owlready2

Posted by d.onto on
URL: http://owlready.306.s1.nabble.com/adding-a-swrl-rule-through-owlready2-tp3346p3347.html

I oppened onto-y1.xml with Protégé and the rule has been translated to :
onto:Machine(?m) ^ onto:Package(?p) ^ onto:CVE(?c) ^ swrlb:contains(?m, ?p) ^ onto:has_CVE(?p, ?c) -> onto:contains_CVE(?m, ?c)
So my problem is a namespace problem I suspect

I would also like to get rid of the
        class Machine(owl.Thing):
            pass
        class Package(owl.Thing):
            pass
        class CVE(owl.Thing):
            pass
...
part in the python

(I would like the reader to read the classes and be able to set the rule without redefining them. I did it juste because otherwise the rule.set_as_rule doesn't want to set my rule)