001/*
002 * Copyright 2024 Global Biodiversity Information Facility (GBIF)
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.gbif.dwc.terms;
017
018import java.io.Serializable;
019import java.net.URI;
020
021/**
022 * All Germplasm terms with namespace http://purl.org/germplasm/germplasmTerm#.
023 */
024public enum GermplasmTerm implements Term, AlternativeNames, Serializable {
025  GermplasmAccession,
026  MeasurementScore,
027  MeasurementTrait,
028  MeasurementTrial,
029
030  acquisitionDate,
031  acquisitionID,
032  acquisitionRemarks,
033  acquisitionSource,
034  ancestralData,
035  biologicalStatus,
036  breedingCountry,
037  breedingCountryCode,
038  breedingID,
039  breedingIdentifier,
040  breedingInstitute,
041  breedingInstituteID,
042  breedingPerson,
043  breedingRemarks,
044  breedingYear,
045  collectingInstituteID,
046  donorInstitute,
047  donorInstituteID,
048  donorsID,
049  donorsIdentifier,
050  germplasmID,
051  germplasmIdentifier,
052  measurementByInstituteID,
053  measurementGrowthStage,
054  measurementTrailID,
055  measurementTrailIdentifier,
056  measurementTrailRemarks,
057  measurementTrailReport,
058  measurementTrailYear,
059  measurementTraitCategory,
060  measurementTraitID,
061  measurementTraitIdentifier,
062  measurementTraitName,
063  measurementTraitRemarks,
064  measurementTraitScale,
065  measurementTraitSource,
066  measurementTrialID,
067  measurementTrialIdentifier,
068  mlsStatus,
069  purdyPedigree,
070  safetyDuplicationDate,
071  safetyDuplicationID,
072  safetyDuplicationInstitute,
073  safetyDuplicationInstituteID,
074  safetyDuplicationRemarks,
075  storageCondition("http://purl.org/germplasm/germplasmType#storageCondition"),
076  treatyOrRegulationGoverningBody,
077  treatyOrRegulationID,
078  treatyOrRegulationName;
079
080  private static final String PREFIX = "germplasm";
081  private static final String NS = "http://purl.org/germplasm/germplasmTerm#";
082  private static final URI NS_URI = URI.create(NS);
083  public final String[] alternatives;
084
085  @Override
086  public String toString() {
087    return prefixedName();
088  }
089
090  @Override
091  public String simpleName() {
092    return name();
093  }
094
095  @Override
096  public String[] alternativeNames() {
097    return alternatives;
098  }
099
100  /**
101   * @return true if the germplasm term is defining a class instead of a property, e.g. GermplasmAccession
102   */
103  @Override
104  public boolean isClass() {
105    return Character.isUpperCase(simpleName().charAt(0));
106  }
107
108  @Override
109  public String prefix() {
110    return PREFIX;
111  }
112
113  @Override
114  public URI namespace() {
115    return NS_URI;
116  }
117
118  GermplasmTerm(String... alternatives) {
119    this.alternatives = alternatives;
120  }
121}