Hi Karen,
I think there are (at least) two possibilities to access the instance:
First, you could use the Protege-API, but you'll get more support about this
topic on the Protege usergroup.
Second, a little more jess related:
The object in the list you get, indicates a reference on a Protege
knowledge-base instance. So you could map the protege class, the object is
an instance of, to jess using the (mapclass) function of Protege JessTab.
Perhaps you can make use of the two code samples to link the references in
the list with the mapped instances and access the slot values.
(defquery get-fact-by-address
(declare (variables ?addr))
(object (OBJECT ?addr))
)
....
(foreach ?element $?iplList
(bind ?it (run-query get-fact-by-address ?value))
(if (call ?it hasNext) then
(bind ?token (call ?it next))
(fact-slot-value (call ?token fact 1) <SLOTNAME>)
)
)
....
Regards
Christian
)-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Karen Fox
Sent: Wednesday, March 05, 2003 10:07 PM
To: [EMAIL PROTECTED]
Subject: Re: JESS: Fetching Multislot List
What's coming back is a list where every item in the list is an instance
of a Protege class. How do I interrogate the contents of the instance
from Java?
Karen Fox
Karen Fox wrote:
> I am able to store variables from Java into Jess and use them in a
> batch file. I then want to retrieve the multislot list that has been
> put together within this batch file and view the list. I've tried
> several different things, none of which has worked.
>
> Here is where I store the list in the clp file:
>
> (defrule complete-search
> (goal-is-to (action "complete") (argument1 $?iplList))
> =>
> (store IPLLIST $?iplList)
> (printout t "We are finished!! " crlf)
> (printout t "Final list is: " crlf)
> (stepIPLList $?iplList)
> )
>
>
> Here is the latest attempt to retrieve the list from Java:
>
> //fetch stored result
> System.out.println("Results are " +
> r.fetch("IPLLIST").listValue(null));
>
> which gives me this error:
>
> Results are
> <External-Address:edu.stanford.smi.protege.model.DefaultSimpleInstan
> ce>
> <External-Address:edu.stanford.smi.protege.model.DefaultSimpleInstance>
>
> I've tried using externalAddressValue(null) and that didn't work
> either. I tried using the Enumeration example from the manual and that
> didn't work. I'm sure I'm doing something very stupid as a newbie,
> but I'm not seeing it. I'd appreciate any suggestions.
>
> Thank you.
>
--
Karen Fox
Technical Project Support III
The MITRE Corporation
Colorado Springs, CO
719-572-8368
[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]
--------------------------------------------------------------------
--------------------------------------------------------------------
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]
--------------------------------------------------------------------