Table of Contents

Search

  1. Preface
  2. Introduction to Data Transformation
  3. Data Processor Transformation
  4. Wizard Input and Output Formats
  5. Relational Input and Output
  6. XMap
  7. Libraries
  8. Schema Object
  9. Command Line Interface
  10. Scripts
  11. Parsers
  12. Script Ports
  13. Document Processors
  14. Formats
  15. Data Holders
  16. Anchors
  17. Transformers
  18. Actions
  19. Serializers
  20. Mappers
  21. Locators, Keys, and Indexing
  22. Streamers
  23. Validators, Notifications, and Failure Handling
  24. Validation Rules
  25. Custom Script Components

Data Transformation User Guide

Data Transformation User Guide

Sample JSON Schema

Sample JSON Schema

The following example is a sample JSON schema:
{"type":"object", "$schema": "http://json-schema.org/draft-03/schema", "id": "#", "required":false, "properties":{ "OrgId": { "type":"string", "id": "OrgId", "required":false }, "metrics": { "type":"array", "id": "metrics", "required":false, "items": { "type":"object", "id": "0", "required":false, "properties":{ "name": { "type":"string", "id": "name", "required":false }, "valueTrend": { "type":"array", "id": "valueTrend", "required":false, "items": { "type":"object", "id": "0", "required":false, "properties":{ "date": { "type":"string", "id": "date", "required":false }, "val": { "type":"string", "id": "val", "required":false } } } } } } } } }
The schema defines the elements and attributes that can occur in a JSON document. The schema uses the JSON syntax to specify the hierarchy and sequence of elements, whether elements are required, the element type, and possible values.
The previous sample schema defines the following JSON input document:
{"OrgId": "ORG000000000001", "metrics": [ { "name": "COL1", "valueTrend": [ { "date": "2011-11-01", "val": "122.456" }, { "date": "2011-11-02", "val": "215.1" } ] }, { "name": "COL2", "valueTrend": [ { "date": "2011-11-01", "val": "122.456" }, { "date": "2011-11-02", "val": "215.1" } ] } ] }
If you trace through the schema, you can determine the relationship between the elements of the schema and input document.
The schema hierarchy contains the
metrics
object that nests the
valueTrend
array. The array contains the fields
date
and
val
that are of the
string
data type.