Package edu.pitt.ontology

Examples of edu.pitt.ontology.IResource


  }

  public Concept lookupConcept(String cui) throws TerminologyException {
    if(ontology == null)
      return null;
    IResource cls = ontology.getResource(cui);
    return (cls != null && cls instanceof IClass)?((IClass)cls).getConcept():null;
  }
View Full Code Here


      lbl.setIcon(instanceIcon);
    else
      lbl.setIcon(null);
    // set text
    if(b instanceof IResource){
      IResource r = (IResource) b;
      //String [] l = r.getLabels();
      //lbl.setText((l.length > 0)?l[0]:r.getName());
      lbl.setText(r.getName());
    }else if(b instanceof Concept){
      lbl.setText(((Concept)b).getName());
    }   
    return lbl;
  }
View Full Code Here

    public void actionPerformed(ActionEvent e){
      String cmd = e.getActionCommand();
      if(cmd.equals("delete")){
        Object obj = list.getSelectedValue();
        if(obj != null && obj instanceof IResource){
          IResource r = (IResource) obj;
          int k = JOptionPane.showConfirmDialog(list,"Are you sure you want to delete "+r);
          if(k == JOptionPane.YES_OPTION){
            r.delete();
          }
        }
      }
    }
View Full Code Here

   
    // if no such resource, then add it
    if(!target.hasResource(src.getName())){
      dst = parent.createSubClass(src.getName());
    }else{
      IResource r = target.getResource(src.getName());
      if(r instanceof IClass){
        dst = (IClass) r;
      }else{
        System.err.println("Error: expecting a class "+src.getName()+" but got a "+r);
      }
View Full Code Here

  }

  public Concept lookupConcept(String cui) throws TerminologyException {
    //IClass cls = getClass(cui);
    //return (cls != null) ? cls.getConcept() : null;
    IResource cls = ontology.getResource(cui);
    return (cls != null && cls instanceof IClass)?((IClass)cls).getConcept():null;
  }
View Full Code Here

TOP

Related Classes of edu.pitt.ontology.IResource

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.