001/*
002 * Copyright 2020 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.api.vocabulary;
017
018import static org.gbif.api.vocabulary.TagNamespace.*;
019
020/**
021 * Known {@link org.gbif.api.model.registry.MachineTag#getName()} name value.
022 * The tag names listed here are used/recognized by different services.
023 */
024public enum TagName {
025
026  /**
027   * The Darwin Core term datasetID which is found in dwc archives to reference subdatasets
028   * such as the Catalogue of Life GSDs. Stored in the registry to keep a mapping between the subdataset registry key
029   * and the dwca datasetID value.
030   *
031   * @see <a href="http://rs.tdwg.org/dwc/terms/datasetID">DWC Term</a>
032   * @see <a href="http://kos.gbif.org/wiki/Dwc:datasetID">KOS wiki</a>
033   */
034  DATASET_ID("dataset_id", GBIF_HARVESTING),
035
036  /**
037   * This is a counter starting at 1 incremented every time we try to crawl a dataset.
038   * This is even incremented when a crawl fails for any reason.
039   */
040  CRAWL_ATTEMPT("crawl_attempt", GBIF_CRAWLER),
041
042  /**
043   * <em>Datasets</em> marked with this tag will not be in the periodic crawl.
044   */
045  OMIT_FROM_SCHEDULED_CRAWL("omitFromScheduledCrawl", GBIF_CRAWLER),
046
047  /**
048   * Records the source of an archive endpoint, e.g. that it is from a BioCASe installation.
049   */
050  ARCHIVE_ORIGIN("archiveOrigin", GBIF_METASYNC),
051
052  /**
053   * TaPIR or BioCASe conceptual schema.
054   */
055  CONCEPTUAL_SCHEMA("conceptualSchema", GBIF_METASYNC),
056
057  /**
058   * Dataset title for BioCASe, no longer used.
059   */
060  @Deprecated
061  DATASET_TITLE("datasetTitle", GBIF_METASYNC),
062
063  /**
064   * Date the records in the dataset were last updated.
065   */
066  DATE_LAST_UPDATED("dateLastUpdated", GBIF_METASYNC),
067
068  /**
069   * Number of records declared in the dataset by the source.
070   */
071  DECLARED_COUNT("declaredCount", GBIF_METASYNC),
072
073  /**
074   * DiGIR code.
075   */
076  DIGIR_CODE("code", GBIF_METASYNC),
077
078  /**
079   * Not sure, no longer in use?
080   */
081  @Deprecated
082  LOCAL_ID("localId", GBIF_METASYNC),
083
084  /**
085   * Number of records to request in each search.
086   */
087  MAX_SEARCH_RESPONSE_RECORDS("maxSearchResponseRecords", GBIF_METASYNC),
088
089  /**
090   * Records whether an orphan dataset has been RESCUED.
091   */
092  ORPHAN_STATUS("status", GBIF_ORPHANS),
093
094  /**
095   * The endpoint which was not working when the dataset was rescued.
096   */
097  ORPHANED_ENDPOINT("orphanEndpoint", GBIF_ORPHANS),
098
099  /**
100   * The GBIF download used to rescue the orphaned dataset.
101   */
102  ORPHAN_DOWNLOAD("download", GBIF_ORPHANS),
103
104  /**
105   * The modification time of the last-available Darwin Core Archive from temporary storage,
106   * used to rescue the dataset.
107   */
108  ORPHAN_DWCA_CACHE_TIME("crawlerDwcaCacheTime", GBIF_ORPHANS);
109
110  private final String name;
111
112  private final TagNamespace namespace;
113
114  /**
115   * Default constructor.
116   *
117   * @param name      namespace value
118   * @param namespace, Enum namespace to which belongs the predicate
119   */
120  TagName(String name, TagNamespace namespace) {
121    this.name = name;
122    this.namespace = namespace;
123  }
124
125  /**
126   * Namespace to which belong this tag.
127   *
128   * @return the namespace
129   */
130  public TagNamespace getNamespace() {
131    return namespace;
132  }
133
134  /**
135   * Actual machine tag name.
136   *
137   * @return the machine tag name
138   */
139  public String getName() {
140    return name;
141  }
142
143}