Error inserting asserted OWL axioms into Drools

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

Error inserting asserted OWL axioms into Drools

tomekldc
Hi,

I'm working with SWRL API 2.0.6 and when I creating rules (with built-in
swrlb) from the java code and then I read the rule with the OWL file, my
rules are not in the correct order and I'm getting this exception below:
I'm using the rule to calculate the distance and then evaluate if my base
(an inividual) needs to be considred as "Critical" or not.



From the java console, I have no error but the rule doesn't seems to be
applied (but others without built-in are).

Did you manage to solve this issue ?
Thank you for your time,




--
Sent from: http://protege-project.136.n4.nabble.com/Protege-Developer-f4659816.html
_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
Reply | Threaded
Open this post in threaded view
|

Re: Error inserting asserted OWL axioms into Drools

tomekldc
This post was updated on .
/I'm completing my previous post because it doesn't seems to put my whole
message./

Here's my rule :
/
ruleEngine.createSWRLRule("CriticalBase","Aircraft(?e) ^ isClassifiedAs(?e,
Unclassified) ^ posZ(?e, ?posZE) ^ posX(?e, ?posXE) ^ posZ(MyBase, ?posZMe)
^ posX(MyBase, ?posXMe) ^ swrlb:subtract(?diffX, ?posXE, ?posXMe) ^
swrlb:subtract(?diffZ, ?posZE, ?posZMe) ^ swrlb:pow(?powDiffX, ?diffX,2) ^
swrlb:pow(?powDiffZ, ?diffZ, 2) ^ swrlb:add(?addXZ, ?powDiffZ, ?powDiffX) ^
swrlm:sqrt(?sqrtXZ, ?addXZ) ^ swrlb:lessThanOrEqual(?sqrtXZ, 10000.0) ->
isCritical(MyBase, true)");/


And there the exception:
*Exception running rule engine: error inserting asserted OWL axioms into
Drools:*
/[Error: invoker.invoke("CriticalBase", "swrlb:lessThanOrEqual", 4, false,
new VPATH(), new BAVNs("sqrtXZ", ""), new UBA("sqrtXZ"), new L("10000.0",
"xsd:decimal")): built-in exception thrown by built-in swrlb:lessThanOrEqual
in rule CriticalBase: exception thrown by built-in swrlb:lessThanOrEqual in
rule CriticalBase: comparison built-ins do not support argument binding for
(0-offset) argument #0]
[Near : {... invoker.invoke("CriticalBase", ....}]
             ^
[Line: 1, Column: 1]: built-in exception thrown by built-in
swrlb:lessThanOrEqual in rule CriticalBase: exception thrown by built-in
swrlb:lessThanOrEqual in rule CriticalBase: comparison built-ins do not
support argument binding for (0-offset) argument #0: exception thrown by
built-in swrlb:lessThanOrEqual in rule CriticalBase: comparison built-ins do
not support argument binding for (0-offset) argument #0: comparison
built-ins do not support argument binding for (0-offset) argument #0:
[Error: invoker.invoke("CriticalBase", "swrlb:lessThanOrEqual", 4, false,
new VPATH(), new BAVNs("sqrtXZ", ""), new UBA("sqrtXZ"), new L("10000.0",
"xsd:decimal")): built-in exception thrown by built-in swrlb:lessThanOrEqual
in rule CriticalBase: exception thrown by built-in swrlb:lessThanOrEqual in
rule CriticalBase: comparison built-ins do not support argument binding for
(0-offset) argument #0]
[Near : {... invoker.invoke("CriticalBase", ....}]
             ^
[Line: 1, Column: 1]: built-in exception thrown by built-in
swrlb:lessThanOrEqual in rule CriticalBase: exception thrown by built-in
swrlb:lessThanOrEqual in rule CriticalBase: comparison built-ins do not
support argument binding for (0-offset) argument #0: exception thrown by
built-in swrlb:lessThanOrEqual in rule CriticalBase: comparison built-ins do
not support argument binding for (0-offset) argument #0: comparison
built-ins do not support argument binding for (0-offset) argument #0/

PS : With the SQWRLRuleEngine, it works just fine.
Unfortunately I can't share my ontology, sorry.





--
Sent from: http://protege-project.136.n4.nabble.com/Protege-Developer-f4659816.html
_______________________________________________
protege-dev mailing list
protege-dev@lists.stanford.edu
https://mailman.stanford.edu/mailman/listinfo/protege-dev
Reply | Threaded
Open this post in threaded view
|

Re: Error inserting asserted OWL axioms into Drools

Martin O'Connor-2
Can you share the ontology?

Rules with this many clauses can be debugged incrementally in Protege with SQWRL [1], e.g.,

Aircraft(?e) -> sqwrl:select(?e)
Aircraft(?e) ^ isClassifiedAs(?e, Unclassified) -> sqwrl:select(?e)

etc.

Martin

[1] https://github.com/protegeproject/swrlapi/wiki/SQWRL

On Jun 27, 2019, at 6:08 AM, tomekldc <[hidden email]> wrote:

/I'm completing my previous post because it doesn't seems to put my whole
message./

Here's my rule :
/
ruleEngine.createSWRLRule("CriticalBase","Aircraft(?e) ^ isClassifiedAs(?e,
Unclassified) ^ posZ(?e, ?posZE) ^ posX(?e, ?posXE) ^ posZ(MyBase, ?posZMe)
^ posX(MyBase, ?posXMe) ^ swrlb:subtract(?diffX, ?posXE, ?posXMe) ^
swrlb:subtract(?diffZ, ?posZE, ?posZMe) ^ swrlb:pow(?powDiffX, ?diffX,2) ^
swrlb:pow(?powDiffZ, ?diffZ, 2) ^ swrlb:add(?addXZ, ?powDiffZ, ?powDiffX) ^
swrlm:sqrt(?sqrtXZ, ?addXZ) ^ swrlb:lessThanOrEqual(?sqrtXZ, 10000.0) ->
isCritical(MyBase, true)");/


And there the exception:
*Exception running rule engine: error inserting asserted OWL axioms into
Drools:*
/[Error: invoker.invoke("CriticalBase", "swrlb:lessThanOrEqual", 4, false,
new VPATH(), new BAVNs("sqrtXZ", ""), new UBA("sqrtXZ"), new L("10000.0",
"xsd:decimal")): built-in exception thrown by built-in swrlb:lessThanOrEqual
in rule CriticalBase: exception thrown by built-in swrlb:lessThanOrEqual in
rule CriticalBase: comparison built-ins do not support argument binding for
(0-offset) argument #0]
[Near : {... invoker.invoke("CriticalBase", ....}]
            ^
[Line: 1, Column: 1]: built-in exception thrown by built-in
swrlb:lessThanOrEqual in rule CriticalBase: exception thrown by built-in
swrlb:lessThanOrEqual in rule CriticalBase: comparison built-ins do not
support argument binding for (0-offset) argument #0: exception thrown by
built-in swrlb:lessThanOrEqual in rule CriticalBase: comparison built-ins do
not support argument binding for (0-offset) argument #0: comparison
built-ins do not support argument binding for (0-offset) argument #0:
[Error: invoker.invoke("CriticalBase", "swrlb:lessThanOrEqual", 4, false,
new VPATH(), new BAVNs("sqrtXZ", ""), new UBA("sqrtXZ"), new L("10000.0",
"xsd:decimal")): built-in exception thrown by built-in swrlb:lessThanOrEqual
in rule CriticalBase: exception thrown by built-in swrlb:lessThanOrEqual in
rule CriticalBase: comparison built-ins do not support argument binding for
(0-offset) argument #0]
[Near : {... invoker.invoke("CriticalBase", ....}]
            ^
[Line: 1, Column: 1]: built-in exception thrown by built-in
swrlb:lessThanOrEqual in rule CriticalBase: exception thrown by built-in
swrlb:lessThanOrEqual in rule CriticalBase: comparison built-ins do not
support argument binding for (0-offset) argument #0: exception thrown by
built-in swrlb:lessThanOrEqual in rule CriticalBase: comparison built-ins do
not support argument binding for (0-offset) argument #0: comparison
built-ins do not support argument binding for (0-offset) argument #0/






--
Sent from: http://protege-project.136.n4.nabble.com/Protege-Developer-f4659816.html
_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev


_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev