Package org.cipres.treebase.domain.taxon

Examples of org.cipres.treebase.domain.taxon.SpecimenLabel


  public SpecimenLabelTest() {
    super();
  }

  public void testGetInfo() {
    SpecimenLabel label = null;
    while (label == null) {
      RowSegment seg = (RowSegment) loadRandomObject(RowSegment.class);
      label = seg.getSpecimenLabel();
    }
    assertNotNull(label.getInfo());
  }
View Full Code Here


  // @ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE})
  // @JoinColumn(name = "SPECIMENLABEL_ID", nullable = true)
  @Embedded
  public SpecimenLabel getSpecimenLabel() {
    if (mSpecimenLabel == null) {
      mSpecimenLabel = new SpecimenLabel();
    }
    return mSpecimenLabel;
  }
View Full Code Here

   * @return string with all available specimen label information
   * @author mjd 200810114
   */
  @Transient
  public String getSpecimenInfo() {
    SpecimenLabel sl = getSpecimenLabel();
    return sl == null ? null : sl.getInfo();
  }
View Full Code Here

   * @param tbSegment
   * @param xmlAnnotatable
   */
  private void copyDarwinCoreAnnotations(RowSegment tbSegment, Annotatable xmlAnnotatable) {
   
    SpecimenLabel tbSpec = tbSegment.getSpecimenLabel();   
    Map<String,String> predicateToObjectMap = new HashMap<String,String>();
   
    predicateToObjectMap.put("DwC:institutionCode", tbSpec.getInstAcronym());
    predicateToObjectMap.put("DwC:collectionCode", tbSpec.getCollectionCode());
    predicateToObjectMap.put("DwC:catalogNumber", tbSpec.getCatalogNumber());
    predicateToObjectMap.put("DwC:associatedSequences", tbSpec.getGenBankAccession());
    predicateToObjectMap.put("DwC:otherCatalogNumbers", tbSpec.getOtherAccession());
    predicateToObjectMap.put("DwC:eventDate", tbSpec.getSampleDateString());
    predicateToObjectMap.put("DwC:scientificName", tbSegment.getSpecimenTaxonLabelAsString());
    predicateToObjectMap.put("DwC:recordedBy", tbSpec.getCollector());
    predicateToObjectMap.put("DwC:country", tbSpec.getCountry());
    predicateToObjectMap.put("DwC:locality", tbSpec.getLocality());
    predicateToObjectMap.put("DwC:stateProvince", tbSpec.getState());
    predicateToObjectMap.put("DwC:datasetName", tbSegment.getTitle());
    predicateToObjectMap.put("DwC:occurenceRemarks", tbSpec.getNotes());
   
    for ( String predicate : predicateToObjectMap.keySet() ) {
      String objectString = predicateToObjectMap.get(predicate);
      if ( ! TreebaseUtil.isEmpty(objectString) ) {
        xmlAnnotatable.addAnnotationValue(predicate, Constants.DwCURI, objectString);
      }
    }

    //output geographic latitude in decimal degrees using geodeticDatum spatial reference system
    Double latitude = tbSpec.getLatitude();
    if ( null != latitude ) {     
      xmlAnnotatable.addAnnotationValue("DwC:decimalLatitude", Constants.DwCURI, latitude);
    }
   
    //output geographic longitude in decimal degrees using geodeticDatum spatial reference system
    Double longitude = tbSpec.getLongitude();
    if ( null != longitude ) {     
      xmlAnnotatable.addAnnotationValue("DwC:decimalLongitude", Constants.DwCURI, longitude);
    }
   
    //there are two different Darwin Core terms for elevation depending on elevation value
    //outputs geographic elevation of sample   
    Double elevation = tbSpec.getElevation();
    if ( null != elevation ) {
      if ( elevation >= 0) {
        //above local surface in meters
        xmlAnnotatable.addAnnotationValue("DwC:verbatimElevation", Constants.DwCURI, elevation);
      }
View Full Code Here

TOP

Related Classes of org.cipres.treebase.domain.taxon.SpecimenLabel

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.