openapi: 3.1.2
info:
  title: MDR
  description: MDR API
  version: 0.0.1
paths:
  /api/v1/datasets:
    get:
      summary: Dataset list
      description: Get a Dataset list
      tags:
        - dataset
      responses:
        '200':
          description: OK
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  meta:
                    type: object
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/dataset'
        '403':
          description: Forbidden
    parameters: []
  '/api/v1/datasets/{dataset_id}':
    get:
      summary: Dataset details
      description: Get Dataset details
      tags:
        - dataset
        - authenticated
      parameters:
        - name: dataset_id
          description: DatasetID
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    $ref: '#/components/schemas/dataset'
              examples: {}
        '404':
          description: Not Found
    parameters:
      - schema:
          type: string
        name: dataset_id
        in: path
        required: true
components:
  schemas:
    dataset:
      title: dataset
      type: object
      x-examples: {}
      description: Dataset
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        type:
          type: string
          default: dataset
          readOnly: true
        attributes:
          type: object
          properties:
            titles:
              type: array
              items:
                $ref: '#/components/schemas/title'
              description: Dataset title
            creators:
              type: array
              description: Creator
              items:
                $ref: '#/components/schemas/creator'
            description:
              type: string
              description: Dataset description
            lang:
              type: string
              default: und
              description: Dataset language
            license:
              $ref: '#/components/schemas/license'
            manuscript_type:
              type: string
              description: Manuscript type
              enum:
                - authors_original
                - under_review
                - accepted_manuscript
                - proof
                - vor
                - na
              default: na
            publisher:
              $ref: '#/components/schemas/publisher'
            state:
              type: string
              default: draft
              enum:
                - draft
                - in_review
                - rejected
                - withdrawn
                - published
              description: Dataset state
            subjects:
              type: array
              description: Subject
              items:
                $ref: '#/components/schemas/subject'
            resource_type:
              type: string
              default: dataset
              enum:
                - dataset
                - journal_article
                - conference_paper
                - book
                - book_part
                - report
                - conference_poster
                - conference_presentation
                - software
                - sound
                - image
                - video
              description: Resource type
            visibility:
              type: string
              description: Dataset visibility
              default: closed
              enum:
                - closed
                - restricted
                - open_to_public
            computational_methods:
              type: array
              description: Computational method
              items:
                $ref: '#/components/schemas/computational_method'
            chemical_compositions:
              type: array
              description: Chemical composition
              items:
                $ref: '#/components/schemas/chemical_composition'
            crystallographic_structures:
              type: array
              description: Crystallographic structure
              items:
                $ref: '#/components/schemas/crystallographic_structure'
            custom_properties:
              type: array
              description: Custom property
              items:
                $ref: '#/components/schemas/custom_property'
            energy_levels:
              type: array
              description: Energy level
              items:
                $ref: '#/components/schemas/energy_level'
            experimental_methods:
              type: array
              description: Experimental method
              items:
                $ref: '#/components/schemas/experimental_method'
            features:
              type: array
              description: Feature
              items:
                $ref: '#/components/schemas/feature'
            instruments:
              type: array
              description: Instrument
              items:
                $ref: '#/components/schemas/instrument'
            processing:
              type: array
              description: Processing
              items:
                $ref: '#/components/schemas/processing'
            software:
              type: array
              description: Software
              items:
                $ref: '#/components/schemas/software'
            specimens:
              type: array
              description: Specimen
              items:
                $ref: '#/components/schemas/specimen'
            structural_features:
              type: array
              description: Structural feature
              items:
                $ref: '#/components/schemas/structural_feature'
      required:
        - type
        - attributes
    fileset:
      title: fileset
      type: object
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
          readOnly: true
      required:
        - type
      description: Fileset
    collection:
      title: collection
      type: object
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
          readOnly: true
        attributes:
          type: object
          properties:
            title:
              type: string
      required:
        - type
    chemical_composition:
      title: chemical_composition
      type: object
      description: Chemical composition
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        identifier:
          type: string
          description: Local ID
        description:
          type: string
    specimen:
      title: specimen
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        identifier:
          type: string
        description:
          type: string
        name:
          type: string
          description: Specimen name
        material_type_vocabulary:
          type: string
          format: uri
          description: Vocabulary ID for material type
      description: Specimen
    creator:
      title: creator
      type: object
      description: Creator
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          description: Creator name
        orcid:
          type: [string, "null"]
          format: uri
          description: ORCID
        e_rad:
          type: [string, "null"]
          description: e-Rad researcher number
        organization:
          type: [string, "null"]
          description: Organization name
        department:
          type: [string, "null"]
          description: Department name
        ror:
          type: [string, "null"]
          format: uri
          description: ROR
        position:
          type: number
          description: Order
          default: 0
      required:
        - name
    structural_feature:
      title: structural_feature
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        vocabulary:
          type: string
          format: uri
        description:
          type: string
        specimen_identifier:
          type: string
          description: Specimen ID
      description: Structural feature
    energy_level:
      title: energy_level
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        vocabulary:
          type: string
          format: uri
          description: Vocabulary ID
        description:
          type: string
      description: Energy level
    feature:
      title: feature
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        vocabulary:
          type: string
          format: uri
        description:
          type: string
        value:
          type: string
        unit_vocabulary:
          type: string
          format: uri
      description: Feature
    processing:
      title: processing
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        description:
          type: string
        vocabulary:
          type: string
          format: uri
          description: Vocabulary ID
        column_number:
          type: number
        processed_at:
          type: string
          format: time
      description: Processing
    computational_method:
      title: computational_method
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        description:
          type: string
        vocabulary:
          type: string
          format: uri
        calculated_at:
          type: string
          format: time
      description: Computational method
    crystallographic_structure:
      title: crystallographic_structure
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        description:
          type: string
        vocabulary:
          type: string
          format: uri
        specimen_identifier:
          type: string
      description: Crystallographic structure
    custom_property:
      title: custom_property
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          description: Name
        value:
          type: string
          description: Value
        identifier:
          type: string
          description: Local ID
      required:
        - name
        - value
      description: Custom property
    instrument:
      title: instrument
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          description: Instrument name
        description:
          type: string
        identifier:
          type: string
          description: Local ID
        vocabulary:
          type: string
          format: uri
          description: Vocabulary ID
      required:
        - name
      description: Instrument
    experimental_method:
      title: experimental_method
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        description:
          type: string
        vocabulary:
          type: string
          format: uri
          description: Vocabulary ID
      description: Experimental method
    software:
      title: software
      type: object
      description: Software
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          description: Software name
        version:
          type: string
          description: Version
        description:
          type: string
        identifier:
          type: string
          description: Local ID
      required:
        - name
    title:
      title: title
      type: object
      description: Title
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        title:
          type: string
          description: Title
        title_type:
          type: string
          description: Title type
          enum:
            - original
            - alternative
      required:
        - title
    subject:
      title: subject
      type: object
      description: Subject
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        term:
          type: string
          description: Subject
        identifier:
          type: string
          description: Local ID
        position:
          type: string
          description: Display order
      required:
        - term
    license:
      title: license
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          description: License name
        description:
          type: string
        identifier:
          type: string
          description: License URL
          format: uri
      required:
        - name
      description: License
    publisher:
      title: publisher
      type: [object, "null"]
      description: Publisher
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        organization:
          type: string
          description: Publisher name
        ror:
          type: string
          description: Publisher ROR
          format: uri
      required:
        - organization
  securitySchemes: {}
servers:
  - url: https://mdr.nims.go.jp
