Hi,

On Dec 15, 2005, at 4:55 PM, Henrik Eriksson wrote:

Hi Dona,

I am not sure I understand your problem precisely. Perhaps you could use
the function "set-current-module" instead of "focus" to set the module
before calling mapclass.

--Henrik

thank you Henrik, Ernest  silly me, I really confused these two functions and wondered why the mapped facts showed up in the 'wrong' namespace.

Dona




On Wed, 14 Dec 2005, Dona Mommsen wrote:

Hi,

I'm trying to combine code for asking the user questions in JiA p.
167-169 with a small example in Protigi, using JessTab.
Instead of creating deftemplates for the questions and answers (JiA p.
165) I create classes with the corresponding slots in Protigi.

To access them in Jess/JessTab,  I tried the following

(defmodule ask)
(defrule ask::ask-question-by-id ...)
(focus MAIN)
(mapclass Question)

instances of the class 'Question' are not added to the module that I
expect. Although the focus is on MAIN, they are mapped to module ask,
e.g.

(ask::object (is-a Question) (is-a-name "Question") (OBJECT
<Java-Object:edu.stanford.smi.protege.model.DefaultSimpleInstance>)
(ident "age") (type
<Java-Object:edu.stanford.smi.protege.model.DefaultSimpleInstance>)
(text "What is your age (in years)?") (valid ))

Also, I sometimes get the focus set only on the second attempt, on the
first (focus bogus) the prompt comes back with MAIN

Jess> (clear)
TRUE
Jess> (defmodule ask)
TRUE
Jess> (defmodule portfolio)
TRUE
Jess> (defmodule bogus)
TRUE
Jess> (focus bogus)
MAIN
Jess> (focus bogus)
bogus
Jess>

Is this a bug or am I missing something?

My system settings:
Mac OS X 10.3.9
Jess Version 7.0b4
JessTab Version 1.4
Protigi Version 3.1.1  Build 216

Also, it would be great if mapclass would accept a module name as an
optional argument, something like
(mapclass <classname> [modulename])
(mapclass  [modulename::] <classname>)
so that classes don't get mapped to an unintended module.

Thanks in advance for any help

Dona

P.S:  I found an old post about a problem that is related to my
question (see below).
Thank you for improving the error message to: Bad slot value:
MAIN::object is an ordered template and can't have named slots at token
'('.
With the old post it helped me to figure out that I have a problem with
the modules...

On Sep 2, 2004, at 8:08 AM, [EMAIL PROTECTED] wrote:

I think bertrand GILLE wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
Wel... in fact... I've tried quite everything... deleting the rule,
deleting
the instance in protege, changing the names... changing quite
everything...
i can't see why it does not work as usual...

Have a look :
Jess> (defrule test_to_fix_this_pbm
(object (:NAME ?nn)) => (printout t "YES or NO?" crlf))
Jess reported an error in routine Jesp.parsePattern.
  Message: Bad slot value .
  Program text: ( defrule test_to_fix_this ( object (  at line 16.


Look at the "Program text" line: the last token to be processed is the
"(" that *opens* the ":NAME" slot; i.e., the error occurs *before*
Jess has even looked at the name of the slot. In fact, it's the "("
character itself that is an error -- in other words, Jess doesn't
think that the "object" template should have any slots at all: Jess
believes "object" is an ordered template.

This could happen if you've used the "object" template accidentally
someplace before defining it explicitly, or if you've got multiple
modules in place and accidentally defined "object" in a different
module than you intended.

The error message could be clearer, I agree (and in fact, in Jess 7
the message tells you specifically what the problem is.)



---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software 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]
--------------------------------------------------------------------






--------------------------------------------------------------------
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]
--------------------------------------------------------------------

Reply via email to