Validator

class Validator[A](configuration: ValidatorConfiguration, extractor: StreamExtractor[A]) extends LazyLogging

Validator object capable of extracting data from a Stream and produce a stream of ValidationResults

The whole validation pipeline is done through FS2 streams, and flows as follows:

  1. A => RDF data: a Stream of data is received as instances of A that are parsed for RDF data (this functionality is delegated to StreamExtractors)

  2. RDF data => Validation Report => The parsed data is validated and the ValidationReports included on a new Stream

  3. Validation Report => Validation Result: The validated data is formatted and wrapped into instances of ValidationResult

Type parameters:
A

Type of the items being received via Stream and thus feeding the validator

Value parameters:
configuration

Configuration of this validator instance

extractor

Extractor providing access to the incoming RDF items

Throws:
StreamValidationException

When invalid or erroring items are found and the stream is configured to stop in such cases

trait LazyLogging
class Object
trait Matchable
class Any

Value members

Constructors

def this(extractor: StreamExtractor[A], schema: Schema, trigger: ValidationTrigger)

Alternative constructor, automatically build the validator configuration given a schema and a trigger

Alternative constructor, automatically build the validator configuration given a schema and a trigger

Concrete methods

def validate: Stream[IO, ValidationResult]

Main method of the validator, produces a Stream of validation results from input data, fetching and processing items as specified in this validator's configurations

Main method of the validator, produces a Stream of validation results from input data, fetching and processing items as specified in this validator's configurations

Error handling: see "throws" section. Also, it is highly encouraged to handle any other possible exception that might happen

Returns:

A Stream of ValidationResults to be further processed by third parties

Throws:
KafkaException

When using a Kafka extractor and any kafka-related failure occurs (i.e.: underlying Kafka consumer cannot be built, connection fails, server goes offline...)

StreamTimeoutException

If the time between received items exceeds the one configured in the extractor

StreamValidationException

when errored/invalid results are emitted but are not allowed in the configuration

Concrete fields

Data format expected by this this validator

Data format expected by this this validator

val dataInference: InferenceEngine

Data inference applied by this this validator

Data inference applied by this this validator

Source from which this validator's data arrives

Source from which this validator's data arrives

val schema: Schema

Schema against which this validator's data is validated

Schema against which this validator's data is validated

Validation trigger with which this validator's data is validated

Validation trigger with which this validator's data is validated

For ShapeMaps, it will be fully filled with the data and schema prefix maps before validation (see validateItems)

Inherited fields

@transient
lazy protected val logger: Logger
Inherited from:
LazyLogging