001package org.gbif.dwc.terms;
002
003/**
004 * All Dublin Core terms with namespace http://purl.org/dc/elements/1.1/. All terms exist as DcTerm under a different
005 * namespace, but DcElement values are allowed to be free text, whereas DcTerm values must be a member of a specific
006 * class and therefore given by URI.
007 */
008public enum DcElement implements Term, AlternativeNames {
009  contributor,
010  coverage,
011  creator,
012  date,
013  description,
014  format,
015  identifier,
016  language,
017  publisher,
018  relation,
019  rights,
020  source,
021  subject,
022  title,
023  type;
024
025  public static final String NS = "http://purl.org/dc/elements/1.1/";
026  public static final String PREFIX = "dc";
027  static final String[] PREFIXES = {NS, PREFIX + ":"};
028
029  public final String[] alternatives;
030
031  public String toString() {
032    return NS + this.name();
033  }
034
035  @Override
036  public String simpleName() {
037    return name();
038  }
039
040  @Override
041  public String qualifiedName() {
042    return NS + simpleName();
043  }
044
045  @Override
046  public String[] alternativeNames() {
047    return alternatives;
048  }
049
050  /**
051   * @return true if the dc term is defining a class instead of a property, e.g. Location
052   */
053  public boolean isClass() {
054    return Character.isUpperCase(simpleName().charAt(0));
055  }
056
057  private DcElement(String... alternatives) {
058    this.alternatives = alternatives;
059  }
060}