-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from DiSSCo/feature/agent-improvements
Support multiple agents parsing, eventType, media licenses
- Loading branch information
Showing
14 changed files
with
405 additions
and
61 deletions.
There are no files selected for viewing
13 changes: 7 additions & 6 deletions
13
.../core/translator/domain/AgenRoleType.java → ...core/translator/domain/AgentRoleType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
package eu.dissco.core.translator.domain; | ||
|
||
public enum AgenRoleType { | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public enum AgentRoleType { | ||
|
||
COLLECTOR("collector"), | ||
DATA_TRANSLATOR("data-translator"), | ||
CREATOR("creator"), | ||
IDENTIFIER("identifier"), | ||
GEOREFERENCER("georeferencer"); | ||
GEOREFERENCER("georeferencer"), | ||
RIGHTS_OWNER("rights-owner"); | ||
|
||
private final String name; | ||
|
||
AgenRoleType(String name) { | ||
AgentRoleType(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/eu/dissco/core/translator/terms/media/UsageTerms.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package eu.dissco.core.translator.terms.media; | ||
|
||
import com.fasterxml.jackson.databind.JsonNode; | ||
import eu.dissco.core.translator.terms.Term; | ||
import java.util.List; | ||
import lombok.extern.slf4j.Slf4j; | ||
|
||
@Slf4j | ||
public class UsageTerms extends Term { | ||
|
||
public static final String TERM = "xmpRights:UsageTerms"; | ||
private final List<String> dwcaTerms = List.of(TERM); | ||
|
||
@Override | ||
public String retrieveFromDWCA(JsonNode unit) { | ||
return super.searchJsonForTerm(unit, dwcaTerms); | ||
} | ||
|
||
@Override | ||
public String getTerm() { | ||
return TERM; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/main/java/eu/dissco/core/translator/terms/specimen/event/EventType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package eu.dissco.core.translator.terms.specimen.event; | ||
|
||
import com.fasterxml.jackson.databind.JsonNode; | ||
import eu.dissco.core.translator.terms.Term; | ||
import java.util.List; | ||
|
||
public class EventType extends Term { | ||
|
||
public static final String TERM = DWC_PREFIX + "eventType"; | ||
|
||
private final List<String> dwcaTerms = List.of(TERM); | ||
|
||
@Override | ||
public String retrieveFromDWCA(JsonNode unit) { | ||
var eventType = super.searchJsonForTerm(unit, dwcaTerms); | ||
if (eventType == null) { | ||
eventType = "Collecting Event"; | ||
} | ||
return eventType; | ||
} | ||
|
||
@Override | ||
public String getTerm() { | ||
return TERM; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.