Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-discussion] Fwd: PAL problem

Samson Tu swt at stanford.edu
Sat Jan 27 15:39:11 PST 2007


Try this:

(defrange ?c11 :FRAME Class1)
(defrange ?cab1 :FRAME ClassAB)
(defrange ?cab2 :FRAME ClassAB)
(defrange ?c12 :FRAME Class1)
(defrange ?c13 :FRAME Class1)
(defrange ?c21 :FRAME Class2 )


(forall ?c11
         (=> (own-slot-not-null mainslot_value ?c11)
             (or  (exists ?cab1
                    (and (= (slot_value ?cab1)(mainslot_value ?c11))
                         (exists ?c12 (slot1_class12 ?c12 ?cab1))))
                  (exists ?cab2
                    (and (= (slot_value  ?cab2)(mainslot_value ?c11))
                         (exists ?c21 (and (slot1_class12 ?c21 ?cab2)
                              (exists ?c13 (slot2_class1 ?c13 ?c21))))))
             )))



Peter Soren wrote:
> Hi all!
>    
> I have this problem in PAL:
>     
> Both classes Class1 and Class2 have in slot1_class12
> instance of ClassAB as value.
> Furthermore, Class1 has in slot2_class1 instance of
> Class2 as value.
> ClassAB has some specific value in slot_value
> (cardinality is single, and there are several allowed
> symbols that can be taken as a value). 
> Class1 has some specific values in mainslot_value
> (cardinality is multiple, and there are the same
> allowed symbols as for slot_value that can be taken as
> value).
> The restriction says that Class1 in mainslot_value can
> have only those values that meet one of those
> conditions:
> - the value is a value of value_slot of some instance
> of ClassAB, and that instance is a value of
> slot1_class12 for some instance of Class1 , or
> - the value is a value of value_slot of some instance
> of ClassAB, and that instance is a value of
> slot1_class12 for some instance of Class2, and that
> same instance of Class2 is a value of slot2_class1 for
> some instance of Class1
>    
> I devided ClassAB in two for the purpose of solution. 
> The problem is that I need a general description and
> not only for a value "that".
> The solution beneath is just one of a dozen I tried
> and it is only for 1 value.
> I also need it to work when either Class1 or Class2
> doesn't have any instances.
> 
> (defrange ?class1 :FRAME Class1)
> (defrange ?classA :FRAME ClassAB slot1_class12)
> (defrange ?classB :FRAME ClassAB slot1_class12)
> (defrange ?class2 :FRAME Class2 slot2_class1)
>      
> (forall ?class1 (forall ?class2
>    (=> (and (not (exists ?classA 
>                  (and (slot1_class12 ?class2 ?classA)
>                       (slot2_class1 ?class1 ?class2)
>                       (slot_value ?classA "this"))))
>             (not (exists ?classB 
>                  (and (slot1_class12 ?class1 ?classB)
>                       (slot_value ?classB "this")))))
>        (not (mainslot_value ?class1 "this")))))
>    
> Please, help, because I have tried so many solutions
> and it doesn't work. (It says that constraints are met
> even if they are not)   
> 
> 
> Regards,  Peter




More information about the protege-discussion mailing list