Skip to content

Proposed types for Scientific Metadata #984

@nitrosx

Description

@nitrosx

This issue is an attempt to summarize the issues and discussions following PR #925 and issues #924 and #940.

In the biweekly meeting, the community expressed support in having multi-dimensional quantities in the metadata, although it is concerned by the fact that there is no limit on the dimensionality of the array, opening up to the possibility to allow a user to save a time series as metadata value.

To address the use case presented in #924 but avoid lengthy time series in metadata, I proposed to allow the following metadata types (italics indicates new types):

  • number: plain unit-less number
  • string: plain string
  • [1d] quantity: a one-dimensional quantity with associated unit. Example: length of 1m
  • 2d quantity: a two-dimensional quantity with associated unit. Example: a point on a plane, [1,2]m
  • 3d quantity: a three-dimensional quantity with associated unit. Example: a point in space, [1,2,3]m
  • quantity range: Example: a frequency range like [1,10]Hz
  • datetime: ISO 8601 string indicating a date and time. Example: 2024-01-02T17:06:04+07:00
  • datetime range: 2 ISO 8601 strings indicating a date and time range. Example: [2024-01-02T13:06:04+07:00, 2024-01-03T19:06:04+07:00]
  • date: ISO 8601 string indicating a date: Example: 2024-01-02
  • date range: 2 ISO 8601 strings indicating a date range: Example: [2024-01-01, 2024-01-03]
  • time: ISO 8601 string indicating a time. Example: T17:06:04+07:00
  • time range: 2 ISO 8601 strings indicating a time range. Example: [T13:06:04+07:00, T19:06:04+07:00]
  • object: container for nested metadata fields.

Search on types number, string and quantity will continue to behave as they currently behave.
I proposed the following search syntax and behavior for the new types:

  • 2d quantity and 3d quantity:
    • q op v.
      It is expanded to an or operator of the same condition on all the elements of the quantity.
      It will be true if it is true for at least one of the element of the quantity
      Example:
      • Value: position = [1,2,3]m
      • Condition: position = 3m
      • Expansion: position[0] = 3m or position[1] = 3m or position[2] = 3m (False or False or True)
      • Result: True
    • q[i] op v
      This apply the condition directly to a single element of the quantity.
      Example:
      • Value: position = [1,2,3]m
      • Condition: position[2] = 3m
      • Expansion: position[2] = 3m (True)
      • Result: True
  • datetime, date, and time
    All the date/time operators will be supported.
  • range (all range types)
    • r = v, v in r
      Does the range r contains the value v
      Example:
      • Value: frequency = [1,10]Hz
      • Condition: frequency = 3Hz
      • Expansion: frequency[0]<3Hz and frequency[1]>3Hz (True and True)
      • Result: True
    • q > v
      Is range r greater than v?
      Example:
      • Value: frequency = [1,10]Hz
      • Condition: frequency > 0.5Hz
      • Expansion: frequency[0]>0.5Hz (True)
      • Result: True
    • q < v
      Is range r less than v?
      Example:
      • Value: frequency = [1,10]Hz
      • Condition: frequency < 11Hz
      • Expansion: frequency[1]<11Hz (True)
      • Result: True

All the relevant tests must be added in to the BE and FE.

This is just a proposal. Please comment below and elaborate further the ideas.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions