Package edu.stanford.smi.protegex.owl.model

Examples of edu.stanford.smi.protegex.owl.model.RDFSNamedClass


     * 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;

       
      
View Full Code Here


      return ret;    
    }
       
    //get parent calss if it is a single parent
    private RDFSNamedClass getSingleParent(RDFSNamedClass icdCategory){
      RDFSNamedClass ret = null;
     
      Collection parents = icdCategory.getSuperclasses(false);
      if(parents.size() == 1){
        for(Iterator it = parents.iterator(); it.hasNext();){
          RDFSNamedClass parent = (RDFSNamedClass) it.next();
          ret = parent;
          break;
        }
       
      }
View Full Code Here

    }
   
    // get a random parent (first one)
   
    private RDFSNamedClass getRandomSingleParent(RDFSNamedClass icdCategory){
      RDFSNamedClass ret = null;
     
      Collection parents = icdCategory.getSuperclasses(false);
        for(Iterator it = parents.iterator(); it.hasNext();){
          RDFSNamedClass parent = (RDFSNamedClass) it.next();
          ret = parent;
          break;
        }
     
      return ret;
View Full Code Here

   
    private boolean isLinearizationParent(RDFSNamedClass child, RDFSNamedClass parent, String type){
     
      boolean ret = false;
     
      RDFSNamedClass linearParent = this.getLinearizationParentForType(child, type);
      if(linearParent.equals(parent)){
        ret = true;
      }else{
       
        //System.out.println("LinearParent|" + linearParent.getBrowserText() + "|" + linearParent.getURI());
        //System.out.println("CurrentParent|" + parent.getBrowserText() + "|" + parent.getURI());
View Full Code Here

        icdCategories, icdContentModel);

    sb.append(this.getClaMLHeader());
    int index = 0;
    for (Iterator it = icdCategories.iterator(); it.hasNext();) {
      RDFSNamedClass icdCategory = (RDFSNamedClass) it.next();
      // only those categories having generated codes
      if (mapGeneratedCodes.containsKey(icdCategory)) {
        String classCode = (String) mapGeneratedCodes.get(icdCategory);
        String classKind = getClassKind(icdCategory, icdContentModel);

        // Class Header
        sb.append(this.getClaMLClassHeader(classKind, classCode));

        // Meta for iCatID
        String metaICatId = "iCatID";
        String metaICatIdName = icdCategory.getName();
        sb.append(this.getClaMLMeta(metaICatIdName, metaICatId));

        // SuperClass
        if (!classKind.equals("chapter")) {// chapter is the root
          String linearizationParent = model
View Full Code Here

      ICDContentModel icdContentModel) {

    Collection ret = new ArrayList();

    for (Iterator it = icdCategories.iterator(); it.hasNext();) {
      RDFSNamedClass icdCategory = (RDFSNamedClass) it.next();
      String code = this.getClassCode(icdCategory, icdContentModel);
      if (!code.equals("TBD")) {
        if (!ret.contains(code)) {
          ret.add(code);
        }
View Full Code Here

  }

  // get generated codes for a original icd code
  private String getGeneratedCodeForICDCategoryCode(String code,
      Map mapGeneratedCodes) {
    RDFSNamedClass icdCategory = (RDFSNamedClass) this.mapAllExistingICDCodes
        .get(code);
    return (String) mapGeneratedCodes.get(icdCategory);
  }
View Full Code Here

      else
        ret = term;
    else {
      Collection parents = icdCategory.getSuperclasses(false);
      for (Iterator it = parents.iterator(); it.hasNext();) {
        RDFSNamedClass parent = (RDFSNamedClass) it.next();
        String pkind = (String) parent.getPropertyValue(icdContentModel
            .getKindProperty());
        if (pkind != null) {
          if (pkind.equals("chapter")) {
            ret = "block";
          } else {
View Full Code Here

    private Collection getSiblingClassesWithCodeTBD(RDFSNamedClass icdCategories){
     
      Collection ret = new ArrayList();
      Collection superclses = icdCategories.getSuperclasses(false);
      for(Iterator it = superclses.iterator(); it.hasNext();){
        RDFSNamedClass parent = (RDFSNamedClass) it.next();
        Collection subclses = parent.getSubclasses(false);
        for(Iterator it1 = subclses.iterator(); it1.hasNext();){
          RDFSNamedClass child = (RDFSNamedClass) it1.next();
          String childCode = this.getClassCode(child);
          if(childCode.equals("TBD")){
            ret.add(child);
            //System.out.println("childCode:" + childCode);
             
View Full Code Here

     
      Collection subclsCodes = new ArrayList();
      Object[] ret = null;
      Collection subclses = category.getSubclasses(false);
      for(Iterator it = subclses.iterator(); it.hasNext();){
        RDFSNamedClass subcls = (RDFSNamedClass) it.next();
        String subclsCode = this.getClassCode(subcls);
        subclsCodes.add(subclsCode);
      }
     
      ret = subclsCodes.toArray();
View Full Code Here

TOP

Related Classes of edu.stanford.smi.protegex.owl.model.RDFSNamedClass

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.