components:
  schemas:
    ArcgisFeatureServerArcgisFeatureSet:
      additionalProperties: true
      properties:
        exceededTransferLimit:
          type: boolean
        features:
          items:
            additionalProperties: true
            properties:
              attributes:
                $ref: "#/components/schemas/ArcgisFeatureServerArcgisLayer0Attributes"
              geometry:
                description: Native geometry and spatial reference are not constrained by attribute metadata.
            type: object
          type: array
      type: object
    ArcgisFeatureServerArcgisGeoJson:
      additionalProperties: true
      properties:
        features:
          items:
            additionalProperties: true
            properties:
              geometry:
                description: Geometry representation is not constrained by the retained attribute metadata.
              properties:
                $ref: "#/components/schemas/ArcgisFeatureServerArcgisLayer0Attributes"
              type:
                type: string
            type: object
          type: array
        type:
          type: string
      type: object
    ArcgisFeatureServerArcgisJsonEnvelope:
      additionalProperties: true
      properties:
        exceededTransferLimit:
          type: boolean
        features:
          items:
            additionalProperties: true
            properties:
              attributes:
                $ref: "#/components/schemas/ArcgisFeatureServerArcgisLayer0Attributes"
              geometry:
                description: Geometry is not constrained by attribute metadata.
              properties:
                $ref: "#/components/schemas/ArcgisFeatureServerArcgisLayer0Attributes"
              type:
                type: string
            type: object
          type: array
        type:
          type: string
      type: object
    ArcgisFeatureServerArcgisLayer0Attributes:
      additionalProperties: true
      properties:
        Academic_Programme_Category_EN:
          description: "Publisher field type: esriFieldTypeString"
          maxLength: 43
          title: Academic_Programme_Category_EN
          type:
            - string
            - "null"
        Academic_Programme_Category_TC:
          description: "Publisher field type: esriFieldTypeString"
          maxLength: 33
          title: Academic_Programme_Category_TC
          type:
            - string
            - "null"
        Academic_Year:
          description: "Publisher field type: esriFieldTypeString"
          maxLength: 7
          title: Academic_Year
          type:
            - string
            - "null"
        Easting:
          description: "Publisher field type: esriFieldTypeDouble"
          title: Easting
          type:
            - number
            - "null"
        Latitude:
          description: "Publisher field type: esriFieldTypeDouble"
          title: Latitude
          type:
            - number
            - "null"
        Level_of_study_EN:
          description: "Publisher field type: esriFieldTypeString"
          maxLength: 21
          title: Level_of_study_EN
          type:
            - string
            - "null"
        Level_of_study_TC:
          description: "Publisher field type: esriFieldTypeString"
          maxLength: 21
          title: Level_of_study_TC
          type:
            - string
            - "null"
        Longitude:
          description: "Publisher field type: esriFieldTypeDouble"
          title: Longitude
          type:
            - number
            - "null"
        Mode_of_study_EN:
          description: "Publisher field type: esriFieldTypeString"
          maxLength: 9
          title: Mode_of_study_EN
          type:
            - string
            - "null"
        Mode_of_study_TC:
          description: "Publisher field type: esriFieldTypeString"
          maxLength: 9
          title: Mode_of_study_TC
          type:
            - string
            - "null"
        Northing:
          description: "Publisher field type: esriFieldTypeDouble"
          title: Northing
          type:
            - number
            - "null"
        OBJECTID:
          description: "Publisher field type: esriFieldTypeOID"
          title: OBJECTID
          type: integer
        Student_Enrolment_Headcount:
          description: "Publisher field type: esriFieldTypeDouble"
          title: Student_Enrolment_Headcount
          type:
            - number
            - "null"
        University_EN:
          description: "Publisher field type: esriFieldTypeString"
          maxLength: 50
          title: University_EN
          type:
            - string
            - "null"
        University_TC:
          description: "Publisher field type: esriFieldTypeString"
          maxLength: 18
          title: University_TC
          type:
            - string
            - "null"
      type: object
    PublisherDictionaryStudentEnrolmentHeadcountDataDictionary:
      description: Dictionary for Student Enrolment (Headcount) of UGC-funded Programmes by University, Level of Study, Mode of Study and Academic Programme Category. This describes data fields, not a documented HTTP response schema. Supporting semantic context from the publisher DOCX dictionary https://www.ugcs.gov.hk/datagovhk/Students3_data_dictionary_en.docx. Native ArcGIS/WFS wire names and types remain in their own operation schemas; a dictionary-to-wire mapping is not asserted.
      properties:
        Academic Programme Category_EN:
          description: Academic Programme Category in English.
          enum:
            - Medicine
            - Dentistry
            - Studies Allied to Medicine and Health
            - Biological Sciences
            - Physical Sciences
            - Mathematical Sciences
            - Computer Science and Information Technology
            - Engineering and Technology
            - Architecture and Town Planning
            - Business and Management Studies
            - Social Sciences
            - Law
            - Media, Journalism and Communications
            - Languages and Related Studies
            - Humanities
            - Arts, Design and Performing Arts
            - Education
          type: string
        Academic Programme Category_TC:
          description: Academic Programme Category in Traditional Chinese.
          enum:
            - 醫學
            - 牙醫學
            - 與醫學及衛生有關的學科
            - 生物科學
            - 物理科學
            - 數學科學
            - 電腦科學及資訊科技
            - 工程及科技
            - 建築學及城市規劃
            - 工商管理
            - 社會科學
            - 法律
            - 媒體、新聞及傳播
            - 語言及相關科目
            - 人文學科
            - 藝術、設計及演藝
            - 教育
          type: string
        Academic Year:
          description: Academic year in YYYY/YY format (for example, 2018/19).
          pattern: ^[0-9]{4}/[0-9]{2}$
          type: string
        Level of study_EN:
          description: Level of study in English.
          enum:
            - Sub-degree
            - Undergraduate
            - Taught Postgraduate
            - Research Postgraduate
          type: string
        Level of study_TC:
          description: Level of study in Traditional Chinese.
          enum:
            - 副學位課程
            - 學士學位課程
            - 研究院修課課程
            - 研究院研究課程
          type: string
        Mode of study_EN:
          description: Mode of study in English.
          enum:
            - Full-time
            - Part-time
          type: string
        Mode of study_TC:
          description: Mode of study in Traditional Chinese.
          enum:
            - 全日制
            - 兼讀制
          type: string
        Student Enrolment (Headcount):
          description: Student enrolment headcount. The dictionary declares an Integer format. Some UGC-funded programmes map to multiple academic programme categories and are allocated across those categories on a pro rata basis; the resulting figures may be decimal. Figures in this table are rounded to the nearest whole number and may not add up to corresponding totals.
          type: integer
        University_EN:
          description: University name in English.
          enum:
            - City University of Hong Kong
            - Hong Kong Baptist University
            - Lingnan University
            - The Chinese University of Hong Kong
            - The Education University of Hong Kong
            - The Hong Kong Polytechnic University
            - The Hong Kong University of Science and Technology
            - The University of Hong Kong
          type: string
        University_TC:
          description: University name in Traditional Chinese.
          enum:
            - 香港城市大學
            - 香港浸會大學
            - 嶺南大學
            - 香港中文大學
            - 香港教育大學
            - 香港理工大學
            - 香港科技大學
            - 香港大學
          type: string
      type: object
    WfsMapServerWfsFeatureCollection:
      additionalProperties: true
      properties:
        features:
          items:
            additionalProperties: true
            properties:
              geometry:
                description: Geometry representation is not constrained by the retained attribute metadata.
              properties:
                description: DescribeFeatureType attribute declarations unavailable; record fields remain unknown.
              type:
                type: string
            type: object
          type: array
        type:
          type: string
      type: object
