* Linearization: Morbidity;
* @return
*
*/
private RDFSNamedClass getLinearizationParentForType(RDFSNamedClass icdCategory, String type){
RDFSNamedClass ret = null;
if(this.hasMultipleParent(icdCategory)){ //if having multiple parent
Collection<RDFResource> linearizationSpecs = icdContentModel.getLinearizationSpecifications(icdCategory);
for (RDFResource linearizationSpec : linearizationSpecs) {
RDFResource linearization = (RDFResource) linearizationSpec.getPropertyValue(icdContentModel.getLinearizationViewProperty());
RDFSNamedClass linearizationParent = (RDFSNamedClass) linearizationSpec.getPropertyValue(icdContentModel.getLinearizationParentProperty());
Boolean isIncludedInLinearization = (Boolean) linearizationSpec.getPropertyValue(icdContentModel.getIsIncludedInLinearizationProperty());
if(linearization.getBrowserText().equals(type)){//only for a specific type
if(linearizationParent != null){
Collection linearParentSubclasses = linearizationParent.getSubclasses(false); // check if linear parent is real
if(!linearParentSubclasses.contains(icdCategory)){
RDFSNamedClass randomLinearParent = this.getRandomSingleParent(icdCategory);
ret = randomLinearParent;
//System.out.println("not real linear parent:|" + icdCategory.getURI() + "|" + randomLinearParent.getURI());
break;
}else{
ret = linearizationParent;
break;
}
}else{ //no linear parent specified
RDFSNamedClass parent = this.getRandomSingleParent(icdCategory); // get random single parent
if(!mapRegisterLinearParent.containsKey(icdCategory)){
mapRegisterLinearParent.put(icdCategory, parent);
//System.out.println("icdCategory:" + icdCategory.getBrowserText() + "|linearParent(random):" + parent.getBrowserText() );
}
ret = parent;
break;
}
}
}
}else{ //having single parent
RDFSNamedClass parent = this.getSingleParent(icdCategory);
ret = parent;