From 6faa151e061de61329a30bb895937e1ec0e7c9c4 Mon Sep 17 00:00:00 2001 From: Thomas Schaffter Date: Fri, 10 May 2024 06:23:41 -0700 Subject: [PATCH] feat(openchallenges): filter challenges by Operation (backend) (#2665) --- .../.openapi-generator/FILES | 1 - .../challenge-service/requests.http | 4 + .../service/api/ChallengeApiDelegate.java | 2 +- .../service/model/dto/ChallengeDto.java | 8 +- .../model/dto/ChallengeSearchQueryDto.java | 37 +++++++ .../service/model/dto/EdamOperationDto.java | 104 ------------------ .../service/model/entity/ChallengeEntity.java | 4 +- .../model/entity/EdamOperationEntity.java | 37 ------- .../service/model/mapper/ChallengeMapper.java | 3 +- .../model/mapper/EdamOperationMapper.java | 26 ----- .../CustomChallengeRepositoryImpl.java | 14 +++ .../src/main/resources/openapi.yaml | 32 ++---- .../build/challenge.openapi.yaml | 24 +--- .../api-description/build/openapi.yaml | 24 +--- .../src/components/schemas/Challenge.yaml | 2 +- .../schemas/ChallengeSearchQuery.yaml | 5 + 16 files changed, 90 insertions(+), 237 deletions(-) delete mode 100644 apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/dto/EdamOperationDto.java delete mode 100644 apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/entity/EdamOperationEntity.java delete mode 100644 apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/mapper/EdamOperationMapper.java diff --git a/apps/openchallenges/challenge-service/.openapi-generator/FILES b/apps/openchallenges/challenge-service/.openapi-generator/FILES index d6cff016a6..0541d3df4a 100644 --- a/apps/openchallenges/challenge-service/.openapi-generator/FILES +++ b/apps/openchallenges/challenge-service/.openapi-generator/FILES @@ -43,7 +43,6 @@ src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/dto/Eda src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/dto/EdamConceptSearchQueryDto.java src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/dto/EdamConceptSortDto.java src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/dto/EdamConceptsPageDto.java -src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/dto/EdamOperationDto.java src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/dto/EdamSectionDto.java src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/dto/PageMetadataDto.java src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/dto/SimpleChallengePlatformDto.java diff --git a/apps/openchallenges/challenge-service/requests.http b/apps/openchallenges/challenge-service/requests.http index f86f70eb94..fe19af5c2c 100644 --- a/apps/openchallenges/challenge-service/requests.http +++ b/apps/openchallenges/challenge-service/requests.http @@ -44,6 +44,10 @@ GET {{basePath}}/challenges?searchTerms=mortality%20dream GET {{basePath}}/challenges?minStartDate=2017-01-01&maxStartDate=2017-12-31 +### List the challenges that have their operation ID set to 2230. + +GET {{basePath}}/challenges?operations=2230 + ### Get the challenges whose input data types include the EDAM concept ID 2 or 18 GET {{basePath}}/challenges?inputDataTypes=2,18 diff --git a/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/api/ChallengeApiDelegate.java b/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/api/ChallengeApiDelegate.java index e6c674a24f..8ec9197661 100644 --- a/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/api/ChallengeApiDelegate.java +++ b/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/api/ChallengeApiDelegate.java @@ -36,7 +36,7 @@ default ResponseEntity getChallenge(Long challengeId) { for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = - "{ \"avatarUrl\" : \"https://openchallenges.io\", \"endDate\" : \"2017-07-21T00:00:00.000+00:00\", \"description\" : \"This is an example description of the challenge.\", \"platform\" : { \"name\" : \"name\", \"id\" : 1, \"slug\" : \"example-challenge-platform\" }, \"starredCount\" : 100, \"createdAt\" : \"2022-07-04T22:19:11Z\", \"incentives\" : [ \"publication\", \"publication\" ], \"submissionTypes\" : [ \"container_image\", \"container_image\" ], \"websiteUrl\" : \"https://openchallenges.io\", \"name\" : \"name\", \"id\" : 1, \"categories\" : [ \"featured\", \"featured\" ], \"headline\" : \"Example challenge headline\", \"operation\" : { \"classId\" : \"http://edamontology.org/operation_0230\", \"preferredLabel\" : \"Sequence generation\" }, \"slug\" : \"awesome-challenge\", \"startDate\" : \"2017-07-21T00:00:00.000+00:00\", \"doi\" : \"https://doi.org/123/abc\", \"status\" : \"active\", \"inputDataTypes\" : [ { \"classId\" : \"http://edamontology.org/data_0850\", \"preferredLabel\" : \"Sequence set\", \"id\" : 1 }, { \"classId\" : \"http://edamontology.org/data_0850\", \"preferredLabel\" : \"Sequence set\", \"id\" : 1 } ], \"updatedAt\" : \"2022-07-04T22:19:11Z\" }"; + "{ \"avatarUrl\" : \"https://openchallenges.io\", \"endDate\" : \"2017-07-21T00:00:00.000+00:00\", \"description\" : \"This is an example description of the challenge.\", \"platform\" : { \"name\" : \"name\", \"id\" : 1, \"slug\" : \"example-challenge-platform\" }, \"starredCount\" : 100, \"createdAt\" : \"2022-07-04T22:19:11Z\", \"incentives\" : [ \"publication\", \"publication\" ], \"submissionTypes\" : [ \"container_image\", \"container_image\" ], \"websiteUrl\" : \"https://openchallenges.io\", \"name\" : \"name\", \"id\" : 1, \"categories\" : [ \"featured\", \"featured\" ], \"headline\" : \"Example challenge headline\", \"operation\" : { \"classId\" : \"http://edamontology.org/data_0850\", \"preferredLabel\" : \"Sequence set\", \"id\" : 1 }, \"slug\" : \"awesome-challenge\", \"startDate\" : \"2017-07-21T00:00:00.000+00:00\", \"doi\" : \"https://doi.org/123/abc\", \"status\" : \"active\", \"inputDataTypes\" : [ { \"classId\" : \"http://edamontology.org/data_0850\", \"preferredLabel\" : \"Sequence set\", \"id\" : 1 }, { \"classId\" : \"http://edamontology.org/data_0850\", \"preferredLabel\" : \"Sequence set\", \"id\" : 1 } ], \"updatedAt\" : \"2022-07-04T22:19:11Z\" }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } diff --git a/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/dto/ChallengeDto.java b/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/dto/ChallengeDto.java index e8ff9c2a4b..efd57938c3 100644 --- a/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/dto/ChallengeDto.java +++ b/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/dto/ChallengeDto.java @@ -79,7 +79,7 @@ public class ChallengeDto { private Integer starredCount = 0; @JsonProperty("operation") - private EdamOperationDto operation = null; + private EdamConceptDto operation = null; @JsonProperty("createdAt") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) @@ -510,7 +510,7 @@ public void setStarredCount(Integer starredCount) { this.starredCount = starredCount; } - public ChallengeDto operation(EdamOperationDto operation) { + public ChallengeDto operation(EdamConceptDto operation) { this.operation = operation; return this; } @@ -522,11 +522,11 @@ public ChallengeDto operation(EdamOperationDto operation) { */ @Valid @Schema(name = "operation", required = false) - public EdamOperationDto getOperation() { + public EdamConceptDto getOperation() { return operation; } - public void setOperation(EdamOperationDto operation) { + public void setOperation(EdamConceptDto operation) { this.operation = operation; } diff --git a/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/dto/ChallengeSearchQueryDto.java b/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/dto/ChallengeSearchQueryDto.java index 2ac7d2aece..d6b67ad628 100644 --- a/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/dto/ChallengeSearchQueryDto.java +++ b/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/dto/ChallengeSearchQueryDto.java @@ -67,6 +67,10 @@ public class ChallengeSearchQueryDto { @Valid private List inputDataTypes = null; + @JsonProperty("operations") + @Valid + private List operations = null; + @JsonProperty("categories") @Valid private List categories = null; @@ -413,6 +417,36 @@ public void setInputDataTypes(List inputDataTypes) { this.inputDataTypes = inputDataTypes; } + public ChallengeSearchQueryDto operations(List operations) { + this.operations = operations; + return this; + } + + public ChallengeSearchQueryDto addOperationsItem(Long operationsItem) { + if (this.operations == null) { + this.operations = new ArrayList<>(); + } + this.operations.add(operationsItem); + return this; + } + + /** + * An array of EDAM concept ID used to filter the results. + * + * @return operations + */ + @Schema( + name = "operations", + description = "An array of EDAM concept ID used to filter the results.", + required = false) + public List getOperations() { + return operations; + } + + public void setOperations(List operations) { + this.operations = operations; + } + public ChallengeSearchQueryDto categories(List categories) { this.categories = categories; return this; @@ -489,6 +523,7 @@ public boolean equals(Object o) { && Objects.equals(this.status, challengeSearchQuery.status) && Objects.equals(this.submissionTypes, challengeSearchQuery.submissionTypes) && Objects.equals(this.inputDataTypes, challengeSearchQuery.inputDataTypes) + && Objects.equals(this.operations, challengeSearchQuery.operations) && Objects.equals(this.categories, challengeSearchQuery.categories) && Objects.equals(this.searchTerms, challengeSearchQuery.searchTerms); } @@ -509,6 +544,7 @@ public int hashCode() { status, submissionTypes, inputDataTypes, + operations, categories, searchTerms); } @@ -530,6 +566,7 @@ public String toString() { sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" submissionTypes: ").append(toIndentedString(submissionTypes)).append("\n"); sb.append(" inputDataTypes: ").append(toIndentedString(inputDataTypes)).append("\n"); + sb.append(" operations: ").append(toIndentedString(operations)).append("\n"); sb.append(" categories: ").append(toIndentedString(categories)).append("\n"); sb.append(" searchTerms: ").append(toIndentedString(searchTerms)).append("\n"); sb.append("}"); diff --git a/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/dto/EdamOperationDto.java b/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/dto/EdamOperationDto.java deleted file mode 100644 index eccc501a9d..0000000000 --- a/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/dto/EdamOperationDto.java +++ /dev/null @@ -1,104 +0,0 @@ -package org.sagebionetworks.openchallenges.challenge.service.model.dto; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.v3.oas.annotations.media.Schema; -import java.util.*; -import java.util.Objects; -import javax.annotation.Generated; -import javax.validation.constraints.*; - -/** The EDAM Operation concept. */ -@Schema(name = "EdamOperation", description = "The EDAM Operation concept.") -@JsonTypeName("EdamOperation") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -// TODO Add x-java-class-annotations -public class EdamOperationDto { - - @JsonProperty("classId") - private String classId; - - @JsonProperty("preferredLabel") - private String preferredLabel; - - public EdamOperationDto classId(String classId) { - this.classId = classId; - return this; - } - - /** - * Get classId - * - * @return classId - */ - @NotNull - @Pattern(regexp = "^http://edamontology\\.org/operation_\\d+$") - @Size(max = 60) - @Schema(name = "classId", example = "http://edamontology.org/operation_0230", required = true) - public String getClassId() { - return classId; - } - - public void setClassId(String classId) { - this.classId = classId; - } - - public EdamOperationDto preferredLabel(String preferredLabel) { - this.preferredLabel = preferredLabel; - return this; - } - - /** - * Get preferredLabel - * - * @return preferredLabel - */ - @NotNull - @Size(max = 80) - @Schema(name = "preferredLabel", example = "Sequence generation", required = true) - public String getPreferredLabel() { - return preferredLabel; - } - - public void setPreferredLabel(String preferredLabel) { - this.preferredLabel = preferredLabel; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EdamOperationDto edamOperation = (EdamOperationDto) o; - return Objects.equals(this.classId, edamOperation.classId) - && Objects.equals(this.preferredLabel, edamOperation.preferredLabel); - } - - @Override - public int hashCode() { - return Objects.hash(classId, preferredLabel); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EdamOperationDto {\n"); - sb.append(" classId: ").append(toIndentedString(classId)).append("\n"); - sb.append(" preferredLabel: ").append(toIndentedString(preferredLabel)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/entity/ChallengeEntity.java b/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/entity/ChallengeEntity.java index 32e9296e3b..1ebc2256d4 100644 --- a/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/entity/ChallengeEntity.java +++ b/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/entity/ChallengeEntity.java @@ -133,9 +133,9 @@ public class ChallengeEntity { @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "operation_id", nullable = true) - @IndexedEmbedded(includePaths = {"class_id", "preferred_label"}) + @IndexedEmbedded(includePaths = {"id", "class_id", "preferred_label"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) - private EdamOperationEntity operation; + private EdamConceptEntity operation; @Column(name = "created_at") @GenericField(name = "created_at", sortable = Sortable.YES) diff --git a/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/entity/EdamOperationEntity.java b/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/entity/EdamOperationEntity.java deleted file mode 100644 index 0ebd85ba21..0000000000 --- a/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/entity/EdamOperationEntity.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.sagebionetworks.openchallenges.challenge.service.model.entity; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField; -import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; - -@Entity -@Table(name = "edam_concept") -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Indexed(index = "openchallenges-edam-operation") -public class EdamOperationEntity { - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(nullable = false, updatable = false) - private Long id; - - @Column(name = "class_id", nullable = false) - @FullTextField(name = "class_id") - private String classId; - - @Column(name = "preferred_label", nullable = false) - @FullTextField(name = "preferred_label") - private String preferredLabel; -} diff --git a/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/mapper/ChallengeMapper.java b/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/mapper/ChallengeMapper.java index 364708362b..ead4343098 100644 --- a/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/mapper/ChallengeMapper.java +++ b/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/mapper/ChallengeMapper.java @@ -16,7 +16,6 @@ public class ChallengeMapper extends BaseMapper { private static final Logger LOG = LoggerFactory.getLogger(ChallengeMapper.class); private SimpleChallengePlatformMapper platformMapper = new SimpleChallengePlatformMapper(); - private EdamOperationMapper edamOperationMapper = new EdamOperationMapper(); private EdamConceptMapper edamConceptMapper = new EdamConceptMapper(); @Override @@ -38,7 +37,7 @@ public ChallengeDto convertToDto(ChallengeEntity entity, Object... args) { dto.setStatus(ChallengeStatusDto.fromValue(entity.getStatus())); dto.setPlatform(platformMapper.convertToDto(entity.getPlatform())); if (entity.getOperation() != null) { - dto.setOperation(edamOperationMapper.convertToDto(entity.getOperation())); + dto.setOperation(edamConceptMapper.convertToDto(entity.getOperation())); } dto.submissionTypes( entity.getSubmissionTypes().stream() diff --git a/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/mapper/EdamOperationMapper.java b/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/mapper/EdamOperationMapper.java deleted file mode 100644 index a6b629ec37..0000000000 --- a/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/mapper/EdamOperationMapper.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.sagebionetworks.openchallenges.challenge.service.model.mapper; - -import org.sagebionetworks.openchallenges.challenge.service.model.dto.EdamOperationDto; -import org.sagebionetworks.openchallenges.challenge.service.model.entity.EdamOperationEntity; -import org.sagebionetworks.util.model.mapper.BaseMapper; -import org.springframework.beans.BeanUtils; - -public class EdamOperationMapper extends BaseMapper { - @Override - public EdamOperationEntity convertToEntity(EdamOperationDto dto, Object... args) { - EdamOperationEntity entity = new EdamOperationEntity(); - if (dto != null) { - BeanUtils.copyProperties(dto, entity); - } - return entity; - } - - @Override - public EdamOperationDto convertToDto(EdamOperationEntity entity, Object... args) { - EdamOperationDto dto = new EdamOperationDto(); - if (entity != null) { - BeanUtils.copyProperties(entity, dto); - } - return dto; - } -} diff --git a/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/repository/CustomChallengeRepositoryImpl.java b/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/repository/CustomChallengeRepositoryImpl.java index c56775234d..3031e4f4aa 100644 --- a/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/repository/CustomChallengeRepositoryImpl.java +++ b/apps/openchallenges/challenge-service/src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/repository/CustomChallengeRepositoryImpl.java @@ -79,6 +79,9 @@ private SearchResult getSearchResult( if (query.getCategories() != null && !query.getCategories().isEmpty()) { predicates.add(getCategoriesPredicate(pf, query)); } + if (query.getOperations() != null && !query.getOperations().isEmpty()) { + predicates.add(getChallengeOperationPredicate(pf, query)); + } SearchSort sort = getSearchSort(sf, query); SearchPredicate sortPredicate = getSearchSortPredicate(pf, query); @@ -150,6 +153,17 @@ private SearchPredicate getChallengePlatformPredicate( .toPredicate(); } + private SearchPredicate getChallengeOperationPredicate( + SearchPredicateFactory pf, ChallengeSearchQueryDto query) { + return pf.bool( + b -> { + for (Long operation : query.getOperations()) { + b.should(pf.match().field("operation.id").matching(operation)); + } + }) + .toPredicate(); + } + /** * Matches the challenges whose at least one of their submission types is in the list of * submission types specified. diff --git a/apps/openchallenges/challenge-service/src/main/resources/openapi.yaml b/apps/openchallenges/challenge-service/src/main/resources/openapi.yaml index c35003d0cb..d17ce86422 100644 --- a/apps/openchallenges/challenge-service/src/main/resources/openapi.yaml +++ b/apps/openchallenges/challenge-service/src/main/resources/openapi.yaml @@ -489,6 +489,11 @@ components: items: $ref: '#/components/schemas/EdamConceptId' type: array + operations: + description: An array of EDAM concept ID used to filter the results. + items: + $ref: '#/components/schemas/EdamConceptId' + type: array categories: description: The array of challenge categories used to filter the results. items: @@ -660,26 +665,6 @@ components: format: date nullable: true type: string - EdamOperation: - description: The EDAM Operation concept. - example: - classId: http://edamontology.org/operation_0230 - preferredLabel: Sequence generation - nullable: true - properties: - classId: - example: http://edamontology.org/operation_0230 - maxLength: 60 - pattern: ^http:\/\/edamontology\.org\/operation_\d+$ - type: string - preferredLabel: - example: Sequence generation - maxLength: 80 - type: string - required: - - classId - - preferredLabel - type: object CreatedDateTime: description: Datetime when the object was added to the database. example: 2022-07-04T22:19:11Z @@ -716,8 +701,9 @@ components: - featured headline: Example challenge headline operation: - classId: http://edamontology.org/operation_0230 - preferredLabel: Sequence generation + classId: http://edamontology.org/data_0850 + preferredLabel: Sequence set + id: 1 slug: awesome-challenge startDate: 2017-07-21T00:00:00.000+00:00 doi: https://doi.org/123/abc @@ -821,7 +807,7 @@ components: minimum: 0 type: integer operation: - $ref: '#/components/schemas/EdamOperation' + $ref: '#/components/schemas/EdamConcept' createdAt: description: Datetime when the object was added to the database. example: 2022-07-04T22:19:11Z diff --git a/libs/openchallenges/api-description/build/challenge.openapi.yaml b/libs/openchallenges/api-description/build/challenge.openapi.yaml index 3f3fb78331..d8f1ab0dae 100644 --- a/libs/openchallenges/api-description/build/challenge.openapi.yaml +++ b/libs/openchallenges/api-description/build/challenge.openapi.yaml @@ -303,6 +303,11 @@ components: type: array items: $ref: '#/components/schemas/EdamConceptId' + operations: + description: An array of EDAM concept ID used to filter the results. + type: array + items: + $ref: '#/components/schemas/EdamConceptId' categories: description: The array of challenge categories used to filter the results. type: array @@ -451,23 +456,6 @@ components: format: date nullable: true example: '2017-07-21' - EdamOperation: - type: object - description: The EDAM Operation concept. - properties: - classId: - type: string - example: http://edamontology.org/operation_0230 - maxLength: 60 - pattern: ^http:\/\/edamontology\.org\/operation_\d+$ - preferredLabel: - type: string - example: Sequence generation - maxLength: 80 - required: - - classId - - preferredLabel - nullable: true CreatedDateTime: description: Datetime when the object was added to the database. type: string @@ -529,7 +517,7 @@ components: minimum: 0 example: 100 operation: - $ref: '#/components/schemas/EdamOperation' + $ref: '#/components/schemas/EdamConcept' createdAt: $ref: '#/components/schemas/CreatedDateTime' updatedAt: diff --git a/libs/openchallenges/api-description/build/openapi.yaml b/libs/openchallenges/api-description/build/openapi.yaml index 90d2eacd5e..b062d5c75b 100644 --- a/libs/openchallenges/api-description/build/openapi.yaml +++ b/libs/openchallenges/api-description/build/openapi.yaml @@ -453,6 +453,11 @@ components: type: array items: $ref: '#/components/schemas/EdamConceptId' + operations: + description: An array of EDAM concept ID used to filter the results. + type: array + items: + $ref: '#/components/schemas/EdamConceptId' categories: description: The array of challenge categories used to filter the results. type: array @@ -601,23 +606,6 @@ components: format: date nullable: true example: '2017-07-21' - EdamOperation: - type: object - description: The EDAM Operation concept. - properties: - classId: - type: string - example: 'http://edamontology.org/operation_0230' - maxLength: 60 - pattern: '^http:\/\/edamontology\.org\/operation_\d+$' - preferredLabel: - type: string - example: Sequence generation - maxLength: 80 - required: - - classId - - preferredLabel - nullable: true CreatedDateTime: description: Datetime when the object was added to the database. type: string @@ -679,7 +667,7 @@ components: minimum: 0 example: 100 operation: - $ref: '#/components/schemas/EdamOperation' + $ref: '#/components/schemas/EdamConcept' createdAt: $ref: '#/components/schemas/CreatedDateTime' updatedAt: diff --git a/libs/openchallenges/api-description/src/components/schemas/Challenge.yaml b/libs/openchallenges/api-description/src/components/schemas/Challenge.yaml index 405a89beea..6c8c2c3567 100644 --- a/libs/openchallenges/api-description/src/components/schemas/Challenge.yaml +++ b/libs/openchallenges/api-description/src/components/schemas/Challenge.yaml @@ -48,7 +48,7 @@ properties: minimum: 0 example: 100 operation: - $ref: EdamOperation.yaml + $ref: EdamConcept.yaml createdAt: $ref: CreatedDateTime.yaml updatedAt: diff --git a/libs/openchallenges/api-description/src/components/schemas/ChallengeSearchQuery.yaml b/libs/openchallenges/api-description/src/components/schemas/ChallengeSearchQuery.yaml index 8d19afb52e..081988dccd 100644 --- a/libs/openchallenges/api-description/src/components/schemas/ChallengeSearchQuery.yaml +++ b/libs/openchallenges/api-description/src/components/schemas/ChallengeSearchQuery.yaml @@ -66,6 +66,11 @@ properties: type: array items: $ref: EdamConceptId.yaml + operations: + description: An array of EDAM concept ID used to filter the results. + type: array + items: + $ref: EdamConceptId.yaml categories: description: The array of challenge categories used to filter the results. type: array