Understanding the Validation Problem
BioCompute Objects (BCOs) are JSON-LD documents that comply with the IEEE 2791 schema. When validating BCO JSON documents against this schema, common validation errors arise due to mismatches between expected and actual data types. Specifically, the schema may expect empty strings where null values are present, or expect arrays of URI objects where arrays of strings are provided. These mismatches cause validation failures, disrupting bioinformatics workflows that rely on BCOs for reproducibility and provenance tracking.
- Null values where the schema expects empty strings cause type mismatch errors.
- Arrays of strings are provided when the schema expects arrays of URI objects, leading to validation failures.
- These issues are not merely syntactic; they impede the exchange and validation of bioinformatics provenance data.
How JSON Guard Solves the Problem
JSON Guard provides a normalization layer that preprocesses JSON documents before schema validation. By automatically converting null values to empty strings and coercing data types (e.g., converting string arrays to URI arrays when the schema expects them), JSON Guard ensures that the JSON conforms to the expected schema structure. This eliminates false-negative validation errors caused by harmless variations in JSON representation, allowing bioinformatics tools to proceed without manual intervention.
- Automatic null-to-empty-string conversion satisfies schema expectations for string fields.
- Smart type coercion adjusts arrays and other types to match schema definitions without altering semantic meaning.
- The normalization is configurable, allowing users to define rules that match their specific schema requirements.
- By integrating JSON Guard as a preprocessing step, validation pipelines become more robust and less fragile to minor JSON representation differences.