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

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


     
    }

    //get Parent Category
    private RDFSNamedClass getParentClass(RDFSNamedClass icdCategory){
      RDFSNamedClass 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


    }
   
    private void displayMultipleParents(Collection icdCategories){
     
      for(Iterator it = icdCategories.iterator(); it.hasNext();){
        RDFSNamedClass category = (RDFSNamedClass) it.next();
        String code = this.getClassCode(category);
        if(this.hasMultipleParents(category)){
          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(index + "|" + code + "|" + category.getBrowserText() + "|" + supercode + "|" + supercls.getBrowserText());
                      
                            index++;
            }
          }         
        }
View Full Code Here

   private String findSuperCode(RDFSNamedClass icdCategory){
    
     String ret = "TBD";
     Collection superclses = icdCategory.getSuperclasses(false);
     for(Iterator it = superclses.iterator(); it.hasNext();){
      RDFSNamedClass supercls = (RDFSNamedClass) it.next();
      String supercode = this.getClassCode(supercls);
      String code = this.getClassCode(icdCategory);
      String uSuperCode = supercode;
      String uCode = code;
View Full Code Here

    

       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(linearizationParent != null){
          
             if(linearization.getBrowserText().equals(type)){
             String code = this.getClassCode(linearizationParent);
             if(code.equals("TBD")){
              
               code = (String)this.mapGeneratedCodes.get(linearizationParent);
               ret = code;
               break;
             }else{
               ret = code;
               break;
             }
            }
           }else{ //no linear parent specified
           RDFSNamedClass parent = this.getRandomSingleParent(icdCategory); // get random single parent
           String code = this.getClassCode(parent);
           if(code.equals("TBD")){
            
             //if tbd, then get generated code
             ret = (String) this.mapGeneratedCodes.get(parent);
            
            
           }else{
             ret = code;
            
           }
                      
            
           }

       }    
     }else{ //having single parent
      

       RDFSNamedClass parent = this.getSingleParent(icdCategory);
       String code = this.getClassCode(parent);
       if(code.equals("TBD")){
        
         //if tbd, then get generated code
         ret = (String) this.mapGeneratedCodes.get(parent);
View Full Code Here

   private boolean isIncludedInLinearizationForType(RDFSNamedClass icdCategory, String type){
     boolean ret = false;
       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)){
             if(isIncludedInLinearization != null)
               ret = isIncludedInLinearization.booleanValue();
View Full Code Here

     
      Collection superclses = icdCategory.getSuperclasses(false);
      if(superclses != null){
        if(superclses.size() == 1){
        for(Iterator it = superclses.iterator(); it.hasNext();){
          RDFSNamedClass supercls = (RDFSNamedClass) it.next();
          String code = this.getClassCode(supercls);
          if(code.equals("TBD")){
            String generatedCode = (String) this.mapGeneratedCodes.get(supercls);
            if(generatedCode != null){
              code = generatedCode;
            }
          }
          ret.add(code);       
        }
        }else{ //if multiple parents
         
            for(Iterator it = superclses.iterator(); it.hasNext();){
              RDFSNamedClass supercls = (RDFSNamedClass) it.next();
              String supercode = this.getClassCode(supercls);
              String code = this.getClassCode(icdCategory);
              String uSuperCode = supercode;
              String uCode = code;
View Full Code Here

      Collection ret = new ArrayList();
     
      Collection subclses = icdCategory.getSubclasses(false);
      if(subclses != null){
        for(Iterator it = subclses.iterator(); it.hasNext();){
          RDFSNamedClass subcls = (RDFSNamedClass) it.next();
          String code = this.getClassCode(subcls);
          if(code.equals("TBD")){
            String generatedCode = (String) this.mapGeneratedCodes.get(subcls);
            if(generatedCode != null){
              code = generatedCode;
View Full Code Here

      Collection colSortingLabels = new ArrayList();
     
      Collection subclses = icdCategory.getSubclasses(false);
      if(subclses != null){
        for(Iterator it = subclses.iterator(); it.hasNext();){
          RDFSNamedClass subcls = (RDFSNamedClass) it.next();
          String sortingLabel = this.getSortingLabelForSubclass(subcls);
          String code = this.getClassCode(subcls);
          if(code.equals("TBD")){
            String generatedCode = (String) this.mapGeneratedCodes.get(subcls);
            if(generatedCode != null){
View Full Code Here

    }
   
   
    //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
   
    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

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.