Data Validation (indra_cogex.sources.processor_util)

exception DataTypeError[source]

Bases: TypeError

Raised when a data value is not of the expected type

exception UnknownTypeError[source]

Bases: TypeError

Raised when a data type is not recognized.

data_validator(data_type, value)[source]

Validate that the data type matches the value.

Parameters:
  • data_type (str) – The Neo4j data type to validate against.

  • value (Any) – The value to validate.

Raises:
  • DataTypeError – If the value does not validate against the Neo4j data type.

  • UnknownTypeError – If data_type is not recognized as a Neo4j data type.