{
  "name": "Task",
  "description": "A tracked unit of work: a ticket or issue in a tracker, a calendar to-do, a municipal work order. State and priority follow RFC 8984 (JSCalendar); the source system's own status name and kind are kept in statusLabel and subtype. Location may be any geometry. At least one of progress, statusLabel is not null. Type https://datamodels.jp/ns/task/Task; @context https://datamodels.jp/context/task/v1.jsonld.",
  "strict": true,
  "schema": {
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "description": "Name or subject"
      },
      "description": {
        "type": [
          "string",
          "null"
        ],
        "description": "Description"
      },
      "project": {
        "type": [
          "string",
          "null"
        ],
        "description": "The project this belongs to, when the source system has projects (a URI)"
      },
      "milestone": {
        "type": [
          "string",
          "null"
        ],
        "description": "The milestone (version, release) this is planned for (a URI)"
      },
      "parent": {
        "type": [
          "string",
          "null"
        ],
        "description": "Parent task (RFC 8984 relatedTo parent) (a URI)"
      },
      "relatedTo": {
        "type": [
          "array",
          "null"
        ],
        "items": {
          "type": "string",
          "description": "(a URI)"
        },
        "minItems": 1,
        "description": "Related tasks. Always an array in the key-values form, even with one target. The kind of relation (blocks, precedes, duplicates) is left to extensions"
      },
      "refersTo": {
        "type": [
          "string",
          "null"
        ],
        "description": "The entity this task is about (a report, an asset, a road) (a URI)"
      },
      "progress": {
        "type": [
          "string",
          "null"
        ],
        "enum": [
          "needs-action",
          "in-process",
          "completed",
          "failed",
          "cancelled",
          null
        ],
        "description": "Normalised state (RFC 8984 progress: needs-action, in-process, completed, failed, cancelled). When no value fits, leave it out and give the local wording in statusLabel"
      },
      "statusLabel": {
        "type": [
          "string",
          "null"
        ],
        "description": "The source system's own status name, unchanged (for example \"In progress\", \"Resolved\"). Required when progress is left out (not empty)"
      },
      "subtype": {
        "type": [
          "string",
          "null"
        ],
        "description": "The source system's kind: tracker, issue type, category"
      },
      "priority": {
        "type": [
          "integer",
          "null"
        ],
        "description": "Priority 0 to 9: 1 highest, 9 lowest, 0 undefined (RFC 8984) (minimum 0; maximum 9)"
      },
      "assignee": {
        "type": [
          "array",
          "null"
        ],
        "items": {
          "type": "string",
          "description": "(a URI)"
        },
        "minItems": 1,
        "description": "Assignees: person, organisation or team entities, possibly outside this subject. Always an array in the key-values form, even with one target"
      },
      "author": {
        "type": [
          "string",
          "null"
        ],
        "description": "Creator (a person, organisation or team entity) (a URI)"
      },
      "start": {
        "anyOf": [
          {
            "type": "string",
            "format": "date"
          },
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ],
        "description": "Planned start: a date, or a date and time (RFC 8984 start)"
      },
      "due": {
        "anyOf": [
          {
            "type": "string",
            "format": "date"
          },
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ],
        "description": "Due: a date, or a date and time (RFC 8984 due)"
      },
      "completedAt": {
        "type": [
          "string",
          "null"
        ],
        "format": "date-time",
        "description": "When progress became completed"
      },
      "estimatedDuration": {
        "type": [
          "string",
          "null"
        ],
        "description": "Estimated effort as an ISO 8601 duration, e.g. PT1H30M (RFC 8984 estimatedDuration) (must match the pattern ^P(?!$)(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+S)?)?$)"
      },
      "percentComplete": {
        "type": [
          "integer",
          "null"
        ],
        "description": "Completion 0 to 100 (RFC 8984 percentComplete) (minimum 0; maximum 100)"
      },
      "keywords": {
        "type": [
          "array",
          "null"
        ],
        "items": {
          "type": "string"
        },
        "description": "Keywords or labels"
      },
      "location": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "Point"
                ]
              },
              "coordinates": {
                "type": "array",
                "items": {
                  "type": "number"
                },
                "description": "[longitude, latitude] in WGS 84, optionally with the altitude as a third number"
              }
            },
            "required": [
              "type",
              "coordinates"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "LineString"
                ]
              },
              "coordinates": {
                "type": "array",
                "items": {
                  "type": "array",
                  "items": {
                    "type": "number"
                  },
                  "description": "[longitude, latitude] in WGS 84, optionally with the altitude as a third number"
                },
                "description": "At least 2 positions"
              }
            },
            "required": [
              "type",
              "coordinates"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "Polygon"
                ]
              },
              "coordinates": {
                "type": "array",
                "items": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    },
                    "description": "[longitude, latitude] in WGS 84, optionally with the altitude as a third number"
                  },
                  "description": "A closed ring: at least 4 positions, the last equal to the first"
                },
                "description": "The outer ring, then any holes"
              }
            },
            "required": [
              "type",
              "coordinates"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "MultiPoint"
                ]
              },
              "coordinates": {
                "type": "array",
                "items": {
                  "type": "array",
                  "items": {
                    "type": "number"
                  },
                  "description": "[longitude, latitude] in WGS 84, optionally with the altitude as a third number"
                },
                "description": "Positions"
              }
            },
            "required": [
              "type",
              "coordinates"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "MultiLineString"
                ]
              },
              "coordinates": {
                "type": "array",
                "items": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    },
                    "description": "[longitude, latitude] in WGS 84, optionally with the altitude as a third number"
                  },
                  "description": "At least 2 positions"
                },
                "description": "Lines"
              }
            },
            "required": [
              "type",
              "coordinates"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "MultiPolygon"
                ]
              },
              "coordinates": {
                "type": "array",
                "items": {
                  "type": "array",
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      },
                      "description": "[longitude, latitude] in WGS 84, optionally with the altitude as a third number"
                    },
                    "description": "A closed ring: at least 4 positions, the last equal to the first"
                  },
                  "description": "The outer ring, then any holes"
                },
                "description": "Polygons"
              }
            },
            "required": [
              "type",
              "coordinates"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "GeometryCollection"
                ]
              },
              "geometries": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "Point"
                          ]
                        },
                        "coordinates": {
                          "type": "array",
                          "items": {
                            "type": "number"
                          },
                          "description": "[longitude, latitude] in WGS 84, optionally with the altitude as a third number"
                        }
                      },
                      "required": [
                        "type",
                        "coordinates"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "LineString"
                          ]
                        },
                        "coordinates": {
                          "type": "array",
                          "items": {
                            "type": "array",
                            "items": {
                              "type": "number"
                            },
                            "description": "[longitude, latitude] in WGS 84, optionally with the altitude as a third number"
                          },
                          "description": "At least 2 positions"
                        }
                      },
                      "required": [
                        "type",
                        "coordinates"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "Polygon"
                          ]
                        },
                        "coordinates": {
                          "type": "array",
                          "items": {
                            "type": "array",
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "number"
                              },
                              "description": "[longitude, latitude] in WGS 84, optionally with the altitude as a third number"
                            },
                            "description": "A closed ring: at least 4 positions, the last equal to the first"
                          },
                          "description": "The outer ring, then any holes"
                        }
                      },
                      "required": [
                        "type",
                        "coordinates"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "MultiPoint"
                          ]
                        },
                        "coordinates": {
                          "type": "array",
                          "items": {
                            "type": "array",
                            "items": {
                              "type": "number"
                            },
                            "description": "[longitude, latitude] in WGS 84, optionally with the altitude as a third number"
                          },
                          "description": "Positions"
                        }
                      },
                      "required": [
                        "type",
                        "coordinates"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "MultiLineString"
                          ]
                        },
                        "coordinates": {
                          "type": "array",
                          "items": {
                            "type": "array",
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "number"
                              },
                              "description": "[longitude, latitude] in WGS 84, optionally with the altitude as a third number"
                            },
                            "description": "At least 2 positions"
                          },
                          "description": "Lines"
                        }
                      },
                      "required": [
                        "type",
                        "coordinates"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "MultiPolygon"
                          ]
                        },
                        "coordinates": {
                          "type": "array",
                          "items": {
                            "type": "array",
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "array",
                                "items": {
                                  "type": "number"
                                },
                                "description": "[longitude, latitude] in WGS 84, optionally with the altitude as a third number"
                              },
                              "description": "A closed ring: at least 4 positions, the last equal to the first"
                            },
                            "description": "The outer ring, then any holes"
                          },
                          "description": "Polygons"
                        }
                      },
                      "required": [
                        "type",
                        "coordinates"
                      ],
                      "additionalProperties": false
                    }
                  ]
                },
                "description": "The geometries"
              }
            },
            "required": [
              "type",
              "geometries"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ],
        "description": "Location as any GeoJSON geometry: point, line, polygon or a collection A GeoJSON geometry (Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, GeometryCollection)."
      },
      "spatialId": {
        "type": [
          "array",
          "null"
        ],
        "items": {
          "type": "string"
        },
        "description": "Spatial IDs (ZFXY) covering the task. Optional"
      },
      "isPrivate": {
        "type": [
          "boolean",
          "null"
        ],
        "description": "true when private; default false"
      },
      "source": {
        "type": [
          "string",
          "null"
        ],
        "description": "URL of this object in the system of record (a URI)"
      },
      "externalId": {
        "type": [
          "string",
          "null"
        ],
        "description": "Identifier in the system of record"
      },
      "dateCreated": {
        "type": [
          "string",
          "null"
        ],
        "format": "date-time",
        "description": "Creation time in the system of record (distinct from the broker attribute createdAt)"
      },
      "dateModified": {
        "type": [
          "string",
          "null"
        ],
        "format": "date-time",
        "description": "Last modification time in the system of record"
      }
    },
    "required": [
      "name",
      "description",
      "project",
      "milestone",
      "parent",
      "relatedTo",
      "refersTo",
      "progress",
      "statusLabel",
      "subtype",
      "priority",
      "assignee",
      "author",
      "start",
      "due",
      "completedAt",
      "estimatedDuration",
      "percentComplete",
      "keywords",
      "location",
      "spatialId",
      "isPrivate",
      "source",
      "externalId",
      "dateCreated",
      "dateModified"
    ],
    "additionalProperties": false
  }
}
