{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "http://json-schema.org/openstudio-urban-modeling/electrical_connector_properties.json#",
  "title": "URBANopt Electrical Connector",
  "description": "Schema for an URBANopt Electrical Connector object",
  "type": "object",
  "properties": {
    "id": {
      "description": "Unique id used to refer to this feature within this dataset.",
      "type": "string"
    },
    "project_id": {
      "description": "Project which this feature belongs to.",
      "type": "string"
    },
    "type": {
      "description": "Type of feature.",
      "type": "string",
      "enum": [
        "ElectricalConnector"
      ]
    },
    "source_name": {
      "description": "Name of the original data source.",
      "type": "string"
    },
    "source_id": {
      "description": "Id of the feature in original data source.",
      "type": "string"
    },
    "name": {
      "description": "Feature name",
      "type": "string"
    },
    "connector_type": {
      "$ref": "#/definitions/ElectricalLineType"
    },
    "lengths": {
      "description": "Length (ft) of each segment, generated on export.",
      "type": "array",
      "items": {
        "type": "number"
      }
    },
    "total_length": {
      "description": "Total length (ft) of the line, generated on export.",
      "type": "number"
    },
    "startJunctionId": {
      "description": "Id of the junction that this line starts at.",
      "type": "string"
    },
    "line_properties": {
      "description": "A sub-element containing all the attributes that can be assigned to a line, including wires",
      "type": "object",
      "properties": {
        "is_switch": {
          "type": "boolean",
          "description": "Flag indicating if the line is a switch or not"
        },
        "is_fuse": {
          "type": "boolean",
          "description": "Flag indicating if the line is a fuse or not"
        },
        "is_open": {
          "type": "boolean",
          "description": "Flag indicating if the switch/fuse is a open or not"
        }
      }
    },
    "wires": {
      "description": "Array of wires that are on the line",
      "type": "array",
      "items": {
        "$ref": "#/definitions/WireType",
        "type": "string"
      }
    },
    "endJunctionId": {
      "description": "Id of the junction that this line ends at.",
      "type": "string"
    },
    "user_data": {
      "description": "Arbitrary user data"
    }
  },
  "required": [
    "type",
    "id",
    "connector_type",
    "startJunctionId",
    "endJunctionId"
  ],
  "additionalProperties": false,
  "definitions": {
    "ElectricalLineType": {
      "description": "Type of electrical line",
      "type": "string",
      "enum": [
        "Wire"
      ]
    },
    "WireType": {
      "description": "Type of wire used",
      "type": "string",
      "enum": [
        "OH TPLX #4 S1",
        "OH TPLX #4 S2",
        "OH TPLX #4 A",
        "OH TPLX #4 B",
        "OH TPLX #4 C",
        "OH TPLX #4 N",
        "OH TPLX 1/0 S1",
        "OH TPLX 1/0 S2",
        "OH TPLX 1/0 A",
        "OH TPLX 1/0 B",
        "OH TPLX 1/0 C",
        "OH TPLX 1/0 N",
        "OH TPLX 2/0 S1",
        "OH TPLX 2/0 S2",
        "OH TPLX 2/0 A",
        "OH TPLX 2/0 B",
        "OH TPLX 2/0 C",
        "OH TPLX 2/0 N",
        "OH TPLX 4/0 S1",
        "OH TPLX 4/0 S2",
        "OH TPLX 4/0 A",
        "OH TPLX 4/0 B",
        "OH TPLX 4/0 C",
        "OH TPLX 4/0 N",
        "OH AL #2 A",
        "OH AL #2 B",
        "OH AL #2 C",
        "OH AL #2 N",
        "OH AL #4 A",
        "OH AL #4 B",
        "OH AL #4 C",
        "OH AL #4 N",
        "OH AL 1/0 A",
        "OH AL 1/0 B",
        "OH AL 1/0 C",
        "OH AL 1/0 N",
        "OH AL 2/0 A",
        "OH AL 2/0 B",
        "OH AL 2/0 C",
        "OH AL 2/0 N",
        "OH AL 4/0 A",
        "OH AL 4/0 B",
        "OH AL 4/0 C",
        "OH AL 4/0 N",
        "OH AL 336kcmil A",
        "OH AL 336kcmil B",
        "OH AL 336kcmil C",
        "OH AL 336kcmil N",
        "OH AL 477kcmil A",
        "OH AL 477kcmil B",
        "OH AL 477kcmil C",
        "OH AL 477kcmil N",
        "OH AL 795kcmil A",
        "OH AL 795kcmil B",
        "OH AL 795kcmil C",
        "OH AL 795kcmil N",
        "UG TPLX #4 S1",
        "UG TPLX #4 S2",
        "UG TPLX #4 A",
        "UG TPLX #4 B",
        "UG TPLX #4 C",
        "UG TPLX #4 N",
        "UG TPLX 1/0 S1",
        "UG TPLX 1/0 S2",
        "UG TPLX 1/0 A",
        "UG TPLX 1/0 B",
        "UG TPLX 1/0 C",
        "UG TPLX 1/0 N",
        "UG TPLX 2/0 S1",
        "UG TPLX 2/0 S2",
        "UG TPLX 2/0 A",
        "UG TPLX 2/0 B",
        "UG TPLX 2/0 C",
        "UG TPLX 2/0 N",
        "UG TPLX 4/0 S1",
        "UG TPLX 4/0 S2",
        "UG TPLX 4/0 A",
        "UG TPLX 4/0 B",
        "UG TPLX 4/0 C",
        "UG TPLX 4/0 N",
        "UG AL #2 A",
        "UG AL #2 B",
        "UG AL #2 C",
        "UG AL #2 N",
        "UG AL #4 A",
        "UG AL #4 B",
        "UG AL #4 C",
        "UG AL #4 N",
        "UG AL 1/0 A",
        "UG AL 1/0 B",
        "UG AL 1/0 C",
        "UG AL 1/0 N",
        "UG AL 2/0 A",
        "UG AL 2/0 B",
        "UG AL 2/0 C",
        "UG AL 2/0 N",
        "UG AL 4/0 A",
        "UG AL 4/0 B",
        "UG AL 4/0 C",
        "UG AL 4/0 N",
        "UG AL 350kcmil A",
        "UG AL 350kcmil B",
        "UG AL 350kcmil C",
        "UG AL 350kcmil N",
        "UG AL 500kcmil A",
        "UG AL 500kcmil B",
        "UG AL 500kcmil C",
        "UG AL 500kcmil N",
        "UG AL 750kcmil A",
        "UG AL 750kcmil B",
        "UG AL 750kcmil C",
        "UG AL 750kcmil N",
        "UG AL 1000kcmil A",
        "UG AL 1000kcmil B",
        "UG AL 1000kcmil C",
        "UG AL 1000kcmil N",
        "UG AL 1000mcm A",
        "UG AL 1000mcm B",
        "UG AL 1000mcm C"
      ]
    }
  }
}