externalDocs:
  url: https://portal.csdi.gov.hk/csdi-webpage/doc/GeoSpatialServices
info:
  description: "Deterministic derivative of retained native CSDI metadata. Read-only GET operations are selected only where native capabilities and protocol documentation support them. Publisher originals remain separate. Successful metadata retrieval does not prove current data-query success, complete response fields or all layer combinations. Publisher dictionary semantic context: https://www.ugcs.gov.hk/datagovhk/Students3_data_dictionary_en.docx. Supporting dictionary components retain the earlier conversion; native operation paths, server identities and wire-field schemas remain unchanged."
  title: University Grants Committee Secretariat — Student Enrolment (Headcount) of UGC-funded Programmes by University, Level of Study, Mode of Study and Academic Programme Category
  version: csdi-native-readonly-v1
openapi: 3.1.0
paths:
  /server/rest/services/common/ugc_rcd_1697186993343_80839/FeatureServer/{layerId}/query:
    get:
      description: Read-only GET query follows the source-advertised Query capability. One parameterized operation covers all queryable layers. Metadata field types are declared without inventing universally required attributes. Omitted f may produce the native REST default representation, which is not asserted as a JSON payload.
      externalDocs:
        url: https://developers.arcgis.com/rest/services-reference/enterprise/query-feature-service-layer/
      operationId: ArcgisFeatureServerQueryFeatures
      parameters:
        - description: Published queryable layer or table. Values are publisher identifiers; examples are choices, not a closed enumeration. The full ID/title directory is in x-csdi-layer-choices.
          examples:
            choice1:
              summary: geotagging
              value: 0
          in: path
          name: layerId
          required: true
          schema:
            type: integer
          x-choice-count: 1
        - description: Advertised query representation. Supply this selector for the represented JSON/GeoJSON/PBF responses.
          example: json
          in: query
          name: f
          required: false
          schema:
            enum:
              - json
              - geojson
              - pbf
            type: string
        - description: SQL WHERE expression over the published fields; source protocol supports this read-only query filter.
          example: 1=1
          in: query
          name: where
          required: false
          schema:
            type: string
        - description: Comma-separated source field names, or *. Field schemas are conditional on the selected layer and returned fields.
          example: "*"
          in: query
          name: outFields
          required: false
          schema:
            type: string
        - description: Whether native feature geometry should be included.
          example: false
          in: query
          name: returnGeometry
          required: false
          schema:
            type: boolean
        - description: Bound returned records where the selected layer advertises pagination; no global range is inferred.
          example: 1
          in: query
          name: resultRecordCount
          required: false
          schema:
            type: integer
          x-supported-layer-ids:
            - 0
      responses:
        "200":
          content:
            application/geo+json:
              schema:
                $ref: "#/components/schemas/ArcgisFeatureServerArcgisGeoJson"
            application/json:
              schema:
                $ref: "#/components/schemas/ArcgisFeatureServerArcgisJsonEnvelope"
            application/x-protobuf:
              schema:
                format: binary
                type: string
          description: Native publisher response; protocol or business errors may also be returned. Metadata connection and actual data-query success are separate.
      servers:
        - url: https://portal.csdi.gov.hk
      summary: Query published features
      tags:
        - ArcGIS REST
      x-native-source-evidence:
        - contentType: text/plain;charset=UTF-8
          httpStatus: 200
          kind: arcgis-service
          parseStatus: pass
          role: arcgis-service
          sha256: f4ab9b02aa0edd654f5e3e9e3218a106cc6af1086fd5ceb78c25c5e52cd75cef
          url: https://portal.csdi.gov.hk/server/rest/services/common/ugc_rcd_1697186993343_80839/FeatureServer?f=pjson
        - contentType: text/plain;charset=UTF-8
          httpStatus: 200
          kind: arcgis-layer
          parseStatus: pass
          role: arcgis-layer
          sha256: 9345bedc972e9f2f1d34e79a3d69447759a562d478972e6cdaaef68887c3a722
          url: https://portal.csdi.gov.hk/server/rest/services/common/ugc_rcd_1697186993343_80839/FeatureServer/0?f=pjson
  /server/services/common/ugc_rcd_1697186993343_80839/MapServer/WFSServer:
    get:
      description: One read-only GET operation selects published feature types by name. Attribute types derive from retained DescribeFeatureType XSD when available; missing XSD, geometry, unread response data and unknown fields remain explicit limitations.
      externalDocs:
        url: https://docs.ogc.org/is/09-025r2/09-025r2.html
      operationId: WfsMapServerGetFeature
      parameters:
        - description: OGC service identifier.
          example: WFS
          in: query
          name: service
          required: true
          schema:
            enum:
              - WFS
            type: string
        - description: Exact capabilities version.
          example: 2.0.0
          in: query
          name: version
          required: true
          schema:
            enum:
              - 2.0.0
            type: string
        - description: Read-only operation advertised by GetCapabilities.
          example: GetFeature
          in: query
          name: request
          required: true
          schema:
            enum:
              - GetFeature
            type: string
        - description: Published feature type names; multiple selections follow the advertised protocol syntax. Values are publisher identifiers; examples are choices, not a closed enumeration. The full ID/title directory is in x-csdi-layer-choices.
          examples:
            choice1:
              summary: geotagging
              value: csdi:geotagging
          in: query
          name: typeNames
          required: true
          schema:
            type: string
          x-choice-count: 1
        - description: Advertised native representation; JSON, GML, CSV and images are kept distinct.
          example: GEOJSON
          in: query
          name: outputFormat
          required: false
          schema:
            enum:
              - GML32
              - GML32+ZIP
              - GML32+GZIP
              - application/gml+xml; version=3.2
              - GML3
              - GML3+ZIP
              - GML3+GZIP
              - text/xml; subtype=gml/3.1.1
              - GML2
              - GML2+ZIP
              - GML2+GZIP
              - text/xml; subtype=gml/2.1.2
              - GEOJSON
              - GEOJSON+ZIP
              - GEOJSON+GZIP
              - ESRIGEOJSON
              - ESRIGEOJSON+ZIP
              - ESRIGEOJSON+GZIP
              - KML
              - application/vnd.google-earth.kml xml
              - application/vnd.google-earth.kml+xml
              - KMZ
              - application/vnd.google-earth.kmz
              - SHAPE+ZIP
              - CSV
              - CSV+ZIP
              - CSV+GZIP
              - Geopackage
              - Geopackage+ZIP
            type: string
        - description: OGC bounded feature limit; example requests one feature without claiming a server-wide bound.
          example: 1
          in: query
          name: count
          required: false
          schema:
            type: integer
        - description: Output CRS choices advertised by at least one feature type; support may vary by selected type.
          example: urn:ogc:def:crs:EPSG::4326
          in: query
          name: srsName
          required: false
          schema:
            type: string
      responses:
        "200":
          content:
            "*/*":
              schema:
                description: Native Geopackage+ZIP output; wire media type/fields are not constrained.
            application/geo+json:
              schema:
                $ref: "#/components/schemas/WfsMapServerWfsFeatureCollection"
            application/gml+xml:
              schema:
                type: string
            application/json:
              schema:
                $ref: "#/components/schemas/WfsMapServerWfsFeatureCollection"
            application/vnd.google-earth.kml+xml:
              schema:
                type: string
            text/csv:
              schema:
                description: Native CSV; row/column wire conformance is not inferred from JSON schemas.
                type: string
            text/xml:
              schema:
                type: string
          description: Native publisher response; protocol or business errors may also be returned. Metadata connection and actual data-query success are separate.
      servers:
        - url: https://portal.csdi.gov.hk
      summary: Retrieve published features
      tags:
        - WFS
      x-advertised-crss:
        - urn:ogc:def:crs:EPSG::4326
      x-native-source-evidence:
        - contentType: text/xml;charset=UTF-8
          httpStatus: 200
          kind: wfs-capabilities
          parseStatus: pass
          role: wfs-capabilities
          sha256: bb185f90a5323f53b38da34d803fc3086612154e3e704936fc74e67343798508
          url: https://portal.csdi.gov.hk/server/services/common/ugc_rcd_1697186993343_80839/MapServer/WFSServer?service=wfs&request=GetCapabilities
