{
  "$schema": "https://datapackage.org/profiles/2.0/tableschema.json",
  "title": "作業車両",
  "description": "作業に使う車両 1 台を、計画に使う形で表します。積載量、技能、出発と帰着の拠点、働ける時間で、ルート最適化（VRP）のソフトウェアの vehicle にそのまま渡せます。Smart Data Models の FleetVehicle（車隊の中の 1 台）のサブクラスで、車両そのもの（ナンバーなど）は vehicle で Vehicle を指します。",
  "x-type": "ServiceVehicle",
  "x-typeIri": "https://datamodels.jp/ns/fieldservice/ServiceVehicle",
  "x-version": "1.0.0",
  "x-schema": "https://datamodels.jp/schema/fieldservice/ServiceVehicle/v1.0.0.json",
  "x-context": "https://datamodels.jp/context/fieldservice/v1.jsonld",
  "x-translations": {
    "en": {
      "title": "Service vehicle",
      "description": "One vehicle used for the work, as planning sees it: capacity, skills, start and end depot and working hours, so it maps directly to a vehicle of route optimisation (VRP) software. A subclass of Smart Data Models FleetVehicle (one vehicle of a fleet); the physical vehicle (plate and the like) is the Vehicle that vehicle points to."
    }
  },
  "fields": [
    {
      "name": "id",
      "title": "エンティティの ID",
      "description": "エンティティの ID（URI。例：urn:ngsi-ld:ServiceVehicle:001）",
      "type": "string",
      "constraints": {
        "required": true,
        "unique": true
      },
      "x-translations": {
        "en": {
          "title": "Entity id",
          "description": "Entity id: a URI, for example urn:ngsi-ld:ServiceVehicle:001"
        }
      }
    },
    {
      "name": "label",
      "title": "呼び名",
      "description": "呼び名。言語ごとに書きます（例：{\"ja\": \"2号車\", \"en\": \"Truck 2\"}）。",
      "type": "object",
      "x-iri": "http://www.w3.org/2000/01/rdf-schema#label",
      "constraints": {
        "jsonSchema": {
          "type": "object",
          "minProperties": 1,
          "propertyNames": {
            "pattern": "^[A-Za-z]{2,3}(-[A-Za-z0-9]{1,8})*$"
          },
          "additionalProperties": {
            "type": "string",
            "minLength": 1
          },
          "description": "What the provider calls it, per language (for example {\"ja\": \"2号車\", \"en\": \"Truck 2\"})"
        }
      },
      "x-translations": {
        "en": {
          "title": "What the provider calls it, per language",
          "description": "What the provider calls it, per language (for example {\"ja\": \"2号車\", \"en\": \"Truck 2\"})"
        }
      }
    },
    {
      "name": "vehicle",
      "title": "車両そのもの",
      "description": "車両そのもの（Smart Data Models の Vehicle）。FleetVehicle と同じ意味です。",
      "type": "string",
      "format": "uri",
      "x-iri": "https://smartdatamodels.org/dataModel.Transportation/vehicle",
      "x-translations": {
        "en": {
          "title": "The physical vehicle",
          "description": "The physical vehicle (a Smart Data Models Vehicle), as in FleetVehicle"
        }
      }
    },
    {
      "name": "fleetVehicleType",
      "title": "車両の用途",
      "description": "車両の用途（FleetVehicle と同じ意味。例：Waste collection）",
      "type": "string",
      "x-iri": "https://smartdatamodels.org/dataModel.Transportation/fleetVehicleType",
      "constraints": {
        "minLength": 1
      },
      "x-translations": {
        "en": {
          "description": "What the vehicle is used for, as in FleetVehicle (for example Waste collection)"
        }
      }
    },
    {
      "name": "provider",
      "title": "作業を引き受ける組織",
      "description": "作業を引き受ける組織（自治体、委託先など）",
      "type": "string",
      "format": "uri",
      "x-iri": "https://schema.org/provider",
      "x-translations": {
        "en": {
          "title": "The organisation that does the work",
          "description": "The organisation that does the work (a municipality, a contractor)"
        }
      }
    },
    {
      "name": "localGovernmentCode",
      "title": "作業する自治体の全国地方公共団体コード",
      "description": "作業する自治体の全国地方公共団体コード（6 桁）",
      "type": "string",
      "x-iri": "https://datamodels.jp/ns/common/localGovernmentCode",
      "constraints": {
        "pattern": "\\d{6}"
      },
      "x-translations": {
        "en": {
          "title": "Local government code",
          "description": "Local government code (6 digits) of the municipality it works for"
        }
      }
    },
    {
      "name": "capacity",
      "title": "積載量",
      "description": "積載量。次元ごとの数で、依頼の load と同じ次元と単位にします。ルート最適化の capacity にあたります。複数の値は ; で区切ります。",
      "type": "list",
      "itemType": "number",
      "delimiter": ";",
      "x-iri": "https://datamodels.jp/ns/fieldservice/capacity",
      "constraints": {
        "required": true,
        "minLength": 1
      },
      "x-translations": {
        "en": {
          "description": "How much it can carry, one number per dimension, in the dimensions and units of the requests' load; the capacity of route optimisation. Several values separated by ;."
        }
      }
    },
    {
      "name": "skills",
      "title": "車両ができること",
      "description": "車両ができること（例：two-person）。依頼の skills がすべてここにある車両だけが、その依頼に割り当てられます。複数の値は ; で区切ります。",
      "type": "list",
      "itemType": "string",
      "delimiter": ";",
      "x-iri": "https://datamodels.jp/ns/fieldservice/skills",
      "constraints": {
        "minLength": 1
      },
      "x-translations": {
        "en": {
          "title": "What the vehicle can do",
          "description": "What the vehicle can do (for example two-person); a request goes only to a vehicle that has all its skills. Several values separated by ;."
        }
      }
    },
    {
      "name": "depot",
      "title": "出発する拠点",
      "description": "出発する拠点（Facility）",
      "type": "string",
      "format": "uri",
      "x-iri": "https://datamodels.jp/ns/fieldservice/depot",
      "x-translations": {
        "en": {
          "title": "Where the work starts",
          "description": "Where the work starts: a Facility"
        }
      }
    },
    {
      "name": "endDepot",
      "title": "帰着する拠点",
      "description": "帰着する拠点（Facility）。無ければ depot に戻ります。",
      "type": "string",
      "format": "uri",
      "x-iri": "https://datamodels.jp/ns/fieldservice/endDepot",
      "x-translations": {
        "en": {
          "title": "Where the work ends",
          "description": "Where the work ends: a Facility; without it, the vehicle returns to depot"
        }
      }
    },
    {
      "name": "workingHours",
      "title": "働ける曜日と時間",
      "description": "働ける曜日と時間（OpeningHours の値のリスト）。ルート最適化の、車両の time window の元になります。",
      "type": "array",
      "x-iri": "https://datamodels.jp/ns/fieldservice/workingHours",
      "constraints": {
        "jsonSchema": {
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "https://datamodels.jp/schema/common/OpeningHours/v1.0.0.json"
          },
          "description": "When it can work, as a list of OpeningHours values (days of the week, start and end time); the source of a vehicle's time window in route optimisation"
        }
      },
      "x-translations": {
        "en": {
          "description": "When it can work, as a list of OpeningHours values (days of the week, start and end time); the source of a vehicle's time window in route optimisation"
        }
      }
    },
    {
      "name": "maxStops",
      "title": "1 日に回れる件数の上限",
      "description": "1 日に回れる件数の上限",
      "type": "integer",
      "x-iri": "https://datamodels.jp/ns/fieldservice/maxStops",
      "constraints": {
        "minimum": 1
      },
      "x-translations": {
        "en": {
          "title": "The most stops in a day",
          "description": "The most stops in a day"
        }
      }
    },
    {
      "name": "maxWorkDuration",
      "title": "1 日に働ける時間の上限",
      "description": "1 日に働ける時間の上限（ISO 8601 の期間）",
      "type": "string",
      "x-pattern": "^P(?!$)(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+(\\.\\d+)?S)?)?$",
      "x-iri": "https://datamodels.jp/ns/fieldservice/maxWorkDuration",
      "x-translations": {
        "en": {
          "description": "The longest working time in a day, as an ISO 8601 duration"
        }
      }
    },
    {
      "name": "crew",
      "title": "この車両で働く班",
      "description": "この車両で働く班（Crew）",
      "type": "string",
      "format": "uri",
      "x-iri": "https://datamodels.jp/ns/fieldservice/crew",
      "x-translations": {
        "en": {
          "title": "The crew that works with this vehicle",
          "description": "The crew that works with this vehicle: a Crew"
        }
      }
    },
    {
      "name": "source",
      "title": "データの出典",
      "description": "データの出典（URL など）",
      "type": "string",
      "x-iri": "https://smart-data-models.github.io/data-models/terms.jsonld#/definitions/source",
      "constraints": {
        "minLength": 1
      },
      "x-translations": {
        "en": {
          "title": "Where the data comes from",
          "description": "Where the data comes from (a URL, for example)"
        }
      }
    }
  ],
  "primaryKey": [
    "id"
  ],
  "missingValues": [
    ""
  ]
}
