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

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


      String code = this.getClassCode(icdCategory);
     
      Collection superclses = icdCategory.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 subcls = (RDFSNamedClass) it1.next();
          String subclsCode = this.getClassCode(subcls);
          if(!subclsCode.equals("TBD")){
            retCode = subclsCode;
            break;
          }
View Full Code Here


    private String getOneParentCode(RDFSNamedClass icdCategory){
     
      String retCode = "TBD";
      Collection superclses = icdCategory.getSuperclasses(false);
      for(Iterator it = superclses.iterator(); it.hasNext();){
        RDFSNamedClass parent = (RDFSNamedClass) it.next();
        String parentCode = this.getClassCode(parent);
        if(!parentCode.equals("TBD")){
          retCode = parentCode;
          break;
        }
View Full Code Here

    private Collection getAllExistingICDCodes(Collection icdCategories){
     
      Collection ret = new ArrayList();
     
      for(Iterator it = icdCategories.iterator(); it.hasNext();){
        RDFSNamedClass icdCategory = (RDFSNamedClass) it.next();
        String code = this.getClassCode(icdCategory);
        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){
      RDFSNamedClass icdCategory = (RDFSNamedClass) this.mapAllExistingICDCodes.get(code);
      return (String) this.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{
                ret = "category";
View Full Code Here

        "XIX", "XX", "XXI", "XXII"};
   
    private Map generateTBDCodes(Collection icdCategories){
      Map ret = new HashMap();
      for(Iterator it = icdCategories.iterator(); it.hasNext();){
        RDFSNamedClass category = (RDFSNamedClass) it.next();
        String code = this.getClassCode(category);
       
        if(code.equals("TBD")){
         
          Collection superclses = category.getSuperclasses(false);
          if(superclses != null){
            int index = 1;
            for(Iterator it1 = superclses.iterator(); it1.hasNext();){
              RDFSNamedClass supercls = (RDFSNamedClass) it1.next();
              String supercode = this.getClassCode(supercls);
                            //subcode = supercode + tbdcodes[index-1];

                        System.out.println(code + "|" + supercode + "|" + category.getBrowserText() + "|" + supercls.getBrowserText());
                      
                            index++;
            }
          }
        }
View Full Code Here

   
    private void generateIndependentCode(Collection icdTopNodes){
     
      for(Iterator it = icdTopNodes.iterator(); it.hasNext();){
       
        RDFSNamedClass icdChapter = (RDFSNamedClass) it.next();
        String code = this.getClassCode(icdChapter);
       
      }
     
    }
View Full Code Here

    private void generateCodes(Collection icdCategories){
     
      Map mapCategoryLetter = new HashMap();
     
      for(Iterator it = icdCategories.iterator(); it.hasNext();){
        RDFSNamedClass icdCategory = (RDFSNamedClass) it.next();
       
        String code = this.getClassCode(icdCategory);
        //System.out.println(code + "|" + icdCategory.getBrowserText());
       
        if(code.equals("TBD")){
         
          //get all sibling classes with code tbd
          Collection siblingclses = this.getSiblingClassesWithCodeTBD(icdCategory);
          if(siblingclses != null){
            int index = 1;
           
            Map mapUsercodeCategory = new HashMap();
            Collection userCodes = new ArrayList();
         
            //loop once to get all others assigned
            for(Iterator it11 = siblingclses.iterator(); it11.hasNext();){
             
              RDFSNamedClass siblingcls = (RDFSNamedClass) it11.next();
           
             
             
              //if(siblingcls.getBrowserText().indexOf("LA10z0") >= 0 ||
                //siblingcls.getBrowserText().indexOf("LD32") >= 0){
              //System.out.println("sibling:" + siblingcls.getBrowserText());
              //}
             
              //get user assigned code
              //String usercode = this.getUserAssignedCodeForLabel(siblingcls);
              String usercode = siblingcls.getBrowserText();
              //String usercode = this.getSortingLabelForSubclass(siblingcls); // introducing sorting label
              String sortingLabel = this.getSortingLabelForSubclass(siblingcls);
              usercode = sortingLabel + usercode;
             
              if(!userCodes.contains(usercode))
                userCodes.add(usercode);
              if(!mapUsercodeCategory.containsKey(usercode))
                mapUsercodeCategory.put(usercode, siblingcls);
             
            }
                            //subcode = supercode + tbdcodes[index-1];

                        //System.out.println(code + "|" + supercode + "|" + category.getBrowserText() + "|" + supercls.getBrowserText());
                      
                            //index++;
         
           
            //sorting usercodes
            Object[] arrayUserCodes = userCodes.toArray();
            Arrays.sort(arrayUserCodes);
            for(int i = 0; i < arrayUserCodes.length; i++){
              String userCode = (String) arrayUserCodes[i];
              RDFSNamedClass theCategory = (RDFSNamedClass) mapUsercodeCategory.get(userCode);
              String letter = tbdcodes[i];

              this.assignCodeToCategory(theCategory, letter);
             
              if(!mapCategoryLetter.containsKey(theCategory)){
                mapCategoryLetter.put(theCategory, letter);
                //System.out.println(theCategory.getBrowserText() + "|" + letter); 
              }
             
            }
           
          }

        }
      }
     
      for(int h = 0; h < 20; h++){
     
      System.out.println("Num. Codes Not Assigned:" + colCodesNotAssigned.size());
      for(Iterator it2 = colCodesNotAssigned.iterator(); it2.hasNext();){
        RDFSNamedClass codeNotAssigned = (RDFSNamedClass) it2.next();
        String parentCode = this.getParentCode(codeNotAssigned);
        if(parentCode != null){
          String letter = (String) mapCategoryLetter.get(codeNotAssigned);
         
          String gCode = parentCode + "." + letter;
View Full Code Here

    }
   
    //generate block subcategory codes by top down approach
    private void generatedCodeForBlock(RDFSNamedClass child, String ppCode){
     
      RDFSNamedClass parent = this.getParentClass(child);
      Collection userCodes = new ArrayList();
      Map mapUserCodeCategory = new HashMap();
      Collection subclses = parent.getSubclasses(false);
      for(Iterator it = subclses.iterator(); it.hasNext();){
        RDFSNamedClass subcls = (RDFSNamedClass) it.next();
        String subclsCode = this.getClassCode(subcls);
       
        if(subclsCode.equals("TBD")){
       
        String userCode = subcls.getBrowserText();
        //String userCode = this.getSortingLabelForSubclass(subcls);
      String sortingLabel = this.getSortingLabelForSubclass(subcls);
      userCode = sortingLabel + userCode;
         
        if(!userCodes.contains(userCode)){
          userCodes.add(userCode);
        }
        if(!mapUserCodeCategory.containsKey(userCode)){
          mapUserCodeCategory.put(userCode,subcls);
        }
        }
       
       
      }
     
     
     
     
    //sorting usercodes
    Object[] arrayUserCodes = userCodes.toArray();
    Arrays.sort(arrayUserCodes);
    for(int i = 0; i < arrayUserCodes.length; i++){
      String letter = this.tbdcodes[i];
      String userCode = (String)arrayUserCodes[i];
      String gCode = ppCode + letter;
     
      if(this.colAllExistingICDCodes.contains(gCode)){
        gCode += "_" + letter; //uniqueness checking
      }
     
      RDFSNamedClass theCategory = (RDFSNamedClass)mapUserCodeCategory.get(userCode);
      if(!mapGeneratedCodes.containsKey(theCategory)){
        if(!mapGeneratedCodes.containsValue(gCode)){
          mapGeneratedCodes.put(theCategory, gCode);
        }else{
          mapGeneratedCodes.put(theCategory, gCode+letter);         
View Full Code Here

   
    private String getParentCode(RDFSNamedClass icdCategory){
      String ret = null;
      Collection parents = icdCategory.getSuperclasses(false);
      for(Iterator it = parents.iterator(); it.hasNext();){
        RDFSNamedClass parent = (RDFSNamedClass) it.next();
        //System.out.println("parent"  + parent.getBrowserText() + "|"
        //    + this.getUserAssignedCodeForLabel(parent));
       
       
        if(mapGeneratedCodes.containsKey(parent)){
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.