There are special characters in the owl entity

classic Classic list List threaded Threaded
3 messages Options
L
Reply | Threaded
Open this post in threaded view
|

There are special characters in the owl entity

L
When the class name or attribute name has a character "-" link, such as a-b(?x), c-d-e(?x, ?y), greaterThan(?y, 3) -> has_c(?x, 'risk'), an error is reported" Lexing error near”
Reply | Threaded
Open this post in threaded view
|

Re: There are special characters in the owl entity

Jiba
Administrator
Hi,

I tried the following script, but it works without problem.

Could you provide me a script that shows the error please?

Jiba


from owlready2 import *

o1 = get_ontology("http://test.de/test")

with o1:

    class A(Thing): pass

    class p(Thing >> int): pass
    class has_c(Thing >> str): pass
   
    class B(Thing): pass

    class C(Thing): pass
   
    A.name = "a-b"
    p.name = "c-d-e"
    C.name = "a-b-c"
   
    r = Imp()
    r.set_as_rule("""a-b(?x), c-d-e(?x, ?y), greaterThan(?y, 3) -> has_c(?x, 'risk')""")
L
Reply | Threaded
Open this post in threaded view
|

Re: There are special characters in the owl entity

L
Thanks ,you are right. Follow your code , chinese classes rules is supported too. I also have solved by
(https://github.com/georgewangchn/owlready2-Chinese )(modify  the reasoning.py).I don't meet this error, thanks again.