rad_schema-1.0.0

RAD Metaschema

Description

A metaschema that extends the ASDF metaschema to add support for Science Data Formatting and archive catalog-related properties.

Outline

Schema Definitions

This node must validate against all of the following:

  • This type is an object with the following properties:

    • datamodel_name

      string

      Name of the datamodel described by this schema

      No length restriction
    • archive_meta

      string

      Metadata that aids the archive in identifying ASDF files.

      No length restriction
    • sdf

      object

      Information on this attribute’s value upon creation of Level 1 files.

      This type is an object with the following properties:

      • special_processing

        stringRequired

        A flag indicating whether this attribute must be present in the SDF file.

        No length restriction

        Only the following values are valid for this node:

        • VALUE_REQUIRED

        • OPTIONAL

      • source

        objectRequired

        This type is an object with the following properties:

        • origin

          stringRequired

          Source of the attribute value.

          No length restriction
        • function

          string

          Optional function that transforms the source value.

          No length restriction
    • archive_catalog

      object

      Information on this attribute’s data type and destination table and column in the archive catalog.

      This type is an object with the following properties:

      • datatype

        objectRequired

        Column type in the archive catalog database.

        This node must validate against any of the following:

        • string

          No length restriction

          Only the following values are valid for this node:

          • datetime2

          • float

          • int

          • nchar(1)

          • nvarchar(max)

          • bigint

          • smallint

          • tinyint

        • string

          No length restriction

          Must match the following pattern:

          ^nvarchar\([0-9]+\)$
          
      • destination

        arrayRequired

        Table and column in the archive catalog database

        Minimum length: 1

        Items in the array are restricted to the following types:

        string

        No length restriction

        Must match the following pattern:

        ^[A-Za-z0-9]+\.[a-z0-9_]+$
        
    • additionalItems

      object

      This node must validate against any of the following:

      • boolean

    • items

      object

      This node must validate against any of the following:

    • additionalProperties

      object

      This node must validate against any of the following:

      • boolean

    • definitions

      object

      object

    • properties

      object

      object

    • patternProperties

      object

      object

    • dependencies

      object

      object

    • allOf

      schemaArray
    • anyOf

      schemaArray
    • oneOf

      schemaArray
    • not

      #

Internal Definitions

  • schemaArray

    array

    Minimum length: 1

    Items in the array are restricted to the following types:

  • Original Schema

    %YAML 1.1
    ---
    $schema: http://stsci.edu/schemas/yaml-schema/draft-01
    id: asdf://stsci.edu/datamodels/roman/schemas/rad_schema-1.0.0
    
    title: RAD Metaschema
    description: |
      A metaschema that extends the ASDF metaschema to add support for Science
      Data Formatting and archive catalog-related properties.
    
    allOf:
      - $ref: http://stsci.edu/schemas/asdf/asdf-schema-1.0.0
      - type: object
        properties:
          datamodel_name:
            title: Datamodel Name
            description: |-
              Name of the datamodel described by this schema
            type: string
          archive_meta:
            title: Archive Metadata
            description: |-
              Metadata that aids the archive in identifying ASDF files.
            type: string
          sdf:
            title: Scientific Data Format
            description: |-
              Information on this attribute's value upon creation of Level 1 files.
            type: object
            properties:
              special_processing:
                title: Special Processing
                description: |-
                  A flag indicating whether this attribute must be present in the
                  SDF file.
                type: string
                enum: [VALUE_REQUIRED, OPTIONAL]
              source:
                type: object
                properties:
                  origin:
                    title: Origin
                    description: |-
                      Source of the attribute value.
                    type: string
                  function:
                    title: Function
                    description: |-
                      Optional function that transforms the source value.
                    type: string
                required: [origin]
            required: [special_processing, source]
    
          archive_catalog:
            title: Archive Catalog
            description: |-
              Information on this attribute's data type and destination table and
              column in the archive catalog.
            type: object
            properties:
              datatype:
                title: Archive Catalog Database Column Type
                description: |-
                  Column type in the archive catalog database.
                anyOf:
                  - type: string
                    enum: [datetime2, float, int, nchar(1), nvarchar(max), bigint, smallint, tinyint]
                  - type: string
                    pattern: "^nvarchar\\([0-9]+\\)$"
              destination:
                title: Destination
                description: |-
                  Table and column in the archive catalog database
                type: array
                items:
                  type: string
                  pattern: "^[A-Za-z0-9]+\\.[a-z0-9_]+$"
                minItems: 1
                uniqueItems: true
            required: [datatype, destination]
    
          # Needed to cause the validator to check sdf and archive_catalog
          # in object properties.
          additionalItems:
            anyOf:
              - type: boolean
              - $ref: "#"
          items:
            anyOf:
              - $ref: "#"
              - $ref: "#/definitions/schemaArray"
          additionalProperties:
            anyOf:
              - type: boolean
              - $ref: "#"
          definitions:
            type: object
            additionalProperties:
              $ref: "#"
          properties:
            type: object
            additionalProperties:
              $ref: "#"
          patternProperties:
            type: object
            additionalProperties:
              $ref: "#"
          dependencies:
            type: object
            additionalProperties:
              anyOf:
                - $ref: "#"
                - $ref: "http://json-schema.org/draft-04/schema#/definitions/stringArray"
          allOf:
            $ref: "#/definitions/schemaArray"
          anyOf:
            $ref: "#/definitions/schemaArray"
          oneOf:
            $ref: "#/definitions/schemaArray"
          not:
            $ref: "#"
    
    # Needed to cause the validator to check sdf and archive_catalog
    # in object properties.
    definitions:
      schemaArray:
        type: array
        minItems: 1
        items:
          $ref: "#"
    ...