@SuppressWarnings("deprecation")
public RDFSNamedClass createICDCategory(String name, Collection<String> superclsesName) {
if (name == null) {
//name = IDGenerator.getNextUniqueId();//Guoqian
}
RDFSNamedClass cls = getICDClass(name, true);
Collection<RDFSNamedClass> superclses = new ArrayList<RDFSNamedClass>();
//we could treat also the case when a class has an external cause and another normal disease as parents..
boolean isExternalCause = false;
if (superclsesName == null || superclsesName.size() == 0) {
superclses.add(getICDCategoryClass());
} else {
for (String superclsName : superclsesName) {
RDFSNamedClass supercls = getICDSuperclass(superclsName, true);
if (supercls != null) {
superclses.add(supercls);
//add superclasses
if (!cls.getSuperclasses(true).contains(supercls)) {
cls.addSuperclass(supercls);
if (cls.hasDirectSuperclass(owlModel.getOWLThingClass())) {
cls.removeSuperclass(owlModel.getOWLThingClass());
}
}
if (supercls.equals(getExternalCausesTopClass()) || supercls.hasSuperclass(getExternalCausesTopClass())) {
isExternalCause = true;
}
}
}
}
//set metaclasses
cls.setDirectTypes(isExternalCause ? getExternalCauseMetaclasses() : getRegularDiseaseMetaclasses());
RDFSNamedClass singleParent = superclses.size() > 1 ? null : CollectionUtilities.getFirstItem(superclses);
//add linearization instances
for (RDFResource linView : getLinearizationValueSet()) {
RDFResource linSpec = getLinearizationSpecificationClass().createInstance(null); //IDGenerator.getNextUniqueId());//Guoqian
linSpec.setPropertyValue(getLinearizationViewProperty(), linView);