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] pprj not saving meta-class

Tania Tudorache tudorache at stanford.edu
Mon Jun 9 12:38:48 PDT 2008


Hi Len,

Len Yabloko wrote:
> Tania, 
>
>   
>> Len,
>>
>> I understand from your email that you are using the XML Backend. Is this 
>> right?
>>
>>     
>
> No -  I using regular Protege files to save project, but problem only occurs when using *.pont and *.pins , no problem when using *.pprj with *.xml (it is  called "xml experimental")
>
>   

Yes, this is what I meant. The XML Backend is actually the "XML 
Experimental".

>> The undefined class message means that there is an instance of a class, 
>> for which you don't have any definition in the xml file. Could it be 
>> that the class was included from another project and the class is not 
>> found anymore (e.g. you removed the included project, or the included 
>> project is not found)? In any case, Protege will create the class for 
>> you and add it under a :UNDEFINED class.
>>     
>
> No - I only use single file project and all classes are generated by sing Protege frame API (not direct user entries). Before project is saved all classes are defined, but when open after saving project I get errors (blow) and classes are shown :UNDEFINED.
>
>   
>> Second issue with the metaclass. From your description, it seems that 
>> the metaclass is abstract. The metaclass should not be abstract if you 
>> have classes that are instances of it. Is the message that you get 
>> similar to the one attached to this email? If the metaclass is abstract, 
>> the solution is to make it concrete, and you won't get that message anymore.
>>
>>     
>
> No - all my meta-classes are concrete, but when I click some generated top level meta-classes to open detail view I get message asking me if I want to make it abstract (and warning about existing instances).  
>   

How do you know that the metaclasses are concrete? You can check this in 
your code, by calling cls.isConcrete() or cls.isAbstract(). It would be 
interesting to see what you get back.

>
> It seems that common issue in both cases may be something about how I generate  meta-classes using API:
>   

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.

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

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