clarin.sru.fcs.queryparser

class clarin.sru.fcs.queryparser.FCSQuery(raw_query: str, parsed_query: _T)[source]

Bases: SRUQuery[QueryNode]

property query_type: str

Get the short name for supported query, e.g. “cql”.

class clarin.sru.fcs.queryparser.FCSQueryParser[source]

Bases: SRUQueryParser[QueryNode]

Default query parser to parse FCS-QL.

property query_type: str

Get the short name for supported query, e.g. “cql”.

property query_parameter_names: List[str]

Get the list of query parameters.

supports_version(version: SRUVersion | None) bool[source]

Check if query is supported by a specific version of SRU/CQL.

parse_query(version: SRUVersion, parameters: Dict[str, str], diagnostics: SRUDiagnosticList) SRUQuery[QueryNode] | None[source]

Parse a query into an abstract syntax tree.

Parameters:
  • version – the SRU version the request was made

  • parameters – the request parameters containing the query

  • diagnostics – a SRUDiagnosticList for storing fatal and non-fatal diagnostics

Returns:

the parsed query or None if the query could not be parsed