-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature-FDS-829-component-requitrement-endpoint
- Loading branch information
Showing
65 changed files
with
293 additions
and
96 deletions.
There are no files selected for viewing
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
Validating CODEOWNERS rules …
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
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
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
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
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
47 changes: 47 additions & 0 deletions
47
...n/java/org/sagebionetworks/openchallenges/challenge/service/model/dto/EdamSectionDto.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,47 @@ | ||
package org.sagebionetworks.openchallenges.challenge.service.model.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonValue; | ||
import java.util.*; | ||
import javax.annotation.Generated; | ||
import javax.validation.constraints.*; | ||
|
||
/** The EDAM section (sub-ontology). */ | ||
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") | ||
public enum EdamSectionDto { | ||
DATA("data"), | ||
|
||
FORMAT("format"), | ||
|
||
IDENTIFIER("identifier"), | ||
|
||
OPERATION("operation"), | ||
|
||
TOPIC("topic"); | ||
|
||
private String value; | ||
|
||
EdamSectionDto(String value) { | ||
this.value = value; | ||
} | ||
|
||
@JsonValue | ||
public String getValue() { | ||
return value; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return String.valueOf(value); | ||
} | ||
|
||
@JsonCreator | ||
public static EdamSectionDto fromValue(String value) { | ||
for (EdamSectionDto b : EdamSectionDto.values()) { | ||
if (b.value.equals(value)) { | ||
return b; | ||
} | ||
} | ||
throw new IllegalArgumentException("Unexpected value '" + value + "'"); | ||
} | ||
} |
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
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
22 changes: 22 additions & 0 deletions
22
...sagebionetworks/openchallenges/challenge/service/model/search/EdamSectionValueBridge.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,22 @@ | ||
package org.sagebionetworks.openchallenges.challenge.service.model.search; | ||
|
||
import org.hibernate.search.mapper.pojo.bridge.ValueBridge; | ||
import org.hibernate.search.mapper.pojo.bridge.runtime.ValueBridgeToIndexedValueContext; | ||
import org.sagebionetworks.openchallenges.challenge.service.model.dto.EdamSectionDto; | ||
|
||
public class EdamSectionValueBridge implements ValueBridge<String, String> { | ||
|
||
@Override | ||
public String toIndexedValue(String value, ValueBridgeToIndexedValueContext context) { | ||
for (EdamSectionDto section : EdamSectionDto.values()) { | ||
// The first condition is used to map EDAM concept class IDs to concept sections when new | ||
// concept are created (e.g. during mass indexing). This value bridge is also called when | ||
// sending search queries to Elasticsearch, which is why the second condition is required to | ||
// map the user input to an existing EDAM concept. | ||
if (value.contains("/" + section.getValue() + "_") || section.getValue().equals(value)) { | ||
return section.getValue(); | ||
} | ||
} | ||
return null; | ||
} | ||
} |
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.