$schema: http://json-schema.org/draft-07/schema# title: Fully qualified Demes graph type: object additionalProperties: false properties: description: type: "string" doi: type: array items: type: string time_units: type: string # TODO: shouldn't this be an enum? generation_time: type: "number" exclusiveMinimum: 0 metadata: type: object additionalProperties: true demes: type: array minItems: 1 items: $ref: '#/definitions/deme' pulses: type: array items: $ref: '#/definitions/pulse' migrations: type: array items: $ref: '#/definitions/migration' required: - description - doi - time_units - demes - generation_time - pulses - migrations definitions: name: type: string rate: type: number minimum: 0 maximum: 1 proportion: type: number exclusiveMinimum: 0 maximum: 1 size: type: number exclusiveMinimum: 0 start_time: oneOf: - type: number exclusiveMinimum: 0 - const: "Infinity" end_time: type: number minimum: 0 epoch: type: object additionalProperties: false properties: end_time: $ref: '#/definitions/end_time' start_size: $ref: '#/definitions/size' end_size: $ref: '#/definitions/size' size_function: # TODO: make this an enumeration type: string cloning_rate: $ref: '#/definitions/rate' selfing_rate: $ref: '#/definitions/rate' required: - end_time - start_size - end_size - size_function - cloning_rate - selfing_rate deme: type: object additionalProperties: false properties: name: $ref: '#/definitions/name' description: type: "string" ancestors: type: array items: $ref: '#/definitions/name' proportions: type: array items: $ref: '#/definitions/proportion' start_time: $ref: '#/definitions/start_time' epochs: type: array minItems: 1 items: $ref: '#/definitions/epoch' required: - name - description - ancestors - proportions - start_time - epochs pulse: type: object additionalProperties: false properties: sources: type: array items: $ref: '#/definitions/name' dest: $ref: '#/definitions/name' time: type: number exclusiveMinimum: 0 proportions: type: array items: $ref: '#/definitions/proportion' required: - sources - dest - time - proportions migration: type: object additionalProperties: false properties: source: $ref: '#/definitions/name' dest: $ref: '#/definitions/name' start_time: $ref: '#/definitions/start_time' end_time: $ref: '#/definitions/end_time' rate: $ref: '#/definitions/rate' required: - source - dest - start_time - end_time - rate