protegeproject / swrlapi

Java API for working with the SWRL rule and SQWRL query languages
Other
99 stars 40 forks source link

why is there no error #73

Open maple-7 opened 2 years ago

maple-7 commented 2 years ago

A,B and C is class. I want to show if letter is instance of A or B ,than this letter is instance of C. So I write this sqrl statement, I am confused about whether this statement is correct.

abox:caa(A or B(?letter)->C(?letter)

and I was wondering if 'and' ,'or' could be used in swrl statements.

martinjoconnor commented 2 years ago

Take a look at the language SWRL FAQ here:

https://github.com/protegeproject/swrlapi/wiki/SWRLLanguageFAQ

SWRL only allows conjunction ('and'), but you can usually work around that limitation by writing multiple rules.

Here, you can do what you want to do directly in the language itself without using built-ins, e.g.,

A(?letter) -> C(?letter)
B(?letter) -> C(?letter)