JESS: problem with fact-slot-value function

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

JESS: problem with fact-slot-value function

JOFFREClaire

Hi everyone!

 

I have a problem with the fact-slot-value function.

 

I have created a class "Person" with two slots "name" and "surname", and also two instances as is shown below:

 

 

f-0   (MAIN::object (is-a Person) (is-a-name "Person") (OBJECT <External-Address:edu.stanford.smi.protege.model.DefaultSimpleInstance>) (name "maggie") (surname "M"))

f-1   (MAIN::object (is-a Person) (is-a-name "Person") (OBJECT <External-Address:edu.stanford.smi.protege.model.DefaultSimpleInstance>) (name "melody") (surname "M"))

 

Then, I have tried to do:

Jess> (fact-slot-value <Fact-0> name)

 

But I get the following error:

 

Jess reported an error in routine call

            while executing (call ?__fact getSlotValue ?__name)

            while executing (return (call ?__fact getSlotValue ?__name))

            while executing deffunction fact-slot-value

            while executing (fact-slot-value <Fact-0> name).

  Message: No method named 'getSlotValue' found in class java.lang.String.

  Program text: ( fact-slot-value <Fact-0> name )  at line 7.

            at jess.v.call(Unknown Source)

            at jess.ep.a(Unknown Source)

            at jess.Funcall.execute(Unknown Source)

            at jess.FuncallValue.resolveValue(Unknown Source)

            at jess.a0.call(Unknown Source)

            at jess.ep.a(Unknown Source)

            at jess.Funcall.execute(Unknown Source)

            at jess.FuncallValue.resolveValue(Unknown Source)

            at jess.Deffunction.call(Unknown Source)

            at jess.ep.a(Unknown Source)

            at jess.Funcall.execute(Unknown Source)

            at jess.Jesp.a(Unknown Source)

            at jess.Jesp.for(Unknown Source)

            at jess.Jesp.parse(Unknown Source)

            at jess.Jesp.parse(Unknown Source)

            at jess.Main.execute(Unknown Source)

            at JessTab.JessTabEngine.run(JessTabEngine.java:114)

            at java.lang.Thread.run(Unknown Source)

 

 

 

What does it mean?

Could anyone help me with this problem?

 

Thanks a lot!

Best regards!

 

Claire

Reply | Threaded
Open this post in threaded view
|

JESS: Re: problem with fact-slot-value function

Félix Gómez Cordero
Hi Claire,
 
If you want to obtain that slot, I think you should try:
 
(fact-slot value (fact-id 0) name)
 
Regards,
 
 
Félix.
----- Original Message -----
Sent: Monday, July 25, 2005 11:32 AM
Subject: JESS: problem with fact-slot-value function

Hi everyone!

 

I have a problem with the fact-slot-value function.

 

I have created a class "Person" with two slots "name" and "surname", and also two instances as is shown below:

 

 

f-0   (MAIN::object (is-a Person) (is-a-name "Person") (OBJECT <External-Address:edu.stanford.smi.protege.model.DefaultSimpleInstance>) (name "maggie") (surname "M"))

f-1   (MAIN::object (is-a Person) (is-a-name "Person") (OBJECT <External-Address:edu.stanford.smi.protege.model.DefaultSimpleInstance>) (name "melody") (surname "M"))

 

Then, I have tried to do:

Jess> (fact-slot-value <Fact-0> name)

 

But I get the following error:

 

Jess reported an error in routine call

            while executing (call ?__fact getSlotValue ?__name)

            while executing (return (call ?__fact getSlotValue ?__name))

            while executing deffunction fact-slot-value

            while executing (fact-slot-value <Fact-0> name).

  Message: No method named 'getSlotValue' found in class java.lang.String.

  Program text: ( fact-slot-value <Fact-0> name )  at line 7.

            at jess.v.call(Unknown Source)

            at jess.ep.a(Unknown Source)

            at jess.Funcall.execute(Unknown Source)

            at jess.FuncallValue.resolveValue(Unknown Source)

            at jess.a0.call(Unknown Source)

            at jess.ep.a(Unknown Source)

            at jess.Funcall.execute(Unknown Source)

            at jess.FuncallValue.resolveValue(Unknown Source)

            at jess.Deffunction.call(Unknown Source)

            at jess.ep.a(Unknown Source)

            at jess.Funcall.execute(Unknown Source)

            at jess.Jesp.a(Unknown Source)

            at jess.Jesp.for(Unknown Source)

            at jess.Jesp.parse(Unknown Source)

            at jess.Jesp.parse(Unknown Source)

            at jess.Main.execute(Unknown Source)

            at JessTab.JessTabEngine.run(JessTabEngine.java:114)

            at java.lang.Thread.run(Unknown Source)

 

 

 

What does it mean?

Could anyone help me with this problem?

 

Thanks a lot!

Best regards!

 

Claire