Hi,

I'm trying to make a small example how to use filter in combination with Protege. So far I haven't figured out whether I'm making a trivial mistake in the way I'm trying to use filter, or whether there is a particular Protigi / JessTab problem that I'm not getting.

 I have the following class and subclasses in Protege
(unfortunately the names have spaces, therefore the \):
class: Information\ Element
subclasses:     Customer-related\ Information\ Element
                        Portfolio-related\ Information\ Element
                        

a) WITHOUT any Protege particularities: Assume that ?r is a list with of instances of Information\ Element, and now I would like to use filter to get all instances Customer-related\ Information\ Element, how would the syntax look like?

b) Predicate function: Testing class With Protege  and JessTab
I used (mapclass Information\ Element) to assert the facts.
?c1 is a Protege instance of Customer-related\ Information\ Element

Jess> ?c1
<Java-Object:edu.stanford.smi.protege.model.DefaultSimpleInstance>

I can get the class of a Protege instance with a JessTab function and test for equality

Jess> (eq (class ?c1) Customer-related\ Information\ Element)
TRUE

However, the built-in Jess function instanceof creates a 'Class not found' error

Jess> (instanceof ?c1 Customer-related\ Information\ Element)
Jess reported an error in routine instanceof
        while executing (instanceof ?c1 Customer-related Information Element).
  Message: Class not found: Customer-related Information Element.
Program text: ( instanceof ?c1 Customer-related Information Element ) at line 105.

Nested exception is:
Customer-related Information Element

AFAIK this is the expected behavior for mapped Protege instances.

The JessTab function instancep just tests if an instance is a Protege instance, thus

(filter instancep ?r)

just returns the entire list ?r.

So how do I have to express the predicate function to test the class of a protege instance?

Thanks in advance for any help.

Dona


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