$schema: http://json-schema.org/draft/2020-12/schema
$id: http://www.opengis.net/spec/movingfeatures/json/1.0/prism/MF-JSON_Prism.schema.json
title: OGC Moving Feature JSON Prism schema
$defs:
  nullableString:
    oneOf:
    - type: 'null'
    - type: string
    $anchor: nullableString
  dateTimeValue:
    description: A date-time value as ISO 8601 string or a numeric epoch (e.g., milliseconds).
    oneOf:
    - type: string
    - type: number
    $anchor: dateTimeValue
  linkObject:
    type: object
    required:
    - href
    - type
    properties:
      href:
        type: string
        format: uri
      type:
        type: string
    additionalProperties: false
    $anchor: linkObject
  temporalGeometry:
    title: TemporalGeometry Object
    oneOf:
    - $ref: '#/$defs/temporalPrimitiveGeometry'
    - $ref: '#/$defs/temporalComplexGeometry'
    $anchor: temporalGeometry
  temporalProperties:
    title: TemporalProperties Object
    oneOf:
    - type: 'null'
    - type: array
      minItems: 1
      items:
        $ref: '#/$defs/parametricValues'
    $anchor: temporalProperties
  coordRefSys:
    $ref: https://beta.schemas.opengis.net/json-fg/coordrefsys.json
    $anchor: coordRefSys
  tempRefSys:
    $ref: https://beta.schemas.opengis.net/json-fg/coordrefsys.json
    $anchor: tempRefSys
  movingFeature:
    title: MovingFeature object in a MF-JSON Prism
    type: object
    required:
    - type
    - temporalGeometry
    properties:
      temporalGeometry:
        $ref: '#/$defs/temporalGeometry'
        x-jsonld-id: https://w3id.org/ogc/movingfeatures/hasTemporalGeometry
        x-jsonld-type: '@id'
        x-jsonld-container: '@set'
      coordRefSys:
        $ref: '#/$defs/coordRefSys'
      tempRefSys:
        $ref: '#/$defs/tempRefSys'
        x-jsonld-id: https://w3id.org/ogc/movingfeatures/hasTRS
        x-jsonld-type: '@id'
      temporalProperties:
        $ref: '#/$defs/temporalProperties'
        x-jsonld-id: https://w3id.org/ogc/movingfeatures/hasTemporalProperty
        x-jsonld-type: '@id'
        x-jsonld-container: '@set'
    $anchor: movingFeature
  movingFeatureCollection:
    title: MovingFeatureCollection object in a MF-JSON Prism
    type: object
    required:
    - type
    - features
    properties:
      type:
        type: string
        enum:
        - FeatureCollection
      features:
        type: array
        items:
          allOf:
          - $ref: https://opengeospatial.github.io/bblocks/annotated-schemas/geo/json-fg/feature-lenient/schema.yaml
          - oneOf:
            - $ref: '#/$defs/movingFeature'
      coordRefSys:
        $ref: '#/$defs/coordRefSys'
      tempRefSys:
        $ref: '#/$defs/tempRefSys'
        x-jsonld-id: https://w3id.org/ogc/movingfeatures/hasTRS
        x-jsonld-type: '@id'
      label:
        $ref: '#/$defs/nullableString'
    $anchor: movingFeatureCollection
  datetimes:
    type: array
    uniqueItems: true
    minItems: 1
    items:
      $ref: '#/$defs/dateTimeValue'
    $anchor: datetimes
  temporalPrimitiveGeometry:
    type: object
    title: TemporalPrimitiveGeometry Object
    required:
    - type
    - datetimes
    - coordinates
    dependentRequired:
      orientations:
      - base
    properties:
      type:
        type: string
        enum:
        - MovingPoint
        - MovingLineString
        - MovingPolygon
        - MovingPointCloud
      datetimes:
        $ref: '#/$defs/datetimes'
        x-jsonld-id: https://w3id.org/ogc/movingfeatures/datetimes
        x-jsonld-type: http://www.w3.org/2001/XMLSchema#dateTime
        x-jsonld-container: '@list'
      coordinates:
        oneOf:
        - type: array
          minItems: 2
          items:
            type: array
            minItems: 2
            items:
              type: number
        - type: array
          minItems: 2
          items:
            type: array
            minItems: 2
            items:
              type: array
              minItems: 2
              items:
                type: number
        - type: array
          minItems: 2
          items:
            type: array
            items:
              type: array
              minItems: 4
              items:
                type: array
                minItems: 2
                items:
                  type: number
      interpolation:
        $ref: '#/$defs/geometryInterpolation'
        x-jsonld-id: https://w3id.org/ogc/movingfeatures/interpolation
        x-jsonld-type: http://www.w3.org/2001/XMLSchema#string
      base:
        oneOf:
        - type: 'null'
        - $ref: '#/$defs/linkObject'
      orientations:
        oneOf:
        - type: 'null'
        - type: array
          items:
            $ref: '#/$defs/orientation'
        x-jsonld-id: https://w3id.org/ogc/movingfeatures/orientations
        x-jsonld-type: '@id'
      coordRefSys:
        $ref: '#/$defs/coordRefSys'
      tempRefSys:
        $ref: '#/$defs/tempRefSys'
        x-jsonld-id: https://w3id.org/ogc/movingfeatures/hasTRS
        x-jsonld-type: '@id'
    additionalProperties: false
    $anchor: temporalPrimitiveGeometry
  geometryInterpolation:
    title: Interpolation method for TemporalPrimitiveGeometry (MotionCurve)
    anyOf:
    - type: string
      enum:
      - Discrete
      - Step
      - Linear
      - Quadratic
      - Cube
      default: Linear
    - type: string
      format: uri
    $anchor: geometryInterpolation
  temporalComplexGeometry:
    type: object
    title: TemporalComplexGeometry Object
    required:
    - type
    - prisms
    properties:
      type:
        type: string
        enum:
        - MovingGeometryCollection
      prisms:
        type: array
        items:
          $ref: '#/$defs/temporalPrimitiveGeometry'
      coordRefSys:
        $ref: '#/$defs/coordRefSys'
      tempRefSys:
        $ref: '#/$defs/tempRefSys'
        x-jsonld-id: https://w3id.org/ogc/movingfeatures/hasTRS
        x-jsonld-type: '@id'
    additionalProperties: false
    $anchor: temporalComplexGeometry
  orientation:
    type: object
    required:
    - scales
    - angles
    properties:
      scales:
        type: array
        minItems: 3
        maxItems: 3
        items:
          type: number
      angles:
        type: array
        minItems: 3
        maxItems: 3
        items:
          type: number
    additionalProperties: false
    $anchor: orientation
  parametricValues:
    type: object
    required:
    - datetimes
    properties:
      datetimes:
        $ref: '#/$defs/datetimes'
        x-jsonld-id: https://w3id.org/ogc/movingfeatures/datetimes
        x-jsonld-type: http://www.w3.org/2001/XMLSchema#dateTime
        x-jsonld-container: '@list'
    patternProperties:
      ^S_:
        anyOf:
        - $ref: '#/$defs/measureType'
        - $ref: '#/$defs/textType'
        - $ref: '#/$defs/imageType'
    additionalProperties: false
    $anchor: parametricValues
  measureType:
    type: object
    required:
    - type
    - values
    properties:
      type:
        type: string
        enum:
        - Measure
      values:
        type: array
        items:
          oneOf:
          - type: 'null'
          - type: number
        x-jsonld-id: https://w3id.org/ogc/movingfeatures/values
        x-jsonld-container: '@list'
      interpolation:
        $ref: '#/$defs/propertyInterpolation'
        x-jsonld-id: https://w3id.org/ogc/movingfeatures/interpolation
        x-jsonld-type: http://www.w3.org/2001/XMLSchema#string
      form:
        anyOf:
        - type: string
          minLength: 3
          maxLength: 3
        - type: string
          format: uri
        x-jsonld-id: https://w3id.org/ogc/movingfeatures/form
        x-jsonld-type: http://www.w3.org/2001/XMLSchema#string
      description:
        type: string
    additionalProperties: false
    $anchor: measureType
  textType:
    type: object
    required:
    - type
    - values
    properties:
      type:
        type: string
        enum:
        - Text
      values:
        type: array
        items:
          oneOf:
          - type: 'null'
          - type: string
          - type: boolean
        x-jsonld-id: https://w3id.org/ogc/movingfeatures/values
        x-jsonld-container: '@list'
      interpolation:
        $ref: '#/$defs/propertyInterpolation'
        x-jsonld-id: https://w3id.org/ogc/movingfeatures/interpolation
        x-jsonld-type: http://www.w3.org/2001/XMLSchema#string
      description:
        type: string
    additionalProperties: false
    $anchor: textType
  imageType:
    type: object
    required:
    - type
    - values
    properties:
      type:
        type: string
        enum:
        - Image
      values:
        type: array
        items:
          oneOf:
          - type: 'null'
          - type: string
        x-jsonld-id: https://w3id.org/ogc/movingfeatures/values
        x-jsonld-container: '@list'
      interpolation:
        $ref: '#/$defs/propertyInterpolation'
        x-jsonld-id: https://w3id.org/ogc/movingfeatures/interpolation
        x-jsonld-type: http://www.w3.org/2001/XMLSchema#string
      description:
        type: string
    additionalProperties: false
    $anchor: imageType
  propertyInterpolation:
    title: Interpolation method for ParametricValues
    anyOf:
    - type: string
      enum:
      - Discrete
      - Step
      - Linear
      - Regression
      default: Discrete
    - type: string
      format: uri
    $anchor: propertyInterpolation
  namedCRS:
    type: object
    required:
    - type
    - properties
    properties:
      type:
        type: string
        enum:
        - Name
      properties:
        type: object
        required:
        - name
        additionalProperties: false
        properties:
          name:
            type: string
            default: urn:ogc:def:coordRefSys:OGC:1.3:CRS84
    additionalProperties: false
    $anchor: namedCRS
  linkedCRS:
    type: object
    required:
    - type
    - properties
    properties:
      type:
        type: string
        enum:
        - Link
      properties:
        $ref: '#/$defs/linkObject'
    additionalProperties: false
    $anchor: linkedCRS
  namedTRS:
    type: object
    required:
    - type
    - properties
    properties:
      type:
        type: string
        enum:
        - Name
      properties:
        type: object
        required:
        - name
        additionalProperties: false
        properties:
          name:
            type: string
            default: urn:ogc:data:time:iso8601
    additionalProperties: false
    $anchor: namedTRS
anyOf:
- $ref: '#/$defs/movingFeatureCollection'
- $ref: '#/$defs/movingFeature'
x-jsonld-extra-terms:
  MovingFeature:
    x-jsonld-id: https://w3id.org/ogc/movingfeatures/MovingFeature
    x-jsonld-type: '@id'
  prism:
    x-jsonld-id: https://w3id.org/ogc/movingfeatures/hasFoliation
    x-jsonld-type: '@id'
  foliation:
    x-jsonld-id: https://w3id.org/ogc/movingfeatures/hasFoliation
    x-jsonld-type: '@id'
  leaves:
    x-jsonld-id: https://w3id.org/ogc/movingfeatures/hasLeaf
    x-jsonld-type: '@id'
    x-jsonld-container: '@list'
  leaf:
    x-jsonld-id: https://w3id.org/ogc/movingfeatures/hasLeaf
    x-jsonld-type: '@id'
  times:
    x-jsonld-id: https://w3id.org/ogc/movingfeatures/times
    x-jsonld-type: http://www.w3.org/2001/XMLSchema#double
    x-jsonld-container: '@list'
  datetimes:
    x-jsonld-id: https://w3id.org/ogc/movingfeatures/datetimes
    x-jsonld-type: http://www.w3.org/2001/XMLSchema#dateTime
    x-jsonld-container: '@list'
  interpolation:
    x-jsonld-id: https://w3id.org/ogc/movingfeatures/interpolation
    x-jsonld-type: http://www.w3.org/2001/XMLSchema#string
  atTime:
    x-jsonld-id: https://w3id.org/ogc/movingfeatures/atTime
    x-jsonld-type: http://www.w3.org/2001/XMLSchema#dateTime
  validTime:
    x-jsonld-id: https://w3id.org/ogc/movingfeatures/validTime
    x-jsonld-type: '@id'
  orientations:
    x-jsonld-id: https://w3id.org/ogc/movingfeatures/orientations
    x-jsonld-type: '@id'
  values:
    x-jsonld-id: https://w3id.org/ogc/movingfeatures/values
    x-jsonld-container: '@list'
  form:
    x-jsonld-id: https://w3id.org/ogc/movingfeatures/form
    x-jsonld-type: http://www.w3.org/2001/XMLSchema#string
  measure:
    x-jsonld-id: https://w3id.org/ogc/movingfeatures/measure
    x-jsonld-type: http://www.w3.org/2001/XMLSchema#double
  MovingPoint: https://w3id.org/ogc/movingfeatures/MovingPoint
  MovingLineString: https://w3id.org/ogc/movingfeatures/MovingLineString
  MovingPolygon: https://w3id.org/ogc/movingfeatures/MovingPolygon
  Prism: https://w3id.org/ogc/movingfeatures/Prism
  TemporalGeometry: https://w3id.org/ogc/movingfeatures/TemporalGeometry
  Foliation: https://w3id.org/ogc/movingfeatures/Foliation
  Leaf: https://w3id.org/ogc/movingfeatures/Leaf
  ParametricValues: https://w3id.org/ogc/movingfeatures/ParametricValues
  Linear: http://www.opengis.net/def/interpolation/Linear
  Step: http://www.opengis.net/def/interpolation/Step
  Discrete: http://www.opengis.net/def/interpolation/Discrete
  Timestamp: http://www.opengis.net/def/param/Timestamp
  Measure: http://www.opengis.net/def/param/Measure
x-jsonld-base: https://w3id.org/ogc/movingfeatures/prism/
x-jsonld-vocab: https://w3id.org/ogc/movingfeatures#
x-jsonld-prefixes:
  mf: https://w3id.org/ogc/movingfeatures/
  xsd: http://www.w3.org/2001/XMLSchema#
  time: http://www.w3.org/2006/time#
  dcterms: http://purl.org/dc/terms/
