query_service

Functions to get and use HED queries.

Functions

get_query_handlers(queries[, query_names])

Return a list of query handlers, query names, and issues if any.

search_hed_objs(hed_objs, queries, query_names)

Return a DataFrame of factors based on results of queries.

get_query_handlers(queries, query_names=None)[source]

Return a list of query handlers, query names, and issues if any.

Parameters:
  • queries (list) – A list of query strings.

  • query_names (list or None) – A list of column names for results of queries. If missing — query_1, query_2, etc.

Returns:

list - QueryHandlers for successfully parsed queries. list - str names to assign to results of the queries. list - issues if any of the queries could not be parsed or other errors occurred.

search_hed_objs(hed_objs, queries, query_names)[source]

Return a DataFrame of factors based on results of queries.

Parameters:
  • hed_objs (list) – A list of HedString objects (empty entries or None entries are 0’s

  • queries (list) – A list of query strings or QueryHandler objects.

  • query_names (list) – A list of column names for results of queries.

Returns:

Contains the factor vectors with results of the queries.

Return type:

DataFrame

Raises:

ValueError

  • If query names are invalid or duplicated.