PIF Query - Chemical

Chemical Field Query

class citrination_client.search.pif.query.chemical.chemical_field_query.ChemicalFieldQuery(sort=None, logic=None, weight=None, simple=None, simple_weight=None, extract_as=None, extract_all=None, extract_when_missing=None, length=None, offset=None, filter=None, **kwargs)

Bases: citrination_client.search.pif.query.core.base_field_query.BaseFieldQuery

Class for all field operations against chemical information.

__init__(sort=None, logic=None, weight=None, simple=None, simple_weight=None, extract_as=None, extract_all=None, extract_when_missing=None, length=None, offset=None, filter=None, **kwargs)

Constructor.

Parameters
  • sort – ASCENDING or DESCENDING to set the sort order on this field.

  • logic – Logic for this query. Must be equal to one of “MUST”, “MUST_NOT”, “SHOULD”, or “OPTIONAL”.

  • weight – Weight for the query.

  • simple – String with the simple search to run against all fields.

  • simple_weight – Dictionary of relative paths to their weights for simple queries.

  • extract_as – String with the alias to save this field under.

  • extract_all – Boolean setting whether all values in an array should be extracted.

  • extract_when_missing – Any valid JSON-supported object or PIF object. This value is returned when a value is missing that should be extracted (and the overall query is still satisfied).

  • length – One or more FieldOperation objects against the length field.

  • offset – One or more FieldOperation objects against the offset field.

  • filter – One or more ChemicalFilter objects against this field.

filter

Chemical Filter

class citrination_client.search.pif.query.chemical.chemical_filter.ChemicalFilter(logic=None, weight=None, exists=None, equal=None, element=None, partial=None, exact=None, filter=None, **kwargs)

Bases: pypif.util.serializable.Serializable

Filter that can be applied to a field that stores chemical information.

__init__(logic=None, weight=None, exists=None, equal=None, element=None, partial=None, exact=None, filter=None, **kwargs)

Constructor.

Parameters
  • logic – Logic for this filter. Must be equal to one of “MUST”, “MUST_NOT”, “SHOULD”, or “OPTIONAL”.

  • weight – Weight for the query.

  • exists – True/False to simply test whether the field exists and has a non-null value.

  • equal – String with the phrase to match against.

  • element – True to match against the single element field.

  • partial – True to match against the partial formula field.

  • exact – True if matches should be exact.

  • filter – List of ChemicalFilter objects with sub-filters.

element
equal
exact
exists
filter
logic
partial
weight

Composition Query

class citrination_client.search.pif.query.chemical.composition_query.CompositionQuery(logic=None, weight=None, simple=None, simple_weight=None, extract_as=None, extract_all=None, extract_when_missing=None, tags=None, length=None, offset=None, element=None, actual_weight_percent=None, actual_atomic_percent=None, ideal_weight_percent=None, ideal_atomic_percent=None, query=None, **kwargs)

Bases: citrination_client.search.pif.query.core.base_object_query.BaseObjectQuery

Class to query against a PIF Composition object.

__init__(logic=None, weight=None, simple=None, simple_weight=None, extract_as=None, extract_all=None, extract_when_missing=None, tags=None, length=None, offset=None, element=None, actual_weight_percent=None, actual_atomic_percent=None, ideal_weight_percent=None, ideal_atomic_percent=None, query=None, **kwargs)

Constructor.

Parameters
  • logic – Logic for this filter. Must be equal to one of “MUST”, “MUST_NOT”, “SHOULD”, or “OPTIONAL”.

  • weight – Weight of the query.

  • simple – String with the simple query to run against all fields.

  • simple_weight – Dictionary of relative paths to their weights for simple queries.

  • extract_as – String with the alias to save this field under.

  • extract_all – Boolean setting whether all values in an array should be extracted.

  • extract_when_missing – Any valid JSON-supported object or PIF object. This value is returned when a value is missing that should be extracted (and the overall query is still satisfied).

  • tags – One or more FieldQuery operations against the tags field.

  • length – One or more FieldQuery operations against the length field.

  • offset – One or more FieldQuery operations against the offset field.

  • element – One or more ChemicalFieldQuery operations against the element field.

  • actual_weight_percent – One or more FieldQuery operations against the actual weight percent field.

  • actual_atomic_percent – One or more FieldQuery operations against the actual atomic percent field.

  • ideal_weight_percent – One or more FieldQuery operations against the ideal weight percent field.

  • ideal_atomic_percent – One or more FieldQuery operations against the ideal atomic percent field.

  • query – One or more CompositionQuery objects with the nest queries.

actual_atomic_percent
actual_weight_percent
element
ideal_atomic_percent
ideal_weight_percent
query