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

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


        parseLabel(cls, term, id, labelElement);
        icdContentModel.addNotesToClass(cls, term);
    }

    private void parsePreferred2(RDFSNamedClass cls, String id, Element labelElement) {
        RDFResource term = icdContentModel.createICD10NotesTerm();
        parseLabel(cls, term, id, labelElement);
        icdContentModel.addPreferredToClass(cls, term);
    }
View Full Code Here


        parseLabel(cls, term, id, labelElement);
        icdContentModel.addPreferredToClass(cls, term);
    }

    private void parsePreferredLong(RDFSNamedClass cls, String id, Element labelElement) {
        RDFResource term = icdContentModel.createICD10NotesTerm();
        parseLabel(cls, term, id, labelElement);
        icdContentModel.addPreferredLongToClass(cls, term);
    }
View Full Code Here

    private void parseRefElement(RDFResource term, Element refElement) {
        String code = refElement.getAttributeValue(ClamlConstants.CODE_ATTR);
        String usage = refElement.getAttributeValue(ClamlConstants.USAGE_ATTR);
        String text = refElement.getTextTrim();
        RDFResource ref = icdContentModel.createClamlReference();
        icdContentModel.fillClamlReference(ref, text, usage, code);
        icdContentModel.addClamlRefToTerm(term, ref);
    }
View Full Code Here

      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)){
View Full Code Here

            icdContentModel);
        if (definitions != null) {

          for (Iterator itdef = definitions.iterator(); itdef
              .hasNext();) {
            RDFResource defTerm = (RDFResource) itdef.next();

            String defText = this.getDefinitionTermText(defTerm,
                icdContentModel);
            String defRubricID = this.getTermRubricID(defTerm,
                icdContentModel);
            if (defText != null) {
              sb.append(this.getClaMLDefinition(defRubricID, defText));
            }
          }
        }

        // Inclusion
        Collection colInclusions = this.getInclusionTerms(icdCategory,
            icdContentModel);

        Collection colSortedInclusions = new ArrayList();
        Map mapSortedInclusions = new HashMap();

        if (colInclusions != null) {
          for (Iterator it3 = colInclusions.iterator(); it3.hasNext();) {
            RDFResource inclusion = (RDFResource) it3.next();

            String inclusionLabel = this.getInclusionTermText(
                inclusion, icdContentModel);
            String inclusionId = this.getTermRubricID(inclusion,
                icdContentModel);

            String inclusionLabelId = inclusionLabel + "|"
                + inclusionId;
            colSortedInclusions.add(inclusionLabelId);
            mapSortedInclusions.put(inclusionLabelId, inclusion);
          }

          // alphabetically sort the rubrics
          Object[] arraySortedInclusions = colSortedInclusions.toArray();
          List listSortedInclusions = Arrays.asList(arraySortedInclusions);
          Collections.sort(listSortedInclusions,String.CASE_INSENSITIVE_ORDER);
          for (ListIterator li0 = listSortedInclusions.listIterator(); li0.hasNext();) {
            String sortedInclusionLabelId = (String) li0.next();
            String[] labelId = sortedInclusionLabelId.split("\\|");
            RDFResource sortedInclusion = (RDFResource) mapSortedInclusions
                .get(sortedInclusionLabelId);

            Collection<RDFResource> clamlRefCodes = this.getTermClaMLReferences(sortedInclusion, icdContentModel);
           
             
            StringBuffer refCodeInclusion = new StringBuffer();;

            try {
              if (clamlRefCodes != null) {
                for (RDFResource clamlRefCode : clamlRefCodes) {

                  String thisCode = (String) clamlRefCode
                      .getPropertyValue(icdContentModel
                          .getTextProperty());
                  if (thisCode.indexOf("-") >= 0) {
                    thisCode = this
                        .getCodeFromLabel(thisCode);
                  }

                  String thisGeneratedCode = this
                      .getGeneratedCodeForICDCategoryCode(
                          thisCode, mapGeneratedCodes);
                  if (thisGeneratedCode == null) {
                    thisGeneratedCode = thisCode;
                  }

                  refCodeInclusion.append(this.getClaMLReferenceCode(thisGeneratedCode));
                 
                  //sb.append(this.getClaMLInclusionLabel(labelId[1],labelId[0], thisGeneratedCode));

                }
              }
             
            } catch (Exception e) {
              //e.printStackTrace();
              continue;
            }
           
           
            if(refCodeInclusion.toString().length() < 1){
              sb.append(this.getClaMLInclusionLabel(labelId[1], labelId[0]));
            }else{
             
              sb.append(this.getClaMLInclusionLabel(labelId[1],
                  labelId[0], refCodeInclusion.toString()));
            }
           

          }
        }

        // exclusion terms
        Collection colExclusions = this.getExclusionTerms(icdCategory,
            icdContentModel);

        Collection<String> colSortedExclusions = new ArrayList();
        Map<String, RDFResource> mapSortedExclusions = new HashMap();

        if (colExclusions != null) {
          for (Iterator it4 = colExclusions.iterator(); it4.hasNext();) {
            RDFResource exclusion = (RDFResource) it4.next();
            String exclusionLabel = this.getExclusionTermText(
                exclusion, icdContentModel);
            String exclusionId = this.getTermRubricID(exclusion,
                icdContentModel);

            String exclusionLabelId = exclusionLabel + "|"
                + exclusionId;
            colSortedExclusions.add(exclusionLabelId);
            mapSortedExclusions.put(exclusionLabelId, exclusion);

          }
          // alphabetically sort the rubrics
          Object[] arraySortedExclusions = colSortedExclusions
              .toArray();
          List listSortedExclusions = Arrays
              .asList(arraySortedExclusions);
          Collections.sort(listSortedExclusions,
              String.CASE_INSENSITIVE_ORDER);
          for (ListIterator li1 = listSortedExclusions.listIterator(); li1
              .hasNext();) {
            // for(int jj = 0; jj < arraySortedExclusions.length;
            // jj++){
            String sortedExclusionLabelId = (String) li1.next();

            String[] labelId = sortedExclusionLabelId.split("\\|");
            RDFResource sortedExclusion = (RDFResource) mapSortedExclusions
                .get(sortedExclusionLabelId);

            Collection<RDFResource> clamlRefCodes = this
                .getTermClaMLReferences(sortedExclusion,
                    icdContentModel);
View Full Code Here

  private String getClassPreferredLabelRubricID(RDFSNamedClass icdCategory,
      ICDContentModel icdContentModel) {

    String ret = "";
    RDFResource term = icdContentModel.getTerm(icdCategory, icdContentModel
        .getIcdTitleProperty());
    if (term != null) {
      ret = (String) term.getPropertyValue(icdContentModel
          .getIdProperty());
    } else {
      ret = "TBD";
    }
View Full Code Here

  private String getClassPreferredLabel(RDFSNamedClass icdCategory,
      ICDContentModel icdContentModel) {

    String ret = "";
    RDFResource term = icdContentModel.getTerm(icdCategory, icdContentModel
        .getIcdTitleProperty());
    if (term != null)
      ret = term.getBrowserText();
    else
      ret = "TBD";

    return ret;
View Full Code Here

     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(linearizationParent != null){
          
             if(linearization.getBrowserText().equals(type)){
             String code = this.getClassCode(linearizationParent);
             if(code.equals("TBD")){
              
               code = (String)this.mapGeneratedCodes.get(linearizationParent);
               ret = code;
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();
           //should deal with null situtation later
             break;
           }
View Full Code Here

      Collection ret = new ArrayList();
     
      Collection synonyms = icdContentModel.getTerms(icdCategory, icdContentModel.getSynonymProperty());
      if(synonyms != null){
        for(Iterator it = synonyms.iterator(); it.hasNext();){
          RDFResource synonym = (RDFResource) it.next();
          ret.add(synonym.getPropertyValue(icdContentModel.getSynonymProperty()));
       
        }
      }
     
      return ret;   
View Full Code Here

TOP

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

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.