x-csdi-layer-choices:
  - id: 0
    protocol: arcgis
    title: geotagging
  - id: csdi:geotagging
    protocol: wfs
    title: geotagging
x-csdi-source-evidence:
  - contentType: application/xml;charset=UTF-8
    httpStatus: 200
    kind: csw-record
    parseStatus: pass
    role: csw-record
    sha256: 1d6d671b46a06fc36fd18bd08265fe3c722d215c895ac7093c806da23c049431
    url: https://portal.csdi.gov.hk/geoportal/csw?service=CSW&version=2.0.2&request=GetRecordById&elementSetName=full&id=ugc_rcd_1697186993343_80839&outputSchema=http%3A%2F%2Fwww.opengis.net%2Fcat%2Fcsw%2F2.0.2
  - contentType: text/plain;charset=UTF-8
    httpStatus: 200
    kind: arcgis-service
    parseStatus: pass
    role: arcgis-service
    sha256: f4ab9b02aa0edd654f5e3e9e3218a106cc6af1086fd5ceb78c25c5e52cd75cef
    url: https://portal.csdi.gov.hk/server/rest/services/common/ugc_rcd_1697186993343_80839/FeatureServer?f=pjson
  - contentType: text/plain;charset=UTF-8
    httpStatus: 200
    kind: arcgis-layer
    parseStatus: pass
    role: arcgis-layer
    sha256: 9345bedc972e9f2f1d34e79a3d69447759a562d478972e6cdaaef68887c3a722
    url: https://portal.csdi.gov.hk/server/rest/services/common/ugc_rcd_1697186993343_80839/FeatureServer/0?f=pjson
  - contentType: text/xml;charset=UTF-8
    httpStatus: 200
    kind: wfs-capabilities
    parseStatus: pass
    role: wfs-capabilities
    sha256: bb185f90a5323f53b38da34d803fc3086612154e3e704936fc74e67343798508
    url: https://portal.csdi.gov.hk/server/services/common/ugc_rcd_1697186993343_80839/MapServer/WFSServer?service=wfs&request=GetCapabilities
x-csdi-source-scope:
  actualDataQueriesByConversion: 0
  fullSourceCompleteness: not_established
  nativeMetadataStatus:
    http200Sources: 4
    status: http_200_retained
  partialProtocols:
    - code: metadata_http_not_200
      httpStatus: 403
      url: https://portal.csdi.gov.hk/server/services/common/ugc_rcd_1697186993343_80839/MapServer/WFSServer?service=wfs&version=2.0.0&request=DescribeFeatureType&typeNames=csdi%3Ageotagging
    - code: discovery_metadata_error
      reason: "ValueError: curl exit 22: curl: (22) The requested URL returned error: 403"
      serviceId: csdi-service-c4fc656088a6889a7af2ed24
      url: https://portal.csdi.gov.hk/server/services/common/ugc_rcd_1697186993343_80839/MapServer/WFSServer?service=wfs&version=2.0.0&request=DescribeFeatureType&typeNames=csdi%3Ageotagging
    - code: discovery_metadata_error
      reason: "Not requested: prior explicit security/authentication response to this origin"
      serviceId: csdi-service-6b1f6c9da3db18a73abcc599
      url: https://portal.csdi.gov.hk/server/services/common/ugc_rcd_1697186993343_80839/MapServer/WMSServer?service=wms&request=GetCapabilities
    - code: unsupported_or_incomplete_native_contract
      protocol: wms
      reason: No retained parseable WMS GetCapabilities
      serviceId: csdi-service-6b1f6c9da3db18a73abcc599
x-supporting-documentation:
  - role: publisher_docx_semantic_dictionary
    schemas:
      - PublisherDictionaryStudentEnrolmentHeadcountDataDictionary
    url: https://www.ugcs.gov.hk/datagovhk/Students3_data_dictionary_en.docx
    wireMapping: not_asserted
