Samson Tu | 2 Aug 2004 01:40
Picon

[protege-discussion] Re: Problem with PAL queries and :SYMBOL typed slots...


You access the slot value in the functioal form
(reading-level ?item) ONLY when the slot reading-level is single-valued. 
  (function <=> cardinality single)

When the slot has cardinatliy multiple, you have to use the predicate 
form (slot frame slot-value), i.e.

(findall ?item (reading_level ?item (coerce-to-symbol "College")))

Samson

Vassilis Koutkias wrote:

> Another problem related to the PAL syntax...
> 
> What is the form of the query in case where the reading_level slot 
> accepted multiple values?
> 
> Samson, I noticed that the result of the query you suggested contains 
> only the instances where the searched value ("College" in our previous 
> example) is defined first in the list of multiple values. In case it is 
> not the first one, it is just ignored...
> 
> Any suggestions?
> 
> Vassilis.
> 
> Samson Tu wrote:
> 
> 
>>Use the "coerce-to-string" function:
>>
>>(findall ?item
>>         (= (coerce-to-string (reading_level ?item))   "College"))
>>
>>
>>Vassilis Koutkias wrote:
>> 
>>
>>
>>>Dear all,
>>>
>>>I am working with the PAL Queries Tab and I am facing the following problem:
>>>
>>>I am querying a class to obtain its instances, with a slot criterion which is of
>>>
>>>type :SYMBOL, in the following way (i.e., query for instances of the Article
>>>
>>>class, which has the value "College" in the reading_level slot, corresponding to
>>>
>>>the Newspaper project) :
>>>
>>>(defrange ?item :FRAME Article)
>>>(findall ?item
>>>       (= (reading_level ?item) "College"))
>>>
>>>This query would work fine in case the reading_level slot was not of :SYMBOL
>>>
>>>type but of :STRING type. I also excluded quotas in College, but there were no
>>>
>>>results generated by the query. In any case, I get an empty "Warnings and
>>>
>>>Errors" textarea in the PAL Queries Tab and some exceptions in the Protege
>>>
>>>console window triggered by
>>>
>>>"edu.stanford.smi.protegex.pal.language.Type_Symbol.coerceValue(Unknown Source)".
>>>
>>>I would appreciate any idea, regarding the way such a query should be 
>>>formulated...
>>>
>>>Thank you very much in advance,
>>>
>>>Vassilis.
>>>
>>>   
>>>
>>
>>-----------------------------------------------------------
>>To unsubscribe go to http://protege.stanford.edu/lists.html
>> 
>>
> 
> 
> 


Gmane