001package org.gbif.dwc.terms;
002
003/**
004 * All Dublin Core terms with namespace http://purl.org/dc/terms/. A small subset of 15 terms exist as DcElement under
005 * a different namespace, but DcTerm values must be a member of a specific class and therefore given by URI, whereas
006 * DcElement values are allowed to be free text.
007 */
008public enum DcTerm implements Term, AlternativeNames {
009  abstract_,
010  accessRights,
011  accrualMethod,
012  accrualPeriodicity,
013  accrualPolicy,
014  alternative,
015  audience,
016  available,
017  bibliographicCitation,
018  conformsTo,
019  contributor,
020  coverage,
021  created,
022  creator,
023  date,
024  dateAccepted,
025  dateCopyrighted,
026  dateSubmitted,
027  description,
028  educationLevel,
029  extent,
030  format,
031  hasFormat,
032  hasPart,
033  hasVersion,
034  identifier("ID"),
035  instructionalMethod,
036  isFormatOf,
037  isPartOf,
038  isReferencedBy,
039  isReplacedBy,
040  isRequiredBy,
041  isVersionOf,
042  issued,
043  language,
044  license,
045  mediator,
046  medium,
047  modified,
048  provenance,
049  publisher,
050  references,
051  relation,
052  replaces,
053  requires,
054  rights,
055  rightsHolder,
056  source,
057  spatial,
058  subject,
059  tableOfContents,
060  temporal,
061  title,
062  type,
063  valid,
064  Location;
065
066  public static final String NS = "http://purl.org/dc/terms/";
067  public static final String PREFIX = "dcterms";
068  static final String[] PREFIXES = {NS, PREFIX + ":", "dct", "dcterm:"};
069
070  public final String[] alternatives;
071
072  public String toString() {
073    return PREFIX + ":" + this.name();
074  }
075
076  @Override
077  public String simpleName() {
078    if (this == abstract_) {
079      return "abstract";
080    }
081    return name();
082  }
083
084  @Override
085  public String[] alternativeNames() {
086    return alternatives;
087  }
088
089  @Override
090  public String qualifiedName() {
091    return NS + simpleName();
092  }
093
094  /**
095   * @return true if the dc term is defining a class instead of a property, e.g. Location
096   */
097  public boolean isClass() {
098    return Character.isUpperCase(simpleName().charAt(0));
099  }
100
101  private DcTerm(String... alternatives) {
102    this.alternatives = alternatives;
103  }
104
105}