Re: JESS: Retractions through Rete object trouble!

2003-10-10 Thread ejfried
Well, the thing to do ies to get an instance of both an apparently good and bad
Java string together, and compare them one character at a time, like

String good = ...
String bad = ...
for (int i=0; igood.length(); ++i)
  if (good.charAt(i) != bad.charAt(i))
System.out.println(DIFF:  +
(int) good.charAt(i) +   + (int) bad.charAt(i));

and see if you can figure out the mismatch that way.


I think Jordan Willms wrote:
 Hi there.
 
 I am communicating with the Jess engine using Java, and I've noticed
 some altogether strange behaviour with Fact retractions (which I have no
 doubt is my fault). I come to the mailing list as a last resort.
 
 I am quite experienced with Jess/Java integration, which is why this problem
 
 is very confusing to me.
 
 Firstly, take the following retraction string, I run it in WinJess with no
 problems : 
 
 (retract-string 
 (PropertyValue
 http://echo.iat.sfu.ca/owl/psychoacoustics.daml#hasDirectionality
 
  http://echo.iat.sfu.ca/owl/psychoacoustics.daml#AShok
  http://echo.iat.sfu.ca/owl/psychoacoustics.daml#DirectionalityPointSource)
 )
 
 But, the same string, generated from a rdf file :
 ?xml version=1.0 encoding=ISO-8859-1?
 rdf:RDF xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#;
 xmlns:daml=http://www.daml.org/2001/03/daml+oil#;
 xmlns:ns1=http://echo.iat.sfu.ca/owl/psychoacoustics.daml#;
 xmlns:rdfs=http://www.w3.org/2000/01/rdf-schema#;
 xmlns:xsd=http://www.w3.org/2000/10/XMLSchema#;
   rdf:Description
 rdf:about=http://echo.iat.sfu.ca/owl/psychoacoustics.daml#AShok;
   ns1:hasDirectionality
   /rdf:Description
 /rdf:RDF
 
 which looks exactly the same (here is my debug) window (does not work?):
 
 [echoEdit] Retract String: (retract-string 
 (PropertyValue
 http://echo.iat.sfu.ca/owl/psychoacoustics.daml#hasDirectionality
 
  http://echo.iat.sfu.ca/owl/psychoacoustics.daml#AShok
  http://echo.iat.sfu.ca/owl/psychoacoustics.daml#DirectionalityPointSource)
 )
 
 when I do :
 
 Value v = rete.executeCommand(retractString);  // retractString is the above
 
 string
 
 System.out.println(v.toString());
 
 prints FALSE!
 
 PART 3 : The real wierdness :
 
 I put together the following code:
 
   Rete rete = myThread.getJessEngine();
   Value v = rete.executeCommand((retract-string
 \(PropertyValue
 http://echo.iat.sfu.ca/owl/psychoacoustics.daml#hasDirectionality 
 http://echo.iat.sfu.ca/owl/psychoacoustics.daml#AShok 
   
   System.out.println(value v :  + v.toString());
   // Prints out TRUE!
 
 So, obviously something is wrong with the fact string that I am trying to
 create from the RDF file. BUT -- IT'S EXACTLY THE SAME! So, why is this
 happening?
 
 Can anyone shed any light on this problem. I feel like I'm taking crazy
 pills.
 
 Thank you very much.
 
 ..Jordan Willms.
 rdf:resource=http://echo.iat.sfu.ca/owl/psychoacoustics.daml#Directionality
 
 PointSource /
 http://echo.iat.sfu.ca/owl/psychoacoustics.daml#DirectionalityPointSource)\
 
 ));
 
 
 To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
 in the BODY of a message to [EMAIL PROTECTED], NOT to the list
 (use your own address!) List problems? Notify [EMAIL PROTECTED]
 
 



-
Ernest Friedman-Hill  
Distributed Systems ResearchPhone: (925) 294-2154
Sandia National LabsFAX:   (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov


To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]




RE: JESS: Retractions through Rete object trouble!

2003-10-10 Thread James Owen
Or, maybe you can intern() the String(s) that you created you can
probably find the problem.  Maybe.

SDG
jco

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of [EMAIL PROTECTED]
Sent: Friday, October 10, 2003 7:57 PM
To: [EMAIL PROTECTED]
Subject: Re: JESS: Retractions through Rete object trouble!


Well, the thing to do ies to get an instance of both an apparently good
and bad Java string together, and compare them one character at a time,
like

String good = ...
String bad = ...
for (int i=0; igood.length(); ++i)
  if (good.charAt(i) != bad.charAt(i))
System.out.println(DIFF:  +
(int) good.charAt(i) +   + (int) bad.charAt(i));

and see if you can figure out the mismatch that way.


I think Jordan Willms wrote:
 Hi there.
 
 I am communicating with the Jess engine using Java, and I've 
 noticed some altogether strange behaviour with Fact retractions (which

 I have no doubt is my fault). I come to the mailing list as a last 
 resort.
 
 I am quite experienced with Jess/Java integration, which is why this 
 problem
 
 is very confusing to me.
 
 Firstly, take the following retraction string, I run it in WinJess 
 with no problems :
 
 (retract-string 
 (PropertyValue 
 http://echo.iat.sfu.ca/owl/psychoacoustics.daml#hasDirectionality
 
  http://echo.iat.sfu.ca/owl/psychoacoustics.daml#AShok
  

http://echo.iat.sfu.ca/owl/psychoacoustics.daml#DirectionalityPointSourc
e)
 )
 
 But, the same string, generated from a rdf file :
 ?xml version=1.0 encoding=ISO-8859-1?
 rdf:RDF xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#;
 xmlns:daml=http://www.daml.org/2001/03/daml+oil#;
 xmlns:ns1=http://echo.iat.sfu.ca/owl/psychoacoustics.daml#;
 xmlns:rdfs=http://www.w3.org/2000/01/rdf-schema#;
 xmlns:xsd=http://www.w3.org/2000/10/XMLSchema#;
   rdf:Description 
 rdf:about=http://echo.iat.sfu.ca/owl/psychoacoustics.daml#AShok;
   ns1:hasDirectionality
   /rdf:Description
 /rdf:RDF
 
 which looks exactly the same (here is my debug) window (does not 
 work?):
 
 [echoEdit] Retract String: (retract-string 
 (PropertyValue 
 http://echo.iat.sfu.ca/owl/psychoacoustics.daml#hasDirectionality
 
  http://echo.iat.sfu.ca/owl/psychoacoustics.daml#AShok
  

http://echo.iat.sfu.ca/owl/psychoacoustics.daml#DirectionalityPointSourc
e)
 )
 
 when I do :
 
 Value v = rete.executeCommand(retractString);  // retractString is the

 above
 
 string
 
 System.out.println(v.toString());
 
 prints FALSE!
 
 PART 3 : The real wierdness :
 
 I put together the following code:
 
   Rete rete = myThread.getJessEngine();
   Value v = rete.executeCommand((retract-string
 \(PropertyValue 
 http://echo.iat.sfu.ca/owl/psychoacoustics.daml#hasDirectionality
 http://echo.iat.sfu.ca/owl/psychoacoustics.daml#AShok
   
   System.out.println(value v :  + v.toString());
   // Prints out TRUE!
 
 So, obviously something is wrong with the fact string that I am trying

 to create from the RDF file. BUT -- IT'S EXACTLY THE SAME! So, why is 
 this happening?
 
 Can anyone shed any light on this problem. I feel like I'm taking 
 crazy pills.
 
 Thank you very much.
 
 ..Jordan Willms. 
 rdf:resource=http://echo.iat.sfu.ca/owl/psychoacoustics.daml#Directio
 nality
 
 PointSource / 
 http://echo.iat.sfu.ca/owl/psychoacoustics.daml#DirectionalityPointSou
 rce)\
 
 ));
 
 
 To unsubscribe, send the words 'unsubscribe jess-users 
 [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT

 to the list (use your own address!) List problems? Notify 
 [EMAIL PROTECTED]
 
 



-
Ernest Friedman-Hill  
Distributed Systems ResearchPhone: (925) 294-2154
Sandia National LabsFAX:   (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov


To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use
your own address!) List problems? Notify [EMAIL PROTECTED]



To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]