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] Code Generation whish list

Simon Paradies simon.paradies.ext at
Tue Apr 14 06:43:23 PDT 2009

Hi Tania,

Since we are already discussing the code generator: I am missing a copy() 
method in the generated code as well. It would be nice if this would use the 
currently recommended clone()/copy()/duplicate() method for the instance type 
at hand. I found that these methods are scattered across the packages and I am 
not sure which to use when (e.g. some are util-methods, others are class-
Yet, there is already a copy() method for the OWL-Java-Code generator (the 
Frames-Java-Code generator is missing it (presumably because of a different 
path of inheritance)) but when trying something like
	JenaOWLModel owlModel = ProtegeOWL.createJenaOWLModelFromURI("file:///
	PersonFactory pf = new PersonFactory(owlModel);
	Person jd = pf.createPerson("JonDoe");
	Person jd1 = pf.getPerson("JonDoe");
	Person jd2 = pf.getPerson("JonDoe");
	Person jd3 = (Person) jd1.copy(owlModel, null, false);

a  "java.lang.ClassCastException: 
edu.stanford.smi.protegex.owl.model.impl.DefaultOWLIndividual cannot be cast to 
person.Person" is thrown. Also, this copy() method is marked as deprecated.

Is there already some better way other than directly cloning instances/

Thanks in advance

More information about the protege-discussion mailing list