-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explanation of higher-stage staged rules doesn't work. #806
Comments
@AbhaMoitra , might need a little help with this as I'm not seeing what I expected. Running this model Stage 1 Rule StageOneRule Stage 2 Rule StageTwoRule MyThing1 is a Thingy. Explain: Rule StageOneRule. If I only explain StageTwoRule I get that explanation. |
I’ll need to prune my model while still retaining the issue and then “simplify” it and then I’ll post it on GIT.
BTW the 3rd thing I had mentioned (no error but no rule generated), I have not been able to recreate. I did not capture the noValue construct I had used so lets forget about it until I observe it again.
From: Andrew Crapo ***@***.***>
Sent: Tuesday, October 5, 2021 12:30 PM
To: SemanticApplicationDesignLanguage/sadl ***@***.***>
Cc: Moitra, Abha (GE Research, US) ***@***.***>; Mention ***@***.***>
Subject: EXT: Re: [SemanticApplicationDesignLanguage/sadl] Explanation of higher-stage staged rules doesn't work. (#806)
@AbhaMoitra<https://github.com/AbhaMoitra> , might need a little help with this as I'm not seeing what I expected. Running this model
'''
Thingy is a top-level class.
Color is a top-level class, must be one of {Black, White, Green}.
dp describes Thingy has values of type float.
op describes Thingy has values of type Color.
Stage 1 Rule StageOneRule
given
x is a Thingy
if
dp of x > 2
then
op of x is Black.
Stage 2 Rule StageTwoRule
given
x is a Thingy
if
op of x is not known
then
op of x is Green.
MyThing1 is a Thingy.
MyThing2 is a Thingy, has dp 2.5 .
Explain: Rule StageOneRule.
Explain: Rule StageTwoRule.
'''
gives this result:
'''
Inference of '/home/camfe/andy/ws/sadl/runtime-EclipseApplication2/DefaultValues2/TestTwoLevelDefaults.sadl' requested.
Reasoner family: Jena-Based (com.ge.research.sadl.jena.reasoner.JenaReasonerPlugin), version date 12 April 2021.
Explanation of Rule StageOneRule:
Rule StageOneRule: Premise 1 of 3: rdf(x, type, Thingy):
Premises through 1 had 2 matches.
(SPARQL Query: select ?x where {?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://sadl.imp/TestTwoLevelDefaults#Thingy })
x
http://sadl.imp/TestTwoLevelDefaults#MyThing2
http://sadl.imp/TestTwoLevelDefaults#MyThing1
Rule StageOneRule: Premise 2 of 3: rdf(x, dp, v0):
Premises through 2 had 1 matches.
(SPARQL Query: select ?x ?v0 where {?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://sadl.imp/TestTwoLevelDefaults#Thingy . ?x http://sadl.imp/TestTwoLevelDefaults#dp ?v0 })
x, v0
http://sadl.imp/TestTwoLevelDefaults#MyThing2, 2.5
Rule StageOneRule: Premise 3 of 3: greaterThan(v0,2):
Premises through 3 had 1 matches.
(SPARQL Query: select ?x ?v0 where {?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://sadl.imp/TestTwoLevelDefaults#Thingy . ?x http://sadl.imp/TestTwoLevelDefaults#dp ?v0 . FILTER(?v0 > 2)})
x, v0
http://sadl.imp/TestTwoLevelDefaults#MyThing2, 2.5
Explanation of Rule StageTwoRule:
Rule StageTwoRule: Premise 1 of 2: rdf(x, type, Thingy):
Premises through 1 had 2 matches.
(SPARQL Query: select ?x where {?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://sadl.imp/TestTwoLevelDefaults#Thingy })
x
http://sadl.imp/TestTwoLevelDefaults#MyThing2
http://sadl.imp/TestTwoLevelDefaults#MyThing1
Rule StageTwoRule: Premise 2 of 2: noValue(x,op):
Premises through 2 had no matches.
(SPARQL Query equivalent: select ?x where {?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://sadl.imp/TestTwoLevelDefaults#Thingy . FILTER(NOT EXISTS { ?x http://sadl.imp/TestTwoLevelDefaults#op ?unspecified_value })})
'''
If I only explain StageTwoRule I get that explanation.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#806 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGZX3GZKDN5M5R3DO75DR3TUFMRXBANCNFSM5FL3ZO6A>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
@crapo here is a small snippet (2 files) that shows the issue - see the comments in the code. TestExplain.sadl is as follows import "http://www.w3.org/1999/02/22-rdf-syntax-ns". Temp is a class. // If I keep rule Transitive2 then I do not get an explanation of rule Test; Rule Transitive2 Stage 1 Rule Test Explain: Rule Test. Ask: "select * where {?x ?y ?z} limit 2". file rdf.sadl is as follows ^type is a property. The console output I see is as follows I am using augmented reasoner. |
@AbhaMoitra , I created the two models in a new project, copying the content from your comment above. When I run "Test Model" I get the following: Obviously something is different... Ideas? What version are you running? Not that I recall any recent changes that seem like they would affect this.... Note that I reloaded, exited Eclipse and restarted, trying to reproduce. |
@AbhaMoitra , just for fun, I added the statement "InstOfTemp is a Temp." Then ran Test Model. Got this as I expected: |
@AbhaMoitra , I think I haven't been able to reproduce this error. Do you still see the issue with your updated version? |
@crapo : I will need to verify. Right now I am running into some issues with the SADL update of 11/30/2021 on one of my projects. I need to sort that out first. |
Reported by @AbhaMoitra .
The text was updated successfully, but these errors were encountered: