Package org.biojava.bio

Examples of org.biojava.bio.Annotation


     *
     * @return the definition of this {@link Term}.
     */
    public String getDefinition() {
      if (def == null) {
        Annotation annotation;
        Object definition;
        annotation = this.term.getAnnotation();
        definition = (annotation != null)
            && (annotation.keys().size() > 0) ? annotation
                .getProperty("def") : null;
                def = definition != null ? definition.toString() : "";
                def = def.replace("\\n", "\n").replace("\\t", "\t").replace("\\", "");
                def = def.trim();
      }
View Full Code Here


      else if (key.equals(NAME)){
        currentTerm.setDescription(value);
      } else if (key.equals(DEF)){
        //TODO
        // set definition
        Annotation anno = currentTerm.getAnnotation();       
        anno.setProperty(DEF, value);
      } else if (key.equals(XREF_ANALOG)){       
        // set xref analog
        Annotation anno = currentTerm.getAnnotation();       
        anno.setProperty(XREF_ANALOG, value);
      } else if (key.equals(IS_OBSOLETE)) {
        // ignore obsolete Terms...
        //System.out.println("obsolete: " + currentTerm);
        Annotation anno = currentTerm.getAnnotation();       
        anno.setProperty(IS_OBSOLETE, new Boolean(true));
       
      } else if (key.equals(IS_A) ||
          key.equals(RELATIONSHIP) ||
          key.equals(DISJOINT_FROM) ||
          key.equals(INTERSECTION_OF) ||
          key.equals(SUBSET)) {
        try {
          Term object = ontology.containsTerm(value) ?
            object = ontology.getTerm(value): ontology.createTerm(value);
          Term predicate = ontology.containsTerm(key) ? ontology.getTerm(key) : ontology.createTerm(key);
                 ontology.createTriple(currentTerm, object, predicate, currentTerm + " " + predicate + " " + object, key+"-relationship");             
        } catch (AlreadyExistsException ex) {
        }
               
      } else if (key.equals(COMMENT)){
        Annotation anno = currentTerm.getAnnotation();       
        anno.setProperty(COMMENT, value);
      } else if (key.equals(ALT_ID)){
        Annotation anno = currentTerm.getAnnotation();       
        anno.setProperty(ALT_ID, value);
      }
     
      else {
        //System.out.println("unknown key " + key);
      }
View Full Code Here

     *
     * @return the definition of this {@link Term}.
     */
    public String getDefinition() {
      if (def == null) {
        Annotation annotation;
        Object definition;
        annotation = this.term.getAnnotation();
        definition = (annotation != null)
            && (annotation.keys().size() > 0) ? annotation
            .getProperty("def") : null;
        def = definition != null ? definition.toString() : "";
        def = def.replace("\\n", "\n").replace("\\t", "\t").replace("\\", "");
        def = def.trim();
      }
View Full Code Here

     *
     * @return the definition of this {@link Term}.
     */
    public String getDefinition() {
      if (def == null) {
        Annotation annotation;
        Object definition;
        annotation = this.term.getAnnotation();
        definition = (annotation != null)
            && (annotation.keys().size() > 0) ? annotation
            .getProperty("def") : null;
        def = definition != null ? definition.toString() : "";
        def = def.replace("\\n", "\n").replace("\\t", "\t").replace("\\", "");
        def = def.trim();
      }
View Full Code Here

TOP

Related Classes of org.biojava.bio.Annotation

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.