Closed admy7 closed 1 month ago
This pull request implements significant changes to the filtering and facet handling in the discovery service, transitioning from a facet-based approach to a more flexible filter-based system. The changes include updates to the API, data models, and the introduction of new strategies for handling different types of filters, particularly for Beacon integration.
sequenceDiagram
actor User
participant Client
participant FilterController
participant RetrieveFiltersQuery
participant FilterBuilder
User->>Client: Request filters
Client->>FilterController: GET /api/v1/filters
FilterController->>RetrieveFiltersQuery: execute(accessToken)
RetrieveFiltersQuery->>FilterBuilder: build(accessToken)
FilterBuilder-->>RetrieveFiltersQuery: List of Filters
RetrieveFiltersQuery-->>FilterController: List of Filters
FilterController-->>Client: Response with Filters
Client-->>User: Display Filters
erDiagram
DATASET_SEARCH_QUERY_FACET {
STRING source
STRING type
STRING key
STRING value
STRING operator
STRING entries
}
FILTER {
STRING source
STRING type
STRING key
STRING label
STRING values
STRING operators
STRING entries
}
DATASET_SEARCH_QUERY_FACET ||--o{ FILTER : "maps to"
FILTER ||--o{ VALUE_LABEL : "has"
FILTER ||--o{ FILTER_ENTRY : "has"
VALUE_LABEL {
STRING label
STRING value
}
FILTER_ENTRY {
STRING id
STRING label
}
classDiagram
class DatasetSearchQueryFacet {
- String source
- FilterType type
- String key
- String value
- Operator operator
- List~QueryEntry~ entries
}
class FilterType {
<<enumeration>>
DROPDOWN
FREE_TEXT
ENTRIES
}
class Operator {
<<enumeration>>
EQUALS
GREATER_THAN
LESS_THAN
DIFFERENT
CONTAINS
}
class QueryEntry {
- String label
- String value
}
class Filter {
- String source
- FilterType type
- String key
- String label
- List~ValueLabel~ values
- List~Operator~ operators
- List~FilterEntry~ entries
}
class ValueLabel {
- String label
- String value
}
class FilterEntry {
- String id
- String label
}
DatasetSearchQueryFacet --> FilterType
DatasetSearchQueryFacet --> Operator
DatasetSearchQueryFacet --> QueryEntry
Filter --> FilterType
Filter --> ValueLabel
Filter --> Operator
Filter --> FilterEntry
Change | Details | Files |
---|---|---|
Renamed and restructured facet-related components to filter-related components |
|
src/main/openapi/discovery.yaml src/main/java/io/github/genomicdatainfrastructure/discovery/filters/application/ports/FilterBuilder.java src/main/java/io/github/genomicdatainfrastructure/discovery/filters/application/usecases/RetrieveFiltersQuery.java |
Introduced new filter types and strategies for Beacon integration |
|
src/main/java/io/github/genomicdatainfrastructure/discovery/filters/infrastructure/beacon/strategies/OntologyFilterStrategy.java src/main/java/io/github/genomicdatainfrastructure/discovery/filters/infrastructure/beacon/strategies/AlphanumericFilterStrategy.java src/main/java/io/github/genomicdatainfrastructure/discovery/filters/infrastructure/beacon/strategies/VariantFilterStrategy.java src/main/java/io/github/genomicdatainfrastructure/discovery/filters/infrastructure/beacon/strategies/FilterStrategyContext.java |
Updated Beacon integration to support new filter system |
|
src/main/java/io/github/genomicdatainfrastructure/discovery/datasets/infrastructure/beacon/persistence/BeaconIndividualsRequestMapper.java src/main/java/io/github/genomicdatainfrastructure/discovery/filters/infrastructure/beacon/BeaconFilterBuilder.java src/main/openapi/beacon.yaml |
Updated CKAN integration to support new filter system |
|
src/main/java/io/github/genomicdatainfrastructure/discovery/filters/infrastructure/ckan/CkanFilterBuilder.java src/main/java/io/github/genomicdatainfrastructure/discovery/datasets/infrastructure/ckan/persistence/CkanFacetsQueryBuilder.java |
Updated and added tests for new filter system |
|
src/test/java/io/github/genomicdatainfrastructure/discovery/filters/infrastructure/quarkus/RetrieveFiltersTest.java src/test/java/io/github/genomicdatainfrastructure/discovery/filters/application/usecases/RetrieveFiltersQueryTest.java src/test/java/io/github/genomicdatainfrastructure/discovery/datasets/infrastructure/ckan/CkanFacetsQueryBuilderTest.java |
@admy7 thanks for you patience. Let's wait the frontend change a bit and merge both at the same time.
Summary by Sourcery
Implement alphanumeric filters to enhance dataset querying capabilities, refactor the facet system to a filter-based approach, and update tests and documentation accordingly.
New Features:
Enhancements:
Tests: