似乎SWRL除法功能不接受小数。 这是我的疑问:
universityproject:professor(?x) ^ universityproject:has_height(?x, ?h) ^ universityproject:has_weight(?x, ?w) ^ swrlb:pow(?phm, ?h, 2) ^ swrlb:divide(?res, ?w, ?phm) ^ swrlb:greaterThan(?res, 30) -> sqwrl:select(?x, ?h, ?w, ?phm)
这是protege sqwrl选项卡中的输出错误:
Exception running SQWRL query S12: error running SQWRL queries: error inserting asserted OWL axioms into Drools:
[Error: invoker.invoke("S12", "swrlb:divide", 1, false, new VPATH($h), new BAVNs("res", "w", "phm"), new UBA("res"), $w, $phm): runtime exception thrown by built-in swrlb:divide in rule S12: java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.]
[Near : {... invoker.invoke("S12", "swrlb:d ....}]
^
[Line: 1, Column: 1]: runtime exception thrown by built-in swrlb:divide in rule S12: java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.: Non-terminating decimal expansion; no exact representable decimal result.: error inserting asserted OWL axioms into Drools:
[Error: invoker.invoke("S12", "swrlb:divide", 1, false, new VPATH($h), new BAVNs("res", "w", "phm"), new UBA("res"), $w, $phm): runtime exception thrown by built-in swrlb:divide in rule S12: java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.]
[Near : {... invoker.invoke("S12", "swrlb:d ....}]
^
[Line: 1, Column: 1]: runtime exception thrown by built-in swrlb:divide in rule S12: java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.: Non-terminating decimal expansion; no exact representable decimal result.: [Error: invoker.invoke("S12", "swrlb:divide", 1, false, new VPATH($h), new BAVNs("res", "w", "phm"), new UBA("res"), $w, $phm): runtime exception thrown by built-in swrlb:divide in rule S12: java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.]
[Near : {... invoker.invoke("S12", "swrlb:d ....}]
^
[Line: 1, Column: 1]: runtime exception thrown by built-in swrlb:divide in rule S12: java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.: Non-terminating decimal expansion; no exact representable decimal result.
如何在swrl语法中进行小数除法?