[Search.Phase 1] Implement search of Sample Analysis bulk data by its measurements

Note: This issue covers the scope of only the first implementation stage. Any additional considerations and improvements will be listed separately.

  • Business goal
  • User Story
  • Implementation details
    • Schema Version
    • Filtration
    • Response
      • Response Format
      • Data Imputation
      • Codes
      • Validation Errors
  • Acceptance Criteria

Business goal

To implement a simplified way of searching and retrieving Sample bulk data by entering one or several search criteria in one request.

User Story

As the DDMS user, I need a REST API endpoint to search bulk data for a particular analysis type. This endpoint must provide filter capabilities and support content schema preferences.

Implementation details

  1. Add the /api/rafs-ddms/v2/samplesanalysis/{analysistype}/search/data end-point.
  2. Implement the following functionality
    1. build a list of datasets for the specified type of analysis and content schema version
    2. Apply the rows_filter on each dataset or merge them and apply (will depend on the performance)
    3. Apply other filters, if any
    4. Respond with regards to the Accept header.

Schema version

Currently, the RAFS DDMS does not support dynamic (in runtime) schema conversion, i.e., enforcement of the data to the particular (newer) schema. On the search request, the system should provide ONLY datasets that are written with the same content schema version as supplied with the Accept header.

image

Filtration

In a search query, a user should be able to specify the following:

  • attribute by which the search should be performed (mandatory)
  • operator (mandatory)
  • value (mandatory)

The functionality has to repeat the /data endpoints filtering functionality.

Users should be able to combine multiple search criteria.

Response

Only data that the user has permission to view or edit should be displayed (the user is included in corresponding SampleAnalysis WPC "owners" or "viewers" ACL groups).

Response Format

The response format should be based on the Accept header value the user provides. As of now, only application/parquet and application/json formats are supported. It should be formed as a single file that includes multiple samples of bulk data that satisfy the queried condition.

Data Imputation

Some WKE information (e.g., WellboreID, WellID, etc.) can be imputed to each dataset record during a response construction (it will be added in runtime, and source files will not be affected). #TBD

Codes:

200 - query was successfully executed, and 0+ results were returned

400 - bad request

422 - validation error

Validation Errors

The validation error behavior must be the same as for the /data endpoints.

Acceptance Criteria

The user can perform a Sample Analysis bulk data search using the RAFS DDMS endpoint, providing related sample analysis content schema properties.

A query should return bulk data with all its data based on the parameters and conditions provided. Users can combine different search requests using AND / OR operators to get narrowed or broader search results.

Validation error should be displayed with an informative message in case a search request is entered not according to the specified format.

Edited Mar 28, 2024 by Siarhei Khaletski
Assignee Loading
Time tracking Loading