University of Basel Ontology Mappings API

The Ontology Mappings API from University of Basel — 2 operation(s) for ontology mappings.

OpenAPI Specification

university-of-basel-ontology-mappings-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: DSP Admin API Ontology Mappings API
  version: v35.10.0
  summary: DSP-API is part of the DaSCH Service Platform, a repository for the long-term preservation and reuse of data in the humanities.
  contact:
    name: DaSCH
    url: https://www.dasch.swiss/
servers:
- url: https://api.dasch.swiss:443
  description: The dsp-api server
tags:
- name: Ontology Mappings
paths:
  /v3/ontologies/{ontologyIri}/classes/{classIri}/mapping:
    put:
      tags:
      - Ontology Mappings
      description: Adds rdfs:subClassOf triples from the given class to the listed external IRIs. Existing external super-class mappings are not removed - use DELETE first to replace them.
      operationId: putV3OntologiesOntologyiriClassesClassiriMapping
      parameters:
      - name: ontologyIri
        in: path
        required: true
        schema:
          type: string
      - name: classIri
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddClassMappingsRequest'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClassMappingResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
              example:
                message: Bad request example message
                errors: []
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
              example:
                message: Invalid token.
                errors: []
        '403':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Forbidden'
              example:
                message: User not active.
                errors: []
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
              examples:
                ontology_not_found:
                  description: 'Example template string for code `ontology_not_found`:

                    ```

                    The ontology ''{id}'' was not found.

                    ```'
                  value:
                    message: The ontology '{id}' was not found.
                    errors:
                    - code: ontology_not_found
                      message: The ontology '{id}' was not found.
                      details:
                        id: example_id
                class_not_found:
                  description: 'Example template string for code `class_not_found`:

                    ```

                    The class ''{id}'' was not found in ontology ''{ontologyIri}''.

                    ```'
                  value:
                    message: The class '{id}' was not found in ontology '{ontologyIri}'.
                    errors:
                    - code: class_not_found
                      message: The class '{id}' was not found in ontology '{ontologyIri}'.
                      details:
                        id: example_id
                        ontologyIri: example_ontologyIri
      security:
      - httpAuth: []
    delete:
      tags:
      - Ontology Mappings
      description: 'Removes a single rdfs:subClassOf triple from the given class to the specified external IRI. Idempotent: deleting an absent triple is a no-op.'
      operationId: deleteV3OntologiesOntologyiriClassesClassiriMapping
      parameters:
      - name: ontologyIri
        in: path
        required: true
        schema:
          type: string
      - name: classIri
        in: path
        required: true
        schema:
          type: string
      - name: mapping
        in: query
        description: The external IRI to remove from rdfs:subClassOf. Must be URL-encoded.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClassMappingResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
              example:
                message: Bad request example message
                errors: []
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
              example:
                message: Invalid token.
                errors: []
        '403':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Forbidden'
              example:
                message: User not active.
                errors: []
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
              examples:
                ontology_not_found:
                  description: 'Example template string for code `ontology_not_found`:

                    ```

                    The ontology ''{id}'' was not found.

                    ```'
                  value:
                    message: The ontology '{id}' was not found.
                    errors:
                    - code: ontology_not_found
                      message: The ontology '{id}' was not found.
                      details:
                        id: example_id
                class_not_found:
                  description: 'Example template string for code `class_not_found`:

                    ```

                    The class ''{id}'' was not found in ontology ''{ontologyIri}''.

                    ```'
                  value:
                    message: The class '{id}' was not found in ontology '{ontologyIri}'.
                    errors:
                    - code: class_not_found
                      message: The class '{id}' was not found in ontology '{ontologyIri}'.
                      details:
                        id: example_id
                        ontologyIri: example_ontologyIri
      security:
      - httpAuth: []
  /v3/ontologies/{ontologyIri}/properties/{propertyIri}/mapping:
    put:
      tags:
      - Ontology Mappings
      description: Adds rdfs:subPropertyOf triples from the given property to the listed external IRIs. Existing external super-property mappings are not removed - use DELETE first to replace them.
      operationId: putV3OntologiesOntologyiriPropertiesPropertyiriMapping
      parameters:
      - name: ontologyIri
        in: path
        required: true
        schema:
          type: string
      - name: propertyIri
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddPropertyMappingsRequest'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PropertyMappingResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
              example:
                message: Bad request example message
                errors: []
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
              example:
                message: Invalid token.
                errors: []
        '403':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Forbidden'
              example:
                message: User not active.
                errors: []
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
              examples:
                ontology_not_found:
                  description: 'Example template string for code `ontology_not_found`:

                    ```

                    The ontology ''{id}'' was not found.

                    ```'
                  value:
                    message: The ontology '{id}' was not found.
                    errors:
                    - code: ontology_not_found
                      message: The ontology '{id}' was not found.
                      details:
                        id: example_id
                property_not_found:
                  description: 'Example template string for code `property_not_found`:

                    ```

                    The property ''{id}'' was not found in ontology ''{ontologyIri}''.

                    ```'
                  value:
                    message: The property '{id}' was not found in ontology '{ontologyIri}'.
                    errors:
                    - code: property_not_found
                      message: The property '{id}' was not found in ontology '{ontologyIri}'.
                      details:
                        id: example_id
                        ontologyIri: example_ontologyIri
      security:
      - httpAuth: []
    delete:
      tags:
      - Ontology Mappings
      description: 'Removes a single rdfs:subPropertyOf triple from the given property to the specified external IRI. Idempotent: deleting an absent triple is a no-op.'
      operationId: deleteV3OntologiesOntologyiriPropertiesPropertyiriMapping
      parameters:
      - name: ontologyIri
        in: path
        required: true
        schema:
          type: string
      - name: propertyIri
        in: path
        required: true
        schema:
          type: string
      - name: mapping
        in: query
        description: The external IRI to remove from rdfs:subPropertyOf. Must be URL-encoded.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PropertyMappingResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
              example:
                message: Bad request example message
                errors: []
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
              example:
                message: Invalid token.
                errors: []
        '403':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Forbidden'
              example:
                message: User not active.
                errors: []
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
              examples:
                ontology_not_found:
                  description: 'Example template string for code `ontology_not_found`:

                    ```

                    The ontology ''{id}'' was not found.

                    ```'
                  value:
                    message: The ontology '{id}' was not found.
                    errors:
                    - code: ontology_not_found
                      message: The ontology '{id}' was not found.
                      details:
                        id: example_id
                property_not_found:
                  description: 'Example template string for code `property_not_found`:

                    ```

                    The property ''{id}'' was not found in ontology ''{ontologyIri}''.

                    ```'
                  value:
                    message: The property '{id}' was not found in ontology '{ontologyIri}'.
                    errors:
                    - code: property_not_found
                      message: The property '{id}' was not found in ontology '{ontologyIri}'.
                      details:
                        id: example_id
                        ontologyIri: example_ontologyIri
      security:
      - httpAuth: []
components:
  schemas:
    Map_String:
      title: Map_String
      type: object
      additionalProperties:
        type: string
    ClassMappingResponse:
      title: ClassMappingResponse
      type: object
      required:
      - classIri
      - ontologyIri
      - lastModificationDate
      properties:
        classIri:
          type: string
        ontologyIri:
          type: string
        subClassOf:
          type: array
          items:
            type: string
        label:
          type: array
          items:
            $ref: '#/components/schemas/LanguageStringDto'
        comment:
          type: array
          items:
            $ref: '#/components/schemas/LanguageStringDto'
        lastModificationDate:
          type: string
          format: date-time
    NotFound:
      title: NotFound
      type: object
      required:
      - message
      properties:
        message:
          type: string
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetail'
    Forbidden:
      title: Forbidden
      type: object
      required:
      - message
      properties:
        message:
          type: string
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetail'
    Unauthorized:
      title: Unauthorized
      type: object
      required:
      - message
      properties:
        message:
          type: string
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetail'
    BadRequest:
      title: BadRequest
      type: object
      required:
      - message
      properties:
        message:
          type: string
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetail'
    PropertyMappingResponse:
      title: PropertyMappingResponse
      type: object
      required:
      - propertyIri
      - ontologyIri
      - lastModificationDate
      properties:
        propertyIri:
          type: string
        ontologyIri:
          type: string
        subPropertyOf:
          type: array
          items:
            type: string
        label:
          type: array
          items:
            $ref: '#/components/schemas/LanguageStringDto'
        comment:
          type: array
          items:
            $ref: '#/components/schemas/LanguageStringDto'
        lastModificationDate:
          type: string
          format: date-time
    LanguageStringDto:
      title: LanguageStringDto
      type: object
      required:
      - value
      - language
      properties:
        value:
          type: string
        language:
          type: string
    AddClassMappingsRequest:
      title: AddClassMappingsRequest
      type: object
      properties:
        mappings:
          type: array
          items:
            type: string
    AddPropertyMappingsRequest:
      title: AddPropertyMappingsRequest
      type: object
      properties:
        mappings:
          type: array
          items:
            type: string
    ErrorDetail:
      title: ErrorDetail
      type: object
      required:
      - code
      - message
      - details
      properties:
        code:
          $ref: '#/components/schemas/V3ErrorCode'
        message:
          type: string
        details:
          $ref: '#/components/schemas/Map_String'
    V3ErrorCode:
      title: V3ErrorCode
      type: string
      enum:
      - class_not_found
      - export_exists
      - export_failed
      - export_in_progress
      - export_not_found
      - feature_missing
      - import_exists
      - import_in_progress
      - import_not_found
      - invalid_ontology_mapping_iri
      - ontology_not_found
      - project_not_found
      - property_not_found
      - resourceClass_not_found
      - resource_not_found
  securitySchemes:
    httpAuth:
      type: http
      scheme: bearer
    httpAuth1:
      type: http
      scheme: basic