Skip to content

Commit

Permalink
cadc-datalink: update internal enum to match current vocab
Browse files Browse the repository at this point in the history
add static DataLink.Term.getTerm(String) utility method
  • Loading branch information
pdowler committed May 2, 2024
1 parent 9b9a053 commit a6ed704
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cadc-datalink/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sourceCompatibility = '1.8'

group = 'org.opencadc'

version = '1.1.1'
version = '1.1.2'

description = 'OpenCADC DataLink library'
def git_url = 'https://github.com/opencadc/dal'
Expand Down
37 changes: 23 additions & 14 deletions cadc-datalink/src/main/java/org/opencadc/datalink/DataLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,31 +83,31 @@ public class DataLink {
* Terms from the http://www.ivoa.net/rdf/datalink/core vocabulary
*/
public enum Term { // TODO: re-use the VocabularyTerm code once extracted from caom2
THIS("#this"),

PROGENITOR("#progenitor"),
DERIVATION("#derivation"),
DOCUMENTATION("#documentation"),

AUXILIARY("#auxiliary"),
WEIGHT("#weight"),
ERROR("#error"),
NOISE("#noise"),

CALIBRATION("#calibration"),
BIAS("#bias"),
CALIBRATION("#calibration"),
CODERIVED("#coderived"),
COUNTERPART("#counterpart"),
CUTOUT("#cutout"),
DARK("#dark"),
DERIVATION("#derivation"),
DETEACHED_HEADER("#detached-header"),
DOCUMENTATION("#documentation"),
ERROR("#error"),
FLAT("#flat"),

NOISE("#noise"),
PACKAGE("#package"),
PREVIEW("#preview"),
PREVIEW_IMAGE("#preview-image"),
PREVIEW_PLOT("#preview-plot"),
PROC("#proc"),
PROGENITOR("#progenitor"),
THIS("#this"),
THUMBNAIL("#thumbnail"),
WEIGHT("#weight");

PROC("#proc"),
CUTOUT("#cutout"),
PACKAGE("#package");

private final String value;

private Term(String value) {
Expand All @@ -117,6 +117,15 @@ private Term(String value) {
public String getValue() {
return value;
}

public static DataLink.Term getTerm(String s) {
for (Term t : values()) {
if (t.value.equals(s)) {
return t;
}
}
return null;
}
}

public enum LinkAuthTerm {
Expand Down

0 comments on commit a6ed704

Please sign in to comment.