{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "BCL Measure",
  "description": "BCL search results schema for measures",
  "type": "object",
  "properties": {
    "name": {
      "description": "Machine name of the measure (use underscores instead of spaces)",
      "type": "string"
    },
    "display_name": {
      "description": "Display name of the measure",
      "type": "string"
    },
    "uuid": {
      "description": "Universally Unique ID of the measure",
      "type": "string"
    },
    "vuuid": {
      "description": "Universally Unique Version ID of the measure. Legacy field. Same as version_id",
      "type": "string"
    },
    "version_id": {
      "description": "Universally Unique Version ID of the measure",
      "type": "string"
    },
    "description": {
      "description": "Description of the measure",
      "type": "string"
    },
    "class_name": {
      "description": "OpenStudio class name used in the measure. Format should be UpperCamelCase",
      "type": "string"
    },
    "xml_checksum": {
      "description": "Checksum for measure.xml file. Automatically generated by the measure manager",
      "type": "string"
    },
    "version_modified": {
      "description": "Timestamp of last modification. Automatically generate/updated by the measure manager",
      "type": "string"
    },
    "modeler_description": {
      "description": "Description of the measure intended for modelers. Contains more usage and implementation details.",
      "type": "string"
    },
    "attributes": {
      "description": "Array of attributes that describe the measure. The list of valid attributes can be found at https://bcl.nlr.gov/tags#attributes",
      "type": "array",
      "items": {
        "$ref": "#/definitions/attribute"
      }
    },
    "openstudio_version": {
      "description": "Version of OpenStudio that the original measure was made for",
      "type": "string"
    },
    "openstudio_min_compatible": {
      "description": "Minimum compatible OpenStudio version",
      "type": "string"
    },
    "openstudio_max_compatible": {
      "description": "Maximum compatible OpenStudio version",
      "type": "string"
    },
    "files": {
      "description": "Array of files found in measure directory",
      "type": "array",
      "items": {
        "$ref": "#/definitions/file"
      }
    },
    "org": {
      "description": "Organization name of the origin GitHub repository",
      "type": "string"
    },
    "repo": {
      "description": "Name of the origin GitHub repository",
      "type": "string"
    },
    "repo_url": {
      "description": "URL of the origin GitHub repository",
      "type": "string"
    },
    "release_tag": {
      "description": "Tag version number of the GitHub repository release containing this measure",
      "type": "string"
    },
    "bundle": {
      "description": "Bundle type of this content. This is always set to 'measure' for measures",
      "type": "string",
      "enum": [
        "measure"
      ]
    },
    "download_url": {
      "description": "BCL URL that can be used to download the measure",
      "type": "string"
    },
    "tags": {
      "description": "Taxonomy tag used to classify the measure. Array should contain a single element that contains the full classification hierarchy separated by dots (.); for example, for a QAQC measure the tag should be: 'Reporting.QAQC'. Visit https://bcl.nlr.gov/tags#measure for the full tag taxonomy.",
      "type": "array",
      "items": {
        "$ref": "#/definitions/tag"
      }
    }
  },
  "definitions": {
    "attribute": {
      "description": "Attribute used to identify a measure",
      "type": "object",
      "properties": {
        "name": {
          "description": "The attribute's name",
          "type": "string"
        },
        "value": {
          "description": "The attribute's value",
          "type": [
            "string",
            "number"
          ]
        },
        "datatype": {
          "description": "The data type that the attribute value is represented in",
          "type": "string",
          "enum": [
            "Boolean",
            "Floating-point number",
            "Integer",
            "String"
          ]
        },
        "units": {
          "description": "The units that the attribute value is represented in",
          "type": "string"
        }
      }
    },
    "file": {
      "description": "File found in the measure directory",
      "type": "object",
      "properties": {
        "filename": {
          "description": "Name of the file",
          "type": "string"
        },
        "filetype": {
          "description": "Type of file (file extension)",
          "type": "string"
        },
        "usage_type": {
          "description": "Type of file.  'script' is used for the measure.rb or measure.py files only",
          "type": "string",
          "enum": [
            "test",
            "license",
            "resource",
            "script",
            "readme",
            "readmerb"
          ]
        },
        "url": {
          "description": "BCL URL that can be used to download a particular file directly.",
          "type": "string"
        },
        "version": {
          "description": "Information on the software version compatible with the file",
          "type": "object",
          "properties": {
            "software_program": {
              "description": "Name of the software program that uses this file; for example, OpenStudio or EnergyPlus",
              "type": "string"
            },
            "identifier": {
              "description": "The version identifier of the software used to create the original version of the file",
              "type": "string"
            },
            "min_compatible": {
              "description": "Minimum software version that this file is compatible with",
              "type": "string"
            },
            "max_compatible": {
              "description": "Maximum software version that this file is compatible with",
              "type": "string"
            }
          }
        }
      }
    },
    "tag": {
      "description": "Full hierarchy of the Tag used to classify the measure. Visit https://bcl.nlr.gov/tags#measure for the full tag taxonomy.",
      "type": "string"
    }
  }
}
