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] [POSSIBLE VIRUS:###] Re: pprj not saving meta-class

Tania Tudorache tudorache at stanford.edu
Tue Jun 10 16:07:24 PDT 2008


Hi Len,

Thank you for sending the file. As I predicted, the metaclasses are 
defined as abstract in the xml file. If you look with a text editor in 
the xml file, you will see the definition for ONTO-BASE:


    <class>
        <name>ONTO-BASE</name>
        <type>:STANDARD-CLASS</type>
        <own_slot_value>
            <slot_reference>:ROLE</slot_reference>
            <value value_type="string">Abstract</value>
        </own_slot_value>
        <own_slot_value>
            <slot_reference>:DOCUMENTATION</slot_reference>
            <value value_type="string">@ontobase stereotype = 
Meta-Type</value>
        </own_slot_value>
        <superclass>:STANDARD-CLASS</superclass>
        <template_slot>:SIGN</template_slot>
        <template_slot>:INIT</template_slot>
        <template_slot>:ARGS</template_slot>
    </class>


You can see from this definition that the :ROLE is set to Abstract.  
That is why you get those messages from Protege.

If you fix the xml file, and change the "Abstract" to "Concrete", then 
you will not get the messages anymore.

Cheers,
Tania



Len Yabloko wrote:
> Hi Tania, 
>
>   
>> Yes, this information would have been helpful in the first email :)
>>
>> I think there is something wrong with the way you generate the metaclasses.
>>
>>     
>>> First I generate top level meta-class like this 
>>>
>>> DB = KB.createCls(reverseEngine.getCatalog(),TOPIC);
>>>   
>>>       
>> This doesn't look right. What is TOPIC? If this is the top metaclass, 
>> then it should be a subclass of :STANDARD-CLASS (or of :CLASS), 
>> otherwise the class is not recognized as a metaclass.
>>     
>
> No, TOPIC is collection created with following code
>
> META_CLASS = Arrays.asList(new Cls[] {KB.getCls(Model.Cls.STANDARD_CLASS)});
>
> ONTOSPACE = KB.createCls(ONTOBASE,META_CLASS);
>
> TOPIC = Arrays.asList(new Cls[] {ONTOSPACE}); 
>
>
>   
>>> Then I define collection 
>>>
>>> DATABASE = Arrays.asList(new Cls[] {DB});
>>>
>>> And later I generate child meta-class:
>>>
>>> table = KB.createCls(tableName, DATABASE); 
>>>   
>>>       
>> Looks good, if DB is indeed a metaclass.
>>
>>     
>>> All meta-classes later get instance classes, but only non-leaf meta-classes lose definition when saving in *.pont, *.pins.
>>>
>>>       
>> I could not reproduce that. Here is an example code that I have tested 
>> and it works fine.
>>
>> //create top metaclass - as subclass of :STANDARD-CLASS
>> Cls metacls = kb.createCls("MyMetaCls",
>>             
>> CollectionUtilities.createCollection(kb.getSystemFrames().getStandardClsMetaCls()));
>> //create a subclass of the metaclass
>> Cls metacls2 = kb.createCls("MySubMetaCls", 
>> CollectionUtilities.createCollection(metacls));
>>
>> //create classes using the metaclasses
>> Cls cls = kb.createCls("MyCls", kb.getRootClses(), metacls);
>> Cls cls2 = kb.createCls("MyCls2", kb.getRootClses(), metacls2);
>>
>> //create instances of the classes
>> Instance inst = cls.createDirectInstance("MyInst");
>> Instance inst2 = cls2.createDirectInstance("MyInst2");
>>
>>
>> If you still have problems with your code, I can help further only if I 
>> see the code.
>>     
>
> I am attaching my project in xml format. If you open it and try to convert to regular format you should see errors when it re-loads in a regular format.
>
>
>   
>> Cheers,
>> Tania
>>
>>
>>     
>>>> Tania
>>>>
>>>>
>>>> Len Yabloko wrote:
>>>>     
>>>>         
>>>>> Dear Protege developers, 
>>>>>
>>>>> I noticed a strange behavior in saving project as .pprj with meta-classes: for some reason some meta-classes are not properly saved resulting in messages like that when opening .pprj file
>>>>>
>>>>> Undefined class: OPERAND_TYPE found while loading instances
>>>>>
>>>>> The strange thing to me is that using .xml file instead of .pprj seem solves the problem. This happens the same way in both Protege 3.3.1 and 3.4 beta (500). I did not have this problem before, so it is something about my meta-classes that changed. But what? May be the large number of instance classes can cause it? Because every time when opening meta-class I get a message about large number of  instances asking me if I really want to make the class "concrete" (why??)
>>>>>
>>>>> Thank you in advance for your help.
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> protege-discussion mailing list
>>>>> protege-discussion at lists.stanford.edu
>>>>> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>>>>>
>>>>> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
>>>>>
>>>>>   
>>>>>       
>>>>>           
>>>>     
>>>>         




More information about the protege-discussion mailing list