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; i<good.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 Research Phone: (925) 294-2154
Sandia National Labs FAX: (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]
--------------------------------------------------------------------