2 Aug 2004 01:40
[protege-discussion] Re: Problem with PAL queries and :SYMBOL typed slots...
Samson Tu <tu <at> SMI.Stanford.EDU>
2004-08-01 23:40:52 GMT
2004-08-01 23:40:52 GMT
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
>>
>>
>
>
>
RSS Feed