swagger: '2.0'
info:
  version: 4.6.0-Pvt-1.0
  title: SDI - Semantic Data Interconnect APIs
  x-visibility: external
  description: |
    The Semantic Data Interconnect (SDI) is a collection of APIs that allows the user to unlock the potential of disparate big data by connecting external data. The SDI can infer the schemas of data based on schema-on-read, allow creating a semantic model and perform big data semantic queries. It seamlessly connects to MindSphere's Integrated Data Lake (IDL), but it can work independently as well. There are two mechanisms that can be used to upload files so that SDI can generate schemas and make data ready for query. The SDI operations are divided into the following groups:

      **Data Registration for SDI** This set of APIs is used to organize the incoming data. When configuring a Data Registry, you have the option to update your data based on a replace or append strategy. If you consider a use case where schema may change and incoming data files are completely different every time then replace is a good strategy. The replace strategy will replace the existing schema and data during each data ingest operation whereas the append strategy will update the existing schema and data during each data ingest operation.

      **Custom Data Type for SDI** The SDI by default identifies basic data types for each property, such as String, Integer, Float, Date, etc. The user can use this set of APIs to create their own custom data type. The SDI also provides an API under this category to suggest data type based on user-provided sample test values.

      **Data Lake for SDI** The SDI can process files uploaded provides endpoints to manage customer's data lake registration based on tenant id, cloud provider and data lake type. The set of REST endpoint allows to create, update and retrieve base path for their data lake. The IDL customer needs to create an SDI folder that is under the root folder. Any file uploaded in this folder is automatically picked up by SDI to process via IDL notification.

      **Data Ingest for SDI** This set of APIs allows user to upload files, start an ingest job for uploaded files, find job status for ingested jobs or retrieve all job statuses.

      **Schema Registry for SDI** The SDI provides a way to find the generated schema in this category. Users can find an SDI generated schema for uploaded files based on source name, data tag or schema name.

     **Data Query for SDI** allows querying based on the extracted schemas. Important supported APIs are:
      * Query interface for querying semantically correlated and transformed data.
      * Stores and executes data queries.
      * Uses a semantic model to translate model-based query to physical queries.

     **Semantic Model for SDI** allows user to create semantic model ontologies based on the extracted one or more schemas. The important functionalities achieved with APIs are:
      * Contextual correlation of data from different systems.
      * Infers & Recommends mappings between different schemas.
      * Import and store Semantic model.

basePath: /api/sdi/v4
tags:
  - name: Data Lake
    description: Operations to manage and retrieve customer data lake information.
  - name: Dataregistry
    description: Operations to manage and keep track of created Data Registry.
  - name: IotDataregistry
    description: Operations to manage and keep track of DataRegistry dedicated for IoT Data.
  - name: Custom Datatypes
    description: Operations to manage and keep track of custom data types.
  - name: Data Ingest
    description: Operations to upload the file and ingest the data into SDI system. This service is entry point for SDI's schema generation operations for the current tenant and file.
  - name: Schema Registry
    description: Operations to review generated schemas and infer semantic model based on extracted schemas.
  - name: Data Query Operations
    description: Manage and execute data queries
  - name: Ontologies
    description: Manage ontologies
  - name: Ontologies Operations
    description: Manage ontologies Jobs to create/update Ontologies.
schemes:
  - https
securityDefinitions:
  dataingest:
    type: oauth2
    flow: accessCode
    authorizationUrl: 'https://oauth.simple.api/authorization'
    tokenUrl: 'https://oauth.simple.api/token'
    scopes:
      sdi.dip.w: upload or ingest data
      sdi.dip.r: read ingest status
  registry:
    type: oauth2
    flow: accessCode
    authorizationUrl: 'https://oauth.simple.api/authorization'
    tokenUrl: 'https://oauth.simple.api/token'
    scopes:
      sdi.reg.w: create/update datalake or Data Registry or Data Type or suggest patterns
      sdi.reg.r: read datalake or Data Registry or data type or schema
      sdi.reg.d: delete Data Registry or data type
  query:
    type: oauth2
    flow: accessCode
    authorizationUrl: 'https://oauth.simple.api/authorization'
    tokenUrl: 'https://oauth.simple.api/token'
    scopes:
      sdi.dqp.x: read query results
      sdi.dqp.w: create or update queries
      sdi.dqp.r: read queries
      sdi.dqp.d: delete queries
      sdi.dqp.e: create and get query execution jobs
      sdi.dqp.ed: delete query execution jobs
  ontology:
    type: oauth2
    flow: accessCode
    authorizationUrl: 'https://oauth.simple.api/authorization'
    tokenUrl: 'https://oauth.simple.api/token'
    scopes:
      sdi.smd.w: infer or create or update ontology
      sdi.smd.r: read ontology or ontology status
      sdi.smd.d: delete ontology
paths:
  /dataLakes/{id}:
    get:
      tags:
        - Data Lake
      summary: Retrieves DataLake for a given DataLake Id
      description: Retrieves DataLake for a given DataLake Id
      operationId: getDataLakeUsingGET
      produces:
        - application/json
      security:
        - registry:
            - sdi.reg.r
      parameters:
        - name: id
          in: path
          description: id of the data lake
          required: true
          type: string
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/DataLakeResponse'
        '404':
          description: Not Found
        default:
          description: >-
            <div><div><table><colgroup><col span=\"1\" /><col span=\"1\"
            /></colgroup><tbody><td>Other error with any status code and response body format.</td></tr></tbody></table></div></div><div
            class=\"response-content-type\"><div class=\"content-type-wrapper
            \"></div></div><p>&nbsp;</p>
    patch:
      tags:
        - Data Lake
      summary: Updates base path for a given data lake type
      description: Updates base path for a given data lake type
      operationId: updateDataLakeUsingPUT
      produces:
        - application/json
      security:
        - registry:
            - sdi.reg.w
      parameters:
        - name: id
          in: path
          description: id of the data lake
          required: true
          type: string
        - in: body
          name: updateDataLakeRequest
          description: updateDataLakeRequest
          required: true
          schema:
            $ref: '#/definitions/UpdateDataLakeRequest'
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/DataLakeResponse'
        '404':
          description: Not Found
        '400':
          description: |
            Bad Request. Possible errors:

            Code Suffix   | Message (parameterized)
            ------------- |-------------
            mdsp.core.sdi.dataLake.InvalidBasePath&nbsp;| DataLake basePath must contain non-empty string value.
          schema:
            $ref: '#/definitions/ErrorMessage'
        default:
          description: >-
            <div><div><table><colgroup><col span=\"1\" /><col span=\"1\"
            /></colgroup><tbody><td>Other error with any status code and response body format.</td></tr></tbody></table></div></div><div
            class=\"response-content-type\"><div class=\"content-type-wrapper
            \"></div></div><p>&nbsp;</p>
  /dataLakes:
    get:
      tags:
        - Data Lake
      summary: Retrieves all DataLakes
      description: Retrieves base path for a given data lake type, this will return an empty array when no datalake is found.
      operationId: getDataLakesUsingGET
      security:
        - registry:
            - sdi.reg.r
      produces:
        - application/json
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/DataLakeList'
    post:
      tags:
        - Data Lake
      summary: Creates a data lake record with a given data lake type and base path
      description: Creates a data lake record with given data lake type, name and base path. To use IDL as preferred data lake, use type as MindSphere and name as IDL. The possible values for type is MindSphere or Custom.
      operationId: createDataLakeUsingPOST
      produces:
        - application/json
      security:
        - registry:
            - sdi.reg.w
      parameters:
        - in: body
          name: createDataLakeRequest
          description: createDataLakeRequest
          required: true
          schema:
            $ref: '#/definitions/CreateDataLakeRequest'
      responses:
        '201':
          description: OK
          schema:
            $ref: '#/definitions/CreateDataLakeResponse'
        '400':
          description: |
            Bad Request. Possible errors:

            Code Suffix   | Message (parameterized)
            ------------- |-------------
            mdsp.core.sdi.dataLake.InvalidBasePath&nbsp;| DataLake basePath must contain non-empty string value.
            mdsp.core.sdi.dataLake.InvalidName&nbsp;| DataLake basePath must contain non-empty string value.
            mdsp.core.sdi.dataLake.InvalidType&nbsp;| DataLake basePath must contain non-empty string value.
            mdsp.core.sdi.dataLake.InvalidRequest&nbsp;| DataLake type must be MindSphere or Custom. Valid value for MindSphere dataLake is SDI or IDL
            mdsp.core.sdi.dataLake.InvalidSubscription&nbsp;| You have not yet purchased the IDL datalake.
          schema:
            $ref: '#/definitions/ErrorMessage'
        '409':
          description: The data lake with given name already exist.
  /iotDataRegistries:
    get:
      tags:
        - IotDataregistry
      summary: Retrieves an IoT Data Registry entries
      description: Retrieves an IoT Data Registry with MindSphere AssetId and AspectName
      produces:
        - application/json
      security:
        - registry:
            - sdi.reg.r
      parameters:
        - name: filter
          in: query
          description: filter
          required: false
          type: string
        - $ref: '#/parameters/PageToken'
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/ListOfIoTRegistryResponse'
        '204':
          description: No Content
    post:
      tags:
        - IotDataregistry
      summary: Add a new IoT Data Registry entry
      description: Create new IoT Data Registry with MindSphereAssetId and AspectName
      produces:
        - application/json
      security:
        - registry:
            - sdi.reg.w
      parameters:
        - name: IotDataRegistry
          in: body
          description: IotDataRegistry object
          required: true
          schema:
            $ref: '#/definitions/IotDataRegistry'
      responses:
        '201':
          description: CREATED
          schema:
            $ref: '#/definitions/IotDataRegistryResponse'
        '400':
          description: |
            Bad Request. Possible errors:

            Code Suffix   | Message (parameterized)
            ------------- |-------------
            mdsp.core.sdi.iotDataRegistry.InvalidAssetId&nbsp;| The '{assetId}' is invalid. It must not be empty
            mdsp.core.sdi.iotDataRegistry.InvalidAspectName&nbsp;| The '{aspectName}' is invalid. It must not be empty
            mdsp.core.sdi.iotDataRegistry.registryserviceDuplicatedIotDataRegistry&nbsp;| The data registry exist for given {assetId} and {aspectName}.
            mdsp.core.sdi.iotDataRegistry.registryserviceInvalidAspect&nbsp;| The {aspectName} is not an aspect of assetId {assetId}.
            mdsp.core.sdi.iotDataRegistry.registryserviceInvalidAsset&nbsp;| Unable to verify {assetId} and {aspectName}.

        '401':
          description: |
            AssetId is not found in MindSphere AssetManagement:
        '403':
          description: |
            Access to MindSphere AssetManagement was denied for token expired:
        '404':
          description: |
            Access to MindSphere AssetManagement was denied for token expired:

  /dataRegistries/{id}:
    get:
      tags:
        - Dataregistry
      summary: Retrieves Data Registry for a given registry id
      description: Retrieves registry for a registry id
      operationId: getAllRecordsUsingGET
      produces:
        - application/json
      security:
        - registry:
            - sdi.reg.r
      parameters:
        - name: id
          in: path
          description: Unique identifier of the Data Registry.
          required: true
          type: string
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/DataRegistry'
        '400':
          description: |
            Bad Request. Possible errors:

            Code Suffix   | Message (parameterized)
            ------------- |-------------
            mdsp.core.sdi.registryserviceinvalidregistryid&nbsp;| No Matching Registry found for the given Registry Id
    patch:
      tags:
        - Dataregistry
      summary: Updates a Data Registry
      description: Update Data Registry entries for a given Data Registry Id. The registry attributes sourceName, dataTag and partitionKeys cannot be updated.
      operationId: updateDataRegistryUsingPUT
      consumes:
        - application/json
      produces:
        - application/json
      security:
        - registry:
            - sdi.reg.w
      parameters:
        - name: id
          in: path
          description: Unique identifier of the Data Registry.
          required: true
          type: string
        - in: body
          name: updateDataRegistryRequest
          description: updateDataRegistryRequest
          required: true
          schema:
            $ref: '#/definitions/UpdateDataRegistryRequest'
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/DataRegistry'
        '400':
          description: |
            Bad Request. Possible errors:

            Code Suffix   | Message (parameterized)
            ------------- |-------------
            mdsp.core.sdi.registryserviceinvalidfilepattern&nbsp;| The '{filePattern}' is invalid. The file pattern must not be able to accept empty file name.
            mdsp.core.sdi.registryserviceinvalidstrategy&nbsp;| The '{fileUploadStrategy}'   must not be empty and only 'replace' or 'append' is accepted for file upload strategy.
            mdsp.core.sdi.registryserviceinvalidxmlprocessrulescount&nbsp;| The '{metaDataTags}' Number of metadata tags must not exceed 10 and must not contain special character
            mdsp.core.sdi.registryserviceinvalidfreezeschema&nbsp;| There is no existing schema for the registry. The '{schemaFrozen}' can be set to true only after creation of the initial schema for the registry.
            mdsp.core.sdi.registryserviceuploadstrategyforfreezeschema&nbsp;| The '{schemaFrozen}' can be set to true only if the file upload strategy is 'append'.
          schema:
            $ref: '#/definitions/MdspErrors'
      deprecated: false
  /dataRegistries:
    get:
      tags:
        - Dataregistry
      summary: Retrieves Data Registry entries
      description: Retrieves all Data Registry entries, Data Registry based on sourceName, dataTag or combination of sourceName and dataTag.
      operationId: getAllRecordsUsingGET_1
      produces:
        - '*/*'
      security:
        - registry:
            - sdi.reg.r
      parameters:
        - name: dataTag
          in: query
          description: dataTag
          required: false
          type: string
        - name: sourceName
          in: query
          description: sourceName
          required: false
          type: string
        - $ref: '#/parameters/PageToken'
      responses:
        '200':
          description: Records retrieved successfully
          schema:
            $ref: '#/definitions/ListOfRegistryResponse'
        '204':
          description: No Content
      deprecated: false
    post:
      tags:
        - Dataregistry
      summary: Add a new Data Registry entry
      operationId:
        createDataRegistryForThisTenantUsingPOST
      description: >-
        Initiate creation of Data Registry for the current tenant. The Data Registry information is used during data ingest for the tenant. Only one Data Registry can be created for a request. The dataTag, sourceName and fileUploadStrategy is required to create Date Registry otherwise creation is rejected. DataUpload will allow only files to be uploaded matching this Data Registry. This returns unique **registryId** for each request that can be used to retrieve the created registry. The tenant cannot have more than **500** data registries in the system. The schemaFrozen flag must be set to false during creation of a registry. It can be set to true after creation of the initial schema for the registry.

        Data partitioning on the registry can be optionally enabled by specifying a single partitionKey at the time of registry creation. The property value can be set to "sdi-default-partition-key" to enable default partitioning based on the sdi_hour attribute. The property can also be set to a custom attribute present in the data to enable custom partitioning based on that attribute.
      consumes:
        - application/json
      produces:
        - application/json
      security:
        - registry:
            - sdi.reg.w
      parameters:
        - in: body
          name: createDataRegistryRequest
          description: createDataRegistryRequest
          required: true
          schema:
            $ref: '#/definitions/CreateDataRegistryRequest'
      responses:
        '201':
          description: Created
          schema:
            $ref: '#/definitions/DataRegistry'
        '400':
          description: |
            Bad Request. Possible errors:

            Code Suffix   | Message (parameterized)
            ------------- |-------------
            mdsp.core.sdi.registryserviceinvalidfilepattern&nbsp;| The '{filePattern}': Invalid file pattern| must not be able to accept empty file name.
            mdsp.core.sdi.registryserviceinvaliddatatag&nbsp;| The '{dataTag}' must not be empty and must not contain special character.
            mdsp.core.sdi.registryserviceinvalidstrategy&nbsp;| The '{fileUploadStrategy}'   must not be empty and only 'replace' or 'append' is accepted for file upload strategy.
            mdsp.core.sdi.registryserviceinvalidsourcename&nbsp;| The '{sourceName}' must not be empty and source name must not contain special character
            mdsp.core.sdi.registryserviceinvalidxmlprocessrulescount&nbsp;| The '{metaDataTags}' Number of metadata tags must not exceed 10 and must not contain special character
            mdsp.core.sdi.registryservicedataregistrylimitmaxout&nbsp;| Data Registry: Your Tenant has reached max limit
            mdsp.core.sdi.registryserviceinvalidsourcenamedatatagcombination&nbsp;|sourceName/dataTag: Source Name and Data Tag combination already exists for this Tenant
            mdsp.core.sdi.registryservicevalidatefreezeschema&nbsp;| The '{schemaFrozen}'can be set to true only after creation of the initial schema for the registry.
            mdsp.core.sdi.registryserviceInvalidData&nbsp;| Partition key must not contain special characters. The supported characters include alpha-numeric characters, "-" and "_".
            mdsp.core.sdi.registryserviceInvalidData&nbsp;| Partition key must contain custom key OR the default partition key.
            mdsp.core.sdi.registryserviceInvalidData&nbsp;| Partition key limit exceeded.

          schema:
            $ref: '#/definitions/MdspErrors'
      deprecated: false
  /dataTypes/{name}/addPatterns:
    post:
      tags:
        - Custom Datatypes
      summary: Updates Datatype
      description: Update custom datatypes
      operationId: updateCustomDatatypeUsingPUT
      consumes:
        - application/json
      produces:
        - application/json
      security:
        - registry:
            - sdi.reg.w
      parameters:
        - in: body
          name: dataTypePattern
          description: dataTypePattern
          required: true
          schema:
            $ref: '#/definitions/DataTypePattern'
        - name: name
          in: path
          description: name
          required: true
          type: string
      responses:
        '200':
          description: Response contains updated datatype definition
          schema:
            $ref: '#/definitions/DataTypeDefinition'
        '400':
          description: |
            Bad Request. Possible errors:
            Code Suffix   | Message (parameterized)
              ------------- |-------------
            mdsp.core.sdi.registryservicecustomdatatypemissing&nbsp;|The patterns can be added only to existing datatype.
  /dataTypes/{name}:
    get:
      tags:
        - Custom Datatypes
      summary: Retrieves datatype for a given datatype name
      description: Retrieves custom datatype for a given datatype name
      operationId: getCustomDataTypesByNameUsingGET
      produces:
        - application/json
      security:
        - registry:
            - sdi.reg.r
      parameters:
        - name: name
          in: path
          description: name
          required: true
          type: string
      responses:
        '200':
          description: Records retrieved successfully
          schema:
            $ref: '#/definitions/DataTypeDefinition'
        '204':
          description: No record found
    delete:
      tags:
        - Custom Datatypes
      summary: Deletes custom datatype for a given datatype name
      description: Deletes custom datatype for a given datatype name if it is not being used by any schema
      operationId: deleteCustomDataTypesByNameUsingDELETE
      produces:
        - application/json
      security:
        - registry:
            - sdi.reg.d
      parameters:
        - name: name
          in: path
          description: name
          required: true
          type: string
      responses:
        '204':
          description: Record deleted successfully
        '400':
          description: |
            Conflict. Possible errors:

            Code Suffix   | Message (parameterized)
            ------------- |-------------
            mdsp.core.sdi.dataTypeAlreadyInUse&nbsp;| Can not delete the datatype as it is already being used.
          schema:
            $ref: '#/definitions/MdspErrors'
        '404':
          description: Record not found
  /dataTypes:
    get:
      tags:
        - Custom Datatypes
      summary: Retrieves the custom datatypes for the current tenant.
      description: Retrieves custom datatypes for the current tenant containing data type name and one or more registered patterns.
      operationId: getCustomDataTypesUsingGET
      security:
        - registry:
            - sdi.reg.r
      parameters:
        - $ref: '#/parameters/PageToken'
      produces:
        - application/json
      responses:
        '200':
          description: Records retrieved successfully
          schema:
            $ref: '#/definitions/ListOfDataTypeDefinition'
      deprecated: false
    post:
      tags:
        - Custom Datatypes
      summary: Custom datatype registration.
      description: >-
        Initiates a registration for list of custom datatypes for given datatype name and regular expression patterns. There can be one or more pattern for a given custom data type.
        The custom datatype is being used by DataUpload process during schema generation.
        The custom datatype registration is rejected for the current tenant if invalid regular expression pattern is provided. The custom datatype applies to all the files ingested for the current tenant. The tenant can have maximum **200** datatypes per tenant and each datatype cannot exceed **10** regular expression pattern per datatypename. This returns unique **name* that can be used to retrieve the custom data type.
      operationId: registerCustomDatatypesUsingPUT
      consumes:
        - application/json
      produces:
        - application/json
      security:
        - registry:
            - sdi.reg.w
      parameters:
        - in: body
          name: dataTypeDefinition
          description: dataTypeDefinition
          required: true
          schema:
            $ref: '#/definitions/DataTypeDefinition'
      responses:
        '201':
          description: Response contains one or more datatype definitions registered successfully. If anyone datatype is not registered successfully then whole operation fails.
          schema:
            $ref: '#/definitions/DataTypeDefinition'
        '400':
          description: |
            Bad Request. Possible errors:

            Code Suffix   | Message (parameterized)
            ------------- |-------------
            mdsp.core.sdi.registryserviceinvalidcustomdatatypes&nbsp;| The datatypes should have at least one '{patterns}', and all the patterns should be valid.
            mdsp.core.sdi.registryservicecustomdatatypelimitmaxout&nbsp;| You have reached the max limit to create datatypes for the tenant.
            mdsp.core.sdi.registryservicecustomdatatypealreadyexist&nbsp;| The Datatype already exists. You can only add more patterns to existing Datatype
            mdsp.core.sdi.registryservicecustomdatatypepatternlimitmaxout&nbsp;| The number of patterns for a given datatype exceeds the limit
            mdsp.core.sdi.registryserviceemptycustomdatatype&nbsp;|The datatype name must not be empty and there must be atleast one valid pattern for the datatype
          schema:
            $ref: '#/definitions/MdspErrors'
      deprecated: false
  /suggestPatterns:
    post:
      tags:
        - Custom Datatypes
      summary: >-
        Generates the regular expression patterns for a given set of sample
        values
      description: >-
        Generates the regular expression patterns for a given set of sample
        values. In this case **sampleValues** generates a number of regex patterns and tries to match with patterns provided in **testValues**. The response contains any of testValues that matches sampleValues as probable pattern match.
      operationId: getPatternsForSetOfValuesUsingGET
      produces:
        - application/json
      security:
        - registry:
            - sdi.reg.w
      parameters:
        - name: sampleValues
          in: query
          description: sampleValues
          required: true
          type: array
          items:
            type: string
          collectionFormat: multi
        - name: testValues
          in: query
          description: testValues
          required: true
          type: array
          items:
            type: string
          collectionFormat: multi
      responses:
        '200':
          description: Patterns generated successfully
          schema:
            $ref: '#/definitions/ListOfPatterns'
        '400':
          description: |
            Bad Request. Possible errors:

            Code Suffix   | Message (parameterized)
            ------------- |-------------
            mdsp.core.sdi.registryservicepatternexception&nbsp;| The system is unable to generate the pattern.
            mdsp.core.sdi.registryserviceinvalidtestvalues&nbsp;| The Set of test values '{testValues}' cannot be empty.
            mdsp.core.sdi.registryserviceinvalidsamplevalues&nbsp;| The Set of sample values '{sampleValues}' cannot be empty.
          schema:
            $ref: '#/definitions/MdspErrors'
      deprecated: false
  /dataUpload:
    post:
      tags:
        - Data Ingest
      summary: Upload the given file for the current tenant. The input file must be less than 100MB in size.
      description: >-
        Initiate the file upload process for provided file under the current tenant.
      operationId: uploadFileUsingPOST
      consumes:
        - multipart/form-data
      produces:
        - application/json
      security:
        - dataingest:
            - sdi.dip.w
      parameters:
        - name: file
          in: formData
          description: Select the file to Upload for SDI process
          required: true
          type: file
      responses:
        '200':
          description: Response contains the file path that can be used during data ingest operation.
          schema:
            $ref: '#/definitions/SdiFileUploadResponse'
        '400':
          description: |
            Bad Request. Possible errors:

            Code Suffix   | Message (parameterized)
            --------------|---------------
            mdsp.core.sdi.dataingestservicefileuploadexception&nbsp;|  Unable to  upload a file due to system error. Please check the logs or contact  administrator.
            mdsp.core.sdi.dataingestservicefileuploadamazonexception&nbsp;| Unable to upload the  file due to credential, network or configuration issue. Please check the log  or contact administrator.
          schema:
            $ref: '#/definitions/MdspErrors'
      deprecated: false
  /ingestJobs:
    post:
      tags:
        - Data Ingest
      summary: Ingest the provided file and start SDI's schema generation process.
      description: >-
        Initiate the data ingestion and start the SDI's schema generation process for the current tenant. This operation currently supports CSV and XML format files. The XML format file requires root element information that is entry point for this operation. This is provided as either rootTag parameter to this operation or registered as part of Data Registry API operation. There are two modes for data ingest.
          * Default: Allows performing the data ingest without need of any Data Registry. In this case service processes files with default policy for schema generation. The schema generated this way cannot be versioned or changed with different files. This mode is used for quick validating the generated schema.
          * Dataregistry: The operation uses Data Registry for ingested file to generate schema. This is preferred mode as it allows more validation against the Data Registry and create multiple schema based on different domains created under Data Registry. Using this mode customer can create combination of schemas from different domain and query them or use for analytical modelling. This works in combination with Data Registry API.
      operationId: ingestDataToSdiProcessUsingPOST
      consumes:
        - application/json
      produces:
        - application/json
      security:
        - dataingest:
            - sdi.dip.w
      parameters:
        - in: body
          name: ingestData
          description: Specifies the file path and Data Registry information to initiate data ingest process. The '{filePath}' is required parameter and valid file path used during file upload operations. The '{dataTag}' and '{sourceName}' are the valid Data Registry source name and data tag. The '{rootTag}' is optional and applies to XML formatted files.
          required: true
          schema:
            $ref: '#/definitions/SDIIngestData'
      responses:
        '200':
          description: The response contains jobId and statug, jobId can be used to track the progress of SDI schema generation process.
          schema:
            $ref: '#/definitions/SdiJobStatusResponse'
        '400':
          description: |
            Bad request. Possible errors:

            Code Suffix  | Message (parameterized)
            -------------|--------------
            mdsp.core.sdi.datauploadservicedataingestserviceinvalidfileformat&nbsp;| The file format is not supported. SDI currently supports only csv and xml format file
            mdsp.core.sdi.datauploadservicedataingestservicegenericerror&nbsp;| The system is unable to complete the  task. Contact your supervisor or see logs for detail error.
            mdsp.core.sdi.dataingestservicestoragenotavailable&nbsp;|  The bucket does not exists or  not accessible to SDI service, please check the permission or path to  uploaded file
            mdsp.core.sdi.dataingestserviceinvalidfilepattern&nbsp;|  Please verify  the file format or filename. The file name must match with Data Registry  entry for given source name and data tag.
            mdsp.core.sdi.dataingestserviceinvalidsourcename&nbsp;|  Please verify  the sourcename. The sourcename must be a valid Data Registry entry.
            mdsp.core.sdi.dataingestserviceinvalidroottag&nbsp;|  Please verify  the rootTag. The root tag is required parameter for XML format file. Please  verify that either defaultRootTag is provided in Data Registry for given  soure and datatag or provide a valid rootTag for an element present in the  XML file.
            mdsp.core.sdi.dataingestservicefileuploadexception&nbsp;|  Unable to  upload a file due to system error. Please check the logs or contact  administrator.
            mdsp.core.sdi.dataingestservicefileuploadamazonexception&nbsp;| Unable to upload the  file due to credential, network or configuration issue. Please check the log  or contact administrator
            mdsp.core.sdi.dataingestserviceinvalidsourcenameordatatag&nbsp;|  Please provide source name and  datatag both or none for default data ingest.
            mdsp.core.sdi.dataingestservicedataregistryexception&nbsp;|  Please check  that Data Registry  service is working fine. Verify that source and data tag is valid.
            mdsp.core.sdi.dataingestserviceinvaliddataregistryentry&nbsp;|  Unable to proceed as Data Registry is not matching file patterns. Please verify the file is valid for given source and data tag.
            mdsp.core.sdi.dataingestserviceinvalidroottagforxmlfile&nbsp;|  Invalid rootTag provied for input XML file. Please provide the roottag as there is no default tag available for a file uploaded with default option.
            mdsp.core.sdi.dataingestserviceinvalidtenantorsourceordatatag&nbsp;|  Invalid tenant, source name or data tag. Please verify your Data Registry entry
          schema:
            $ref: '#/definitions/MdspErrors'
      deprecated: false

  /ingestJobStatus:
    get:
      tags:
        - Data Ingest
      summary: Retrieve a list of jobIds.
      description: Get a list of jobIds that is ingested, this jobId can be used to find detailed status using ingestJobStatus.
      operationId: ingestDataToSdiProcessUsingGET
      security:
        - dataingest:
            - sdi.dip.r
      parameters:
        - $ref: '#/parameters/PageToken'
      produces:
        - application/json
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/ListOfJobIds'
        '404':
          description: Not Found
  /ingestJobStatus/{id}:
    get:
      tags:
        - Data Ingest
      summary: Retreive the job status.
      description: Retrieve the job status based on jobid for the current tenant. The jobid belongs to data ingestion process started for the current tenant.
      operationId: getJobStatus
      consumes:
        - application/json
      produces:
        - application/json
      security:
        - dataingest:
            - sdi.dip.r
      parameters:
        - name: id
          in: path
          description: job ID
          required: true
          type: string
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/SdiJobStatusResponse'
        '404':
          description: Not Found
      deprecated: false
  /searchSchemas:
    post:
      tags:
        - Schema Registry
      summary: Search schema for ingested data.
      description: >-
        The data ingestion API creates and stores the schemas for each ingested file. This schema can be retrieved based on schema name, or source name and data tag combination.
        SchemaSearchRequest is limited to 20 schemas atmost.
      operationId: querySchemasUsingPOST
      consumes:
        - application/json
      produces:
        - application/json
      security:
        - registry:
            - sdi.reg.r
      parameters:
        - $ref: '#/parameters/PageToken'
        - in: body
          name: schemaSearchRequest
          description: schemaSearchRequest
          required: true
          schema:
            $ref: '#/definitions/SchemaSearchRequest'
      responses:
        '200':
          description: Response contains one or more schema retrieved based on source name, data tag or schema name.
          schema:
            $ref: '#/definitions/ListOfSchemaRegistry'
        '204':
          description: No content
        '400':
          description: |
            Bad Request. Possible errors:

            Code Suffix   | Message (parameterized)
            ------------- |-------------
            mdsp.core.sdi.registryserviceInvalidData&nbsp;|  The schemas size in SchemaSearchRequest  must be between 1 and 20.
            mdsp.core.sdi.metaDataTagsCantBeEmpty&nbsp;|  MetaDataTags can not be empty.
            mdsp.core.sdi.tagLimitExceeded&nbsp;|  Only 15 metaDataTags are allowed per request object.
          schema:
            $ref: '#/definitions/MdspErrors'
      deprecated: false

  /queries:
    get:
      tags:
        - Data Query Operations
      summary: Retrieve all queries
      description: Returns a list of Data Query SQL Model
      operationId: retrieveAllQueries
      security:
        - query:
            - sdi.dqp.r
      parameters:
        - $ref: '#/parameters/PageToken'
        - name: executable
          in: query
          description: Filter based on executable flag
          type: boolean
        - name: isDynamic
          in: query
          description: Filter based on isDynamic flag
          type: boolean
        - name: ontologyId
          in: query
          description: Filter based on ontology id
          type: string
      produces:
        - application/json
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/ResponseAllDataSQLQuery'
        '400':
          description: >-
            <div><div><table><colgroup><col span="1" /><col span="1"
            /></colgroup><tbody><tr><th align="left">Code Suffix</th><th
            align="left">Message
            (parametrized)</th></tr><tr><td>invalidFilterValue</td><td>Please provide valid filter value for field in query parameter</td></tr></tbody></table></div></div><div
            class="response-content-type"><div class="content-type-wrapper
            "></div></div><p>&nbsp;</p>
          schema:
            $ref: '#/definitions/ErrorMessage'
        default:
          description: >-
            <div><div><table><colgroup><col span=\"1\" /><col span=\"1\"
            /></colgroup><tbody><td>Other error with any status code and response body format.</td></tr></tbody></table></div></div><div
            class=\"response-content-type\"><div class=\"content-type-wrapper
            \"></div></div><p>&nbsp;</p>
      deprecated: false
    post:
      tags:
        - Data Query Operations
      summary: Create new queries
      description: Returns id of created query
      operationId: createQuery
      consumes:
        - application/json
      produces:
        - application/json
      security:
        - query:
            - sdi.dqp.w
      parameters:
        - in: body
          name: dataQuerySQLRequest
          description: dataQuerySQLRequest
          required: true
          schema:
            $ref: '#/definitions/DataQuerySQLRequest'
      responses:
        '201':
          description: query created successfully
          schema:
            $ref: '#/definitions/DataQuerySQLResponse'
        '400':
          description: >-
            <div><div><table><colgroup><col span="1" /><col span="1"
            /></colgroup><tbody><tr><th align="left">Code Suffix</th><th
            align="left">Message
            (parametrized)</th></tr><tr><td>missingParameter</td><td>Missing
            required request body property :
            </td></tr><tr><td>invalidEncodedSqlStatement</td><td>Invalid encoded sql statement.
            </td></tr><tr><td>unsafe</td><td>SQL query is unsafe to execute. Kindly update the query.</td></tr><tr><td>invalidValue</td><td>Provided request body
            property  is invalid</td></tr><td>invalidField</td><td>Additional
            fields are not allowed. We currently support
            :</td></tr><tr><td>dataQueryLimitExceeded</td><td>Limit of total
            number of queries is exceeded. Further queries cannot be
            created.</td></tr><tr><td>queryNotDynamic</td><td>Paramterized
            attributes can be set only when query is configured to be
            paramterized</td></tr><tr><td>incorrectColumn</td><td>Provided
            column : {0} in the parameter is not present in the
            schema</td></tr><tr><td>incorrectClassProperty</td><td>Provided
            property : {0} in the parameter is not present in the
            class</td></tr><tr><td>incorrectSchemaOrClass</td><td>Provided schema(s) or class(es) in the parameter(s) do not match schemas or class(es) in the from clause: {0}</td></tr><tr><td>invalidSQLStatement</td><td>Invalid SQL
            statement</td></tr><tr><td>queryNotDynamic</td><td>Paramterized
            attributes can be set only when query is configured to be
            paramterized</td></tr><tr><td>noSchemaFound</td><td>Query is
            incorrect. Either listed schemas does not exist for the tenant or
            valid input is not provided in format `{schema
            name}`.</td></tr><tr><td>asteriskNotAllowed</td><td>The asterisk(*)
            is not allowed in select field. Please specify individual columns
            instead.</td></tr><tr><td>restrictedQueryType</td><td>SQL operator
            {operator} is not supported. Kindly update the
            query.</td></tr><tr><td>invalidSemanticStatement</td><td>Invalid SQL statement.</td></tr><tr><td>invalidPropertyFormat</td><td>Class Name or class property name is missing. Property name should be in {class name}.{property name} format for property: </td></tr></tbody></table></div></div><div
            class="response-content-type"><div class="content-type-wrapper
            "></div></div><p>&nbsp;</p>
          schema:
            $ref: '#/definitions/ErrorMessage'
        default:
          description: >-
            <div><div><table><colgroup><col span=\"1\" /><col span=\"1\"
            /></colgroup><tbody><td>Other error with any status code and response body format.</td></tr></tbody></table></div></div><div
            class=\"response-content-type\"><div class=\"content-type-wrapper
            \"></div></div><p>&nbsp;</p>
      deprecated: false
  '/queries/{id}':
    get:
      tags:
        - Data Query Operations
      summary: Retrieve query by query id
      description: Returns a Data Query SQL Model
      operationId: retrieveQuery
      produces:
        - application/json
      security:
        - query:
           - sdi.dqp.r
      parameters:
        - name: id
          in: path
          description: id
          required: true
          type: string
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/NativeQueryGetResponse'
        '404':
          description: >-
            <div><div><table><colgroup><col span="1" /><col span="1"
            /></colgroup><tbody><tr><th align="left">Code Suffix</th><th
            align="left">Message
            (parametrized)</th></tr><tr><td>queryNotFound</td><td>Query does not
            exist.</td></tr></tbody></table></div></div><div
            class="response-content-type"><div class="content-type-wrapper
            "></div></div><p>&nbsp;</p>
          schema:
            $ref: '#/definitions/ErrorMessage'
        default:
          description: >-
            <div><div><table><colgroup><col span=\"1\" /><col span=\"1\"
            /></colgroup><tbody><td>Other error with any status code and
            response body format.</td></tr></tbody></table></div></div><div
            class=\"response-content-type\"><div class=\"content-type-wrapper
            \"></div></div><p>&nbsp;</p>
      deprecated: false
    patch:
      tags:
        - Data Query Operations
      summary: Update query by query id
      description: Returns Updated Data Query SQL Model
      operationId: updateQuery
      consumes:
        - application/json
      produces:
        - application/json
      security:
        - query:
            - sdi.dqp.w
      parameters:
        - in: body
          name: DataQuerySQLUpdateRequest
          description: DataQuerySQLUpdateRequest
          required: true
          schema:
            $ref: '#/definitions/DataQuerySQLUpdateRequest'
        - name: id
          in: path
          description: id
          required: true
          type: string
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/DataQuerySQLResponse'
        '400':
          description: >-
            <div><div><table><colgroup><col span="1" /><col span="1"
            /></colgroup><tbody><tr><th align="left">Code Suffix</th><th
            align="left">Message
            (parametrized)</th></tr><tr><td>missingParameter</td><td>Missing
            required request body property :
            </td></tr><tr><td>invalidEncodedSqlStatement</td><td>Invalid encoded
            sql statement. </td></tr><tr><td>unsafe</td><td>SQL query is unsafe
            to execute. Kindly update the
            query.</td></tr><tr><td>invalidValue</td><td>Provided request body
            property  is invalid</td></tr><td>invalidField</td><td>Additional
            fields are not allowed. We currently support
            :</td></tr><tr><td>invalidRequestBody</td><td>The request body is null/invalid.</td></tr><tr><td>queryNotDynamic</td><td>Paramterized
            attributes can be set only when query is configured to be
            paramterized</td></tr><tr><td>incorrectColumn</td><td>Provided
            column : {0} in the parameter is not present in the
            schema</td></tr><tr><td>incorrectClassProperty</td><td>Provided
            property : {0} in the parameter is not present in the
            class</td></tr><tr><td>incorrectSchemaOrClass</td><td>Provided schema(s) or class(es) in the parameter(s) do not match schemas or class(es) in the from clause: {0}</td></tr><tr><td>invalidSQLStatement</td><td>Invalid SQL
            statement</td></tr><tr><td>queryNotDynamic</td><td>Paramterized
            attributes can be set only when query is configured to be
            paramterized</td></tr><tr><td>noSchemaFound</td><td>Query is
            incorrect. Either listed schemas does not exist for the tenant or
            valid input is not provided in format `{schema
            name}`.</td></tr><tr><td>asteriskNotAllowed</td><td>The asterisk(*)
            is not allowed in select field. Please specify individual columns
            instead.</td></tr><tr><td>notAllowed</td><td>Query cannot
            be switched from dynamic/business to static/physical query & vice
            versa. Please contact MindSphere for more
            details.</td></tr><tr><td>restrictedQueryType</td><td>SQL operator
            {operator} is not supported. Kindly update the
            query.</td></tr><tr><td>invalidSemanticStatement</td><td>Invalid SQL statement.</td></tr><tr><td>invalidPropertyFormat</td><td>Class Name or class property name is missing. Property name should be in {class name}.{property name} format for property: </td></tr></tbody></table></div></div><div
            class="response-content-type"><div class="content-type-wrapper
            "></div></div><p>&nbsp;</p>
          schema:
            $ref: '#/definitions/ErrorMessage'
        '404':
          description: >-
            <div><div><table><colgroup><col span="1" /><col span="1"
            /></colgroup><tbody><tr><th align="left">Code Suffix</th><th
            align="left">Message
            (parametrized)</th></tr><tr><td>queryNotFound</td><td>Query does not
            exist.</td></tr></tbody></table></div></div><div
            class="response-content-type"><div class="content-type-wrapper
            "></div></div><p>&nbsp;</p>
          schema:
            $ref: '#/definitions/ErrorMessage'
        default:
          description: >-
            <div><div><table><colgroup><col span=\"1\" /><col span=\"1\"
            /></colgroup><tbody><td>Other error with any status code and response body format.</td></tr></tbody></table></div></div><div
            class=\"response-content-type\"><div class=\"content-type-wrapper
            \"></div></div><p>&nbsp;</p>
      deprecated: false
    delete:
      tags:
        - Data Query Operations
      summary: Delete query by query id
      description: Returns NO CONTENT HTTP Status
      operationId: deleteQuery
      produces:
        - application/json
      security:
        - query:
            - sdi.dqp.d
      parameters:
        - name: id
          in: path
          description: id
          required: true
          type: string
      responses:
        '204':
          description: No Content
          schema:
            type: string
            enum:
              - ''
              - '101'
              - '102'
              - '103'
              - '200'
              - '201'
              - '202'
              - '203'
              - '204'
              - '205'
              - '206'
              - '207'
              - '208'
              - '226'
              - '300'
              - '301'
              - '302'
              - '303'
              - '304'
              - '305'
              - '307'
              - '308'
              - '400'
              - '401'
              - '402'
              - '403'
              - '404'
              - '405'
              - '406'
              - '407'
              - '408'
              - '409'
              - '410'
              - '411'
              - '412'
              - '413'
              - '414'
              - '415'
              - '416'
              - '417'
              - '418'
              - '419'
              - '420'
              - '421'
              - '422'
              - '423'
              - '424'
              - '426'
              - '428'
              - '429'
              - '431'
              - '451'
              - '500'
              - '501'
              - '502'
              - '503'
              - '504'
              - '505'
              - '506'
              - '507'
              - '508'
              - '509'
              - '510'
              - '511'
        '404':
          description: >-
            <div><div><table><colgroup><col span="1" /><col span="1"
            /></colgroup><tbody><tr><th align="left">Code Suffix</th><th
            align="left">Message
            (parametrized)</th></tr><tr><td>queryNotFound</td><td>Query does not
            exist.</td></tr></tbody></table></div></div><div
            class="response-content-type"><div class="content-type-wrapper
            "></div></div><p>&nbsp;</p>
          schema:
            $ref: '#/definitions/ErrorMessage'
        default:
          description: >-
            <div><div><table><colgroup><col span=\"1\" /><col span=\"1\"
            /></colgroup><tbody><td>Other error with any status code and response body format.</td></tr></tbody></table></div></div><div
            class=\"response-content-type\"><div class=\"content-type-wrapper
            \"></div></div><p>&nbsp;</p>
      deprecated: false
  '/queries/{id}/executionJobs':
    post:
      tags:
        - Data Query Operations
      summary: Create execution job for dynamic query. There is soft limit of upto 10 number of parameters and aliases.
      description: Returns id of created job
      operationId: executeJob
      consumes:
        - application/json
      produces:
        - application/json
      security:
        - query:
            - sdi.dqp.e
      parameters:
        - name: id
          in: path
          description: query id
          required: true
          type: string
        - in: body
          name: dataQueryExecuteRequest
          description: dataQueryExecuteRequest
          required: true
          schema:
            $ref: '#/definitions/DataQueryExecuteQueryRequest'
      responses:
        '201':
          description: Execution job created successfully
          schema:
            $ref: '#/definitions/DataQueryExecuteQueryResponse'
        '400':
          description: >-
            <div><div><table><colgroup><col span=\"1\" /><col span=\"1\"
            /></colgroup><tbody><tr><th align=\"left\">Code Suffix</th><th
            align=\"left\">Message
            (parametrized)</th></tr><tr><td>invalidParamName</td><td>Parameter
            attribute not found in
            query</td></tr><tr><td>queryNotDynamic</td><td>Query ID is not
            enabled for parameterized or attribute alias
            results</td></tr><tr><td>missingParameter</td><td>Missing required
            request body property
            </td></tr><tr><td>duplicateParamName</td><td>Param name is
            duplicated {0} </td></tr><tr><td>duplicateAliasValue</td><td>Alias
            value is duplicated
            {0}</td></tr><tr><td>incorrectDatatype</td><td>Provided value : {0} is incorrect as it does not match datatype of the param : {1}. Please provide correct value"</td></tr><tr><td>duplicateAttributeName</td><td>Attribute name
            is duplicated {0}
            </td></tr><tr><td>invalidAttributeName</td><td>Attribute name {0}
            not found in main select clause of the
            query</td></tr><tr><td>physicalMappingMissing</td><td>Execution for business query {0} cannot be created. Please refer query details for pending actions.</td></tr></tbody></table></div></div><div
            class=\"response-content-type\"><div class=\"content-type-wrapper
            \"></div></div><p>&nbsp;</p>
          schema:
            $ref: '#/definitions/ErrorMessage'
        '404':
          description: >-
            <div><div><table><colgroup><col span="1" /><col span="1"
            /></colgroup><tbody><tr><th align="left">Code Suffix</th><th
            align="left">Message
            (parametrized)</th></tr><tr><td>queryNotFound</td><td>Query does not
            exist.</td></tr></tbody></table></div></div><div
            class="response-content-type"><div class="content-type-wrapper
            "></div></div><p>&nbsp;</p>
          schema:
            $ref: '#/definitions/ErrorMessage'
        default:
          description: >-
            <div><div><table><colgroup><col span=\"1\" /><col span=\"1\"
            /></colgroup><tbody><td>Other error with any status code and
            response body format.</td></tr></tbody></table></div></div><div
            class=\"response-content-type\"><div class=\"content-type-wrapper
            \"></div></div><p>&nbsp;</p>
      deprecated: false
  '/queries/{id}/executionJobs/latestResults':
    get:
      tags:
        - Data Query Operations
      summary: Retrieve latest query results by query id
      description: Returns query results
      operationId: executeQueryResults
      produces:
        - application/octet-stream
        - application/json
      security:
        - query:
            - sdi.dqp.x
      parameters:
        - name: Range
          in: header
          description: 'Part of a file to return in Bytes, eg bytes=200-600'
          required: false
          type: string
          minLength: 1
          maxLength: 32
        - name: id
          in: path
          description: query id
          required: true
          type: string
      responses:
        '200':
          description: Query Results retrieved successfully
          schema:
            $ref: '#/definitions/QueryResult'
        '206':
          description: Partial Content of the file
          schema:
            type: string
            format: binary
        '400':
          description: >-
            <div><div><table><colgroup><col span="1" /><col span="1"
            /></colgroup><tbody><tr><th align="left">Code Suffix</th><th
            align="left">Message
            (parametrized)</th></tr><tr><td>mappingMissing</td><td>Physical mapping missing for associated ontology(s) for business query {0} cannot be executed. Please refer query details for pending actions.</td></tr></tbody></table></div></div><div
            class="response-content-type"><div class="content-type-wrapper
            "></div></div><p>&nbsp;</p>
          schema:
            $ref: '#/definitions/ErrorMessage'
        '404':
          description: >-
            <div><div><table><colgroup><col span="1" /><col span="1"
            /></colgroup><tbody><tr><th align="left">Code Suffix</th><th
            align="left">Message
            (parametrized)</th></tr><tr><td>queryNotFound</td><td>Query does not
            exist.</td></tr><tr><td>noExecutionJobFound</td><td>No executions were found for the specified query id.</td></tr><tr><td>queryExecutionInProgress</td><td>Query
            execution is in progress. Please try
            later.</td></tr></tbody></table></div></div><div
            class="response-content-type"><div class="content-type-wrapper
            "></div></div><p>&nbsp;</p>
          schema:
            $ref: '#/definitions/ErrorMessage'
        '410':
          description: >-
            <div><div><table><colgroup><col span="1" /><col span="1"
            /></colgroup><tbody><tr><th align="left">Code Suffix</th><th
            align="left">Message
            (parametrized)</th></tr><tr><td>queryResultsObsolete</td><td>The query associated with execution ID {0} is updated. Please create a new execution request or fetch latest results.</td></tr></tbody></table></div></div><div
            class="response-content-type"><div class="content-type-wrapper
            "></div></div><p>&nbsp;</p>
          schema:
            $ref: '#/definitions/QueryObsoleteResult'
        '416':
          description: >-
            <div><div><table><colgroup><col span="1" /><col span="1"
            /></colgroup><tbody><tr><th align="left">Code Suffix</th><th
            align="left">Message
            (parametrized)</th></tr><tr><td>requestedRangeNotSatisfiable</td><td>Requested range not satisfiable. Request Range provided: {Range}</td></tr></tbody></table></div></div><div
            class="response-content-type"><div class="content-type-wrapper
            "></div></div><p>&nbsp;</p>
          schema:
            $ref: '#/definitions/ErrorMessage'
        default:
          description: >-
            <div><div><table><colgroup><col span=\"1\" /><col span=\"1\"
            /></colgroup><tbody><td>Other error with any status code and
            response body format.</td></tr></tbody></table></div></div><div
            class=\"response-content-type\"><div class=\"content-type-wrapper
            \"></div></div><p>&nbsp;</p>
      deprecated: false
  '/executionJobs/{id}/results':
    get:
      tags:
        - Data Query Operations
      summary: Retrieve query results by job id
      description: Returns query results
      operationId: executeQueryResultsJobId
      produces:
        - application/octet-stream
        - application/json
      security:
        - query:
            - sdi.dqp.x
      parameters:
        - name: Range
          in: header
          description: 'Part of a file to return in Bytes, eg bytes=200-600'
          required: false
          type: string
          minLength: 1
          maxLength: 32
        - name: id
          in: path
          description: execution jobId
          required: true
          type: string
      responses:
        '200':
          description: Job Results retrieved successfully
          schema:
            $ref: '#/definitions/QueryResult'
        '206':
          description: Partial Content of the file
          schema:
            type: string
            format: binary
        '400':
          description: >-
            <div><div><table><colgroup><col span="1" /><col span="1"
            /></colgroup><tbody><tr><th align="left">Code Suffix</th><th
            align="left">Message
            (parametrized)</th></tr><tr><td>mappingMissing</td><td>Physical mapping missing for associated ontology(s) for business query {0} cannot be executed. Please refer query details for pending actions.</td></tr></tbody></table></div></div><div
            class="response-content-type"><div class="content-type-wrapper
            "></div></div><p>&nbsp;</p>
          schema:
            $ref: '#/definitions/ErrorMessage'
        '404':
          description: >-
            <div><div><table><colgroup><col span="1" /><col span="1"
            /></colgroup><tbody><tr><th align="left">Code Suffix</th><th
            align="left">Message
            (parametrized)</th></tr><tr><td>executionNotFound</td><td>Execution does not exist.</td></tr><tr><td>queryExecutionInProgress</td><td>Query
            execution is in progress. Please try
            later.</td></tr></tbody></table></div></div><div
            class="response-content-type"><div class="content-type-wrapper
            "></div></div><p>&nbsp;</p>
          schema:
            $ref: '#/definitions/ErrorMessage'
        '410':
          description: >-
            <div><div><table><colgroup><col span="1" /><col span="1"
            /></colgroup><tbody><tr><th align="left">Code Suffix</th><th
            align="left">Message
            (parametrized)</th></tr><tr><td>queryResultsObsolete</td><td>The query associated with execution ID {0} is updated. Please create a new execution request or fetch latest results.</td></tr></tbody></table></div></div><div
            class="response-content-type"><div class="content-type-wrapper
            "></div></div><p>&nbsp;</p>
          schema:
            $ref: '#/definitions/QueryObsoleteResult'
        '416':
          description: >-
            <div><div><table><colgroup><col span="1" /><col span="1"
            /></colgroup><tbody><tr><th align="left">Code Suffix</th><th
            align="left">Message
            (parametrized)</th></tr><tr><td>requestedRangeNotSatisfiable</td><td>Requested range not satisfiable. Request Range provided: {Range}</td></tr></tbody></table></div></div><div
            class="response-content-type"><div class="content-type-wrapper
            "></div></div><p>&nbsp;</p>
          schema:
            $ref: '#/definitions/ErrorMessage'
        default:
          description: >-
            <div><div><table><colgroup><col span=\"1\" /><col span=\"1\"
            /></colgroup><tbody><td>Other error with any status code and
            response body format.</td></tr></tbody></table></div></div><div
            class=\"response-content-type\"><div class=\"content-type-wrapper
            \"></div></div><p>&nbsp;</p>
      deprecated: false
  '/executionJobs/{id}':
    get:
      tags:
        - Data Query Operations
      summary: Retrieve job details by job id
      description: Returns Data Query Execution Model
      operationId: retrieveExecutionJobs
      produces:
        - application/json
      security:
        - query:
           - sdi.dqp.e
      parameters:
        - name: id
          in: path
          description: execution jobId
          required: true
          type: string
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/DataQueryExecutionResponse'
        '404':
          description: >-
            <div><div><table><colgroup><col span="1" /><col span="1"
            /></colgroup><tbody><tr><th align="left">Code Suffix</th><th
            align="left">Message
            (parametrized)</th></tr><tr><td>executionNotFound</td><td>Execution does not
            exist</td></tr></tbody></table></div></div><div
            class="response-content-type"><div class="content-type-wrapper
            "></div></div><p>&nbsp;</p>
          schema:
            $ref: '#/definitions/ErrorMessage'
        default:
          description: >-
            <div><div><table><colgroup><col span=\"1\" /><col span=\"1\"
            /></colgroup><tbody><td>Other error with any status code and
            response body format.</td></tr></tbody></table></div></div><div
            class=\"response-content-type\"><div class=\"content-type-wrapper
            \"></div></div><p>&nbsp;</p>
      deprecated: false
    delete:
      tags:
        - Data Query Operations
      summary: Delete job by job id
      description: Returns NO CONTENT HTTP Status
      operationId: deleteExecutionJob
      produces:
        - application/json
      security:
        - query:
            - sdi.dqp.ed
      parameters:
        - name: id
          in: path
          description: id
          required: true
          type: string
      responses:
        '204':
          description: No Content
          schema:
            type: string
            enum:
              - ''
              - '204'
        '400':
          description: >-
            <div><div><table><colgroup><col span="1" /><col span="1"
            /></colgroup><tbody><tr><th align="left">Code Suffix</th><th
            align="left">Message
            (parametrized)</th></tr><tr><td>deleteFailed</td><td>Deletion failed as query execution is in progress. Please try later.</td></tr></tbody></table></div></div><div
            class="response-content-type"><div class="content-type-wrapper
            "></div></div><p>&nbsp;</p>
          schema:
            $ref: '#/definitions/ErrorMessage'
        '404':
          description: >-
            <div><div><table><colgroup><col span="1" /><col span="1"
            /></colgroup><tbody><tr><th align="left">Code Suffix</th><th
            align="left">Message
            (parametrized)</th></tr><tr><td>executionNotFound</td><td>Execution does not
            exist</td></tr></tbody></table></div></div><div
            class="response-content-type"><div class="content-type-wrapper
            "></div></div><p>&nbsp;</p>
          schema:
            $ref: '#/definitions/ErrorMessage'
        default:
          description: >-
            <div><div><table><colgroup><col span=\"1\" /><col span=\"1\"
            /></colgroup><tbody><td>Other error with any status code and
            response body format.</td></tr></tbody></table></div></div><div
            class=\"response-content-type\"><div class=\"content-type-wrapper
            \"></div></div><p>&nbsp;</p>
      deprecated: false
  /executionJobs:
    get:
      tags:
        - Data Query Operations
      summary: Retrieve all jobs
      description: Returns a list of Data Query Execution Model
      operationId: retrieveAllExecutionJobs
      produces:
        - application/json
      security:
        - query:
            - sdi.dqp.e
      parameters:
        - $ref: '#/parameters/PageToken'
        - name: queryId
          in: query
          description: Filter based on query id
          type: string
        - name: status
          in: query
          description: Filter based on job status
          type: string
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/ResponseAllDataQueryExecutionResponse'
        '400':
          description: >-
            <div><div><table><colgroup><col span="1" /><col span="1"
            /></colgroup><tbody><tr><th align="left">Code Suffix</th><th
            align="left">Message
            (parametrized)</th></tr><tr><td>invalidFilterValue</td><td>Please provide valid filter value for field in query parameter</td></tr></tbody></table></div></div><div
            class="response-content-type"><div class="content-type-wrapper
            "></div></div><p>&nbsp;</p>
          schema:
            $ref: '#/definitions/ErrorMessage'
        default:
          description: >-
            <div><div><table><colgroup><col span=\"1\" /><col span=\"1\"
            /></colgroup><tbody><td>Other error with any status code and
            response body format.</td></tr></tbody></table></div></div><div
            class=\"response-content-type\"><div class=\"content-type-wrapper
            \"></div></div><p>&nbsp;</p>
      deprecated: false
  /ontologies:
    get:
      tags:
        - Ontologies
      summary: Retrieve all ontologies
      description: Returns a list of ontologies
      operationId: retrieveOntologies
      security:
        - ontology:
            - sdi.smd.r
      parameters:
        - $ref: '#/parameters/PageToken'
      produces:
        - application/json
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/ResponseAllOntologies'
        default:
          description: >-
            <div><div><table><colgroup><col span=\"1\" /><col span=\"1\"
            /></colgroup><tbody><td>Other error with any status code and
            response body format.</td></tr></tbody></table></div></div><div
            class=\"response-content-type\"><div class=\"content-type-wrapper
            \"></div></div><p>&nbsp;</p>
      deprecated: false
  /ontologyJobs:
    post:
      tags:
        - Ontologies Operations
      summary: Upload file and submit job for create/update ontology
      description: Upload file and submit job for create/update ontology
      operationId: createOntologyFromFileUsingPOST
      consumes:
        - multipart/form-data
      produces:
        - application/json
      security:
        - ontology:
            - sdi.smd.w
      parameters:
        - name: ontologyDescription
          in: formData
          description: |
            - Ontology description.
          required: false
          type: string
        - name: ontologyId
          in: formData
          description: |
            - Provide OntologyId for updating existing ontology. If empty then will create new ontology.
          required: false
          type: string
        - name: ontologyName
          in: formData
          description: |
            - Ontology name should be unique.
          required: true
          type: string
        - name: keyMappingType
          in: formData
          description: |
            - Define keyMappingType for ontology.
          required: false
          default: INNER JOIN
          type: string
          enum:
            - INNER JOIN
            - FULL OUTER JOIN
        - name: file
          in: formData
          description: |
            - We support JSON and OWL file pre-defined format.
          required: false
          type: file
      responses:
        '202':
          description: uploaded file and submitted job.
          schema:
            $ref: '#/definitions/OntologyJob'
        '400':
          description: >-
            <div><div><table><colgroup><col span=\\\ "1\\\" /><col span=\\\
            "1\\\" /></colgroup><tbody><tr><th align=\\\"left\\\">Code
            Suffix</th><th align=\\\"left\\\">Message
            (parametrized)</th></tr><tr><td>unsupportedType</td><td>System
            supports only Owl and Json format. Please upload an owl or json
            file.</td></tr><tr><td>allowedOntologiesPerTenant</td><td>Limit of
            total number of ontologies is exceeded. Further ontologies cannot be
            created.</td></tr></tbody></table></div></div>
          schema:
            $ref: '#/definitions/ApiErrorsView'
        default:
          description: >-
            <div><div><table><colgroup><col span=\"1\" /><col span=\"1\"
            /></colgroup><tbody><td>Other error with any status code and
            response body format.</td></tr></tbody></table></div></div><div
            class=\"response-content-type\"><div class=\"content-type-wrapper
            \"></div></div><p>&nbsp;</p>
      deprecated: false
  '/ontologies/{id}':
    get:
      tags:
        - Ontologies
      summary: Retrieve ontology.
      description: Retrieve ontology.
      operationId: retrieveOntologyUsingGET
      produces:
        - application/octet-stream
        - application/json
      security:
        - ontology:
            - sdi.smd.r
      parameters:
        - name: id
          in: path
          description: id
          required: true
          type: string
        - name: Range
          in: header
          description: 'Part of a file to return in Bytes, eg bytes=200-600'
          required: false
          type: string
          minLength: 1
          maxLength: 32
      responses:
        '200':
          description: Ontology retrieved successfully
          schema:
            $ref: '#/definitions/OntologyResponseData'
        '206':
          description: Partial Content of the file
          schema:
            type: string
            format: binary
        '404':
          description: >-
            <div><div><table><colgroup><col span=\"1\" /><col span=\"1\"
            /></colgroup><tbody><tr><th align=\"left\">Code Suffix</th><th
            align=\"left\">Message
            (parametrized)</th></tr><tr><td>requestedOntologyNotfound</td><td>Requested
            ontology does not exist.</td></tr></tbody></table></div></div><div
            class=\"response-content-type\"><div class=\"content-type-wrapper
            \"></div></div><p>&nbsp;</p>
          schema:
            $ref: '#/definitions/ApiErrorsView'
        '416':
          description: >-
            <div><div><table><colgroup><col span=\"1\" /><col span=\"1\"
            /></colgroup><tbody><tr><th align=\"left\">Code Suffix</th><th
            align=\"left\">Message
            (parametrized)</th></tr><tr><td>requestedRangeNotSatisfiable</td><td>Requested
            range not satisfiable</td></tr></tbody></table></div></div><div
            class=\"response-content-type\"><div class=\"content-type-wrapper
            \"></div></div><p>&nbsp;</p>
          schema:
            $ref: '#/definitions/ApiErrorsView'
        default:
          description: >-
            <div><div><table><colgroup><col span=\"1\" /><col span=\"1\"
            /></colgroup><tbody><td>Other error with any status code and
            response body format.</td></tr></tbody></table></div></div><div
            class=\"response-content-type\"><div class=\"content-type-wrapper
            \"></div></div><p>&nbsp;</p>
      deprecated: false
    delete:
      tags:
        - Ontologies
      summary: Delete ontology
      description: Delete ontology
      operationId: deleteOntologyUsingDELETE
      produces:
        - application/json
      security:
        - ontology:
            - sdi.smd.d
      parameters:
        - name: id
          in: path
          description: id
          required: true
          type: string
      responses:
        '204':
          description: Ontology deleted successfully
        '400':
          description: >-
            <div><div><table><colgroup><col span="1" /><col span="1"
            /></colgroup><tbody><tr><th align="left">Code Suffix</th><th
            align="left">Message
            (parametrized)</th></tr><tr><td>alreadyInUse</td><td>already in
            use.</td></tr></tbody></table></div></div><div
            class="response-content-type"><div class="content-type-wrapper
            "></div></div><p>&nbsp;</p>
          schema:
            $ref: '#/definitions/ApiErrorsView'
        '404':
          description: >-
            <div><div><table><colgroup><col span=\"1\" /><col span=\"1\"
            /></colgroup><tbody><tr><th align=\"left\">Code Suffix</th><th
            align=\"left\">Message
            (parametrized)</th></tr><tr><td>requestedOntologyNotfound</td><td>Requested
            ontology does not exist.</td></tr></tbody></table></div></div><div
            class=\"response-content-type\"><div class=\"content-type-wrapper
            \"></div></div><p>&nbsp;</p>
          schema:
            $ref: '#/definitions/ApiErrorsView'
        default:
          description: >-
            <div><div><table><colgroup><col span=\"1\" /><col span=\"1\"
            /></colgroup><tbody><td>Other error with any status code and
            response body format.</td></tr></tbody></table></div></div><div
            class=\"response-content-type\"><div class=\"content-type-wrapper
            \"></div></div><p>&nbsp;</p>
      deprecated: false
  '/ontologyJobs/{id}':
    get:
      summary: Retrieve status of ontology creation/updation job
      tags:
        - Ontologies Operations
      operationId: retrieveOntologyJob
      security:
        - ontology:
            - sdi.smd.r
      parameters:
        - name: id
          in: path
          description: Ontology job ID as obtained on Ontology creation/updation
          required: true
          type: string
      responses:
        '200':
          description: Ok
          schema:
            $ref: '#/definitions/JobStatus'
        '400':
          description: <div><div><table><colgroup><col span=\\\ "1\\\" /><col span=\\\ "1\\\" /></colgroup><tbody><tr><th align=\\\"left\\\">Code Suffix</th><th align=\\\"left\\\">Message (parametrized)</th></tr><tr><td>allowedOntologiesPerTenant</td><td>Limit of total number of ontologies is exceeded. Further ontologies cannot be created.</td></tr></tbody></table></div></div>
          schema:
            $ref: '#/definitions/ApiErrorsView'
        '404':
          description: <div><div><table><colgroup><col span=\\\ "1\\\" /><col span=\\\ "1\\\" /></colgroup><tbody><tr><th align=\\\"left\\\">Code Suffix</th><th align=\\\"left\\\">Message (parametrized)</th></tr><tr><td>requestedOntologyJobNotFound</td><td>Requested ontology job does not exist</td></tr></tbody></table></div></div>
          schema:
            $ref: '#/definitions/ApiErrorsView'
        default:
          description: Other error with any status code and response body format.
  /inferOntology:
    post:
      tags:
        - Ontologies
      summary: Infer semantic model based on two or more generated schemas. Currently it supports infer of upto 20 schemas.
      description: Infer semantic model to create ontology based on two or more schemas
      operationId: inferSemanticModelUsingPOST
      consumes:
        - application/json
      produces:
        - application/json
      security:
        - ontology:
            - sdi.smd.w
      parameters:
        - in: body
          name: inferSchemaSearchRequest
          description: Provide two or more schemas to infer an ontology.
          required: true
          schema:
            $ref: '#/definitions/InferSchemaSearchRequest'
      responses:
        '200':
          description: OK. this returns the predefined JSON format as required by ontologyJobs operation.
        '400':
          description: '<div><div><table><colgroup><col span=\"1\" /><col span=\"1\" /></colgroup><tbody><tr><th align=\"left\">Code Suffix</th><th align=\"left\">Message (parametrized)</th></tr><tr><td>insufficientSchemas</td><td>Request must contain two or more schemas to infer semantic ontology model.</td></tr></tbody></table></div></div><div class=\"response-content-type\"><div class=\"content-type-wrapper \"></div></div><p>&nbsp;</p>'
          schema:
            $ref: '#/definitions/ApiErrorsView'
        '404':
          description: Not Found
      deprecated: false
parameters:
    PageToken:
      name: pageToken
      in: query
      type: string
      description: |
        Selects next page. Value must be taken rom response body property 'page.nextToken'. If omitted, first page is returned.
definitions:
  ListOfIoTRegistryResponse:
    type: object
    properties:
      iotDataRegistries:
        type: array
        items:
          $ref: '#/definitions/IotDataRegistryResponse'
      page:
        $ref: '#/definitions/TokenPage'
    title: ListOfIoTDataRegistries
  IotDataRegistryResponse:
    type: object
    properties:
      aspectName:
        type: string
      assetId:
        type: string
      category:
        type: string
        example: "IOT"
        description: The category for this IoT Data Registry is always IOT
      createdDate:
        type: string
        format: dataTime
      dataTag:
        type: string
        description: The dataTag is combination of assetId and aspectName, separated by _
      fileUploadStrategy:
        type: string
        enum:
         - append
         - replace
      updatedDate:
        type: string
        format: dataTime
      registryId:
        type: string
      sourceName:
        type: string
        description: The sourceName is always MindSphere.
    title: IotDataRegistryResponse

  DataLakeResponse:
    type: object
    properties:
      basePath:
        type: string
      createdDate:
        type: string
        format: dataTime
      id:
        type: string
      updatedDate:
        type: string
        format: dataTime
      name:
        type: string
      type:
        type: string
    title: DataLakeResponse
  DataLakeList:
    type: object
    properties:
      dataLakes:
        type: array
        items:
          $ref: '#/definitions/DataLakeResponse'
    title: List of Data Lakes
  DataTypePattern:
    type: object
    properties:
      patterns:
        type: array
        items:
          type: string
    title: DataTypePattern
  DataRegistry:
    type: object
    properties:
      createdDate:
        type: string
        format: dataTime
      dataTag:
        type: string
      defaultRootTag:
        type: string
      filePattern:
        type: string
      fileUploadStrategy:
        type: string
        enum:
          - append
          - replace
      updatedDate:
        type: string
        format: dataTime
      metaDataTags:
        type: array
        items:
          type: string
      xmlProcessRules:
        type: array
        items:
          type: string
      partitionKeys:
        type: array
        items:
          type: string
      mutable:
        type: boolean
      registryId:
        type: string
      sourceId:
        type: string
      sourceName:
        type: string
      schemaFrozen:
        type: boolean
        example: false
    title: DataRegistry
  ListOfDataTypeDefinition:
    type: object
    properties:
      dataTypes:
        type: array
        items:
          $ref: '#/definitions/DataTypeDefinition'
      page:
        $ref: '#/definitions/TokenPage'
    title: List of Custom Datatypes
  DataTypeDefinition:
    type: object
    properties:
      name:
        type: string
        example: "VIN_NUMBER"
      patterns:
        type: array
        items:
          type: string
        example: ["[A-HJ-NPR-Z0-9]{17}"]
    title: DataTypeDefinition
  ListOfRegistryResponse:
    type: object
    properties:
      dataRegistries:
        type: array
        items:
          $ref: '#/definitions/DataRegistry'
      page:
        $ref: '#/definitions/TokenPage'
    title: dataRegistries
  TokenPage:
    type: object
    properties:
        nextToken:
          type: string
          description: |
              Opaque token to next page. Can be used in query paramter 'pageToken' to request next page. The property is only present in case there is a next page.
  MdspErrors:
    type: object
    properties:
      errors:
        type: array
        items:
          $ref: '#/definitions/MdspError'
  MdspError:
    description: A descriptor for error responses.
    allOf:
      - $ref: '#/definitions/MdspApiError'
      - type: object
        properties:
          logref:
            type: string
            description: "Logging correlation ID for debugging purposes."
            example: "0bff7e7a-cd25-4576-9908-4180ef086174"

  MdspApiError:
    type: object
    description: A descriptor for errors that are integral parts of resources.
    properties:
      code:
        type: string
        description: "Unique error code. Every code is bound to one (parametrized) message."
        format: "mdsp.core.sdi.<errorTypeDetail>"
        example: "mdsp.core.sdi.dataingestserviceinvaliddataregistryentry "
      message:
        type: string
        description: "Human readable error message in English."
        example: "Example error message with parameter value 100"
      messageParameters:
        type: array
        description: |
          In case an error message is parametrized, the parameter names and values are returned for, e.g., localization purposes. The parametrized error messages are defined at the operation error response descriptions in this API specification. Parameters are denoted by named placeholders '{\<parameter name\>}' in the message specifications. At runtime, returned message placeholders are substituted by actual parameter values.
        items:
          type: object
          description: "Message parameter"
          properties:
            name:
              type: string
              description: "Name of message parameter as specified in parametrized error message."
            value:
              type: string
              description: "Value of message parameter as substituted in returned error message."
        example:
          - { "name": "exampleParameterName", "value": "100" }
  ListOfPatterns:
    type: object
    properties:
      suggestPatterns:
        type: array
        items:
          $ref: '#/definitions/Pattern'
  Pattern:
    type: object
    properties:
      schema:
        type: string
      matches:
        type: array
        items:
          type: string
      schemaValid:
        type: boolean
  SDIIngestData:
    type: object
    properties:
      dataTag:
        type: string
      filePath:
        type: string
      rootTag:
        type: string
      sourceName:
        type: string
    title: SDIIngestData
  SdiFileUploadResponse:
    type: object
    properties:
      filePath:
        type: string
  SdiJobStatusResponse:
    type: object
    properties:
      jobId:
        type: string
      startedDate:
        type: string
      finishedDate:
        type: string
      message:
        type: string
      fileName:
        type: string
      status:
        type: string
        enum:
          - IN_PROGRESS
          - ERROR
          - STARTED
          - FINISHED
    title: SdiJobStatusResponse
  InferSearchObject:
    type: object
    properties:
      dataTag:
        type: string
      schemaName:
        type: string
      sourceName:
        type: string
      assetId:
        type: string
      aspectName:
        type: string
    title: SchemaSearchObject
  SchemaSearchObject:
    type: object
    properties:
      dataTag:
        type: string
      schemaName:
        type: string
      category:
        type: string
        enum:
          - ENTERPRISE
          - IOT
      aspectName:
        type: string
      assetId:
        type: string
      sourceName:
        type: string
      metaDataTags:
        type: array
        items:
          type: string
        description:
          metaDataTags can be defined while creating a data registry.
        example: ["teamcenter"]
    title: SchemaSearchObject
  UpdateDataLakeRequest:
    type: object
    properties:
      basePath:
        type: string
    title: UpdateDataLakeRequest
  CreateDataLakeRequest:
    type: object
    properties:
      name:
        type: string
      type:
        type: string
        enum:
          - MindSphere
          - Custom
      basePath:
        type: string
        description: This is currently supported only for the IDL customer. Please refer to the document section "For Integrated Data Lake (IDL) customers" on correct basePath structure.
    title: CreateDataLakeRequest
  CreateDataLakeResponse:
    type: object
    properties:
      id:
        type: string
      name:
        type: string
      type:
        type: string
        enum:
         - MindSphere
         - Custom
      basePath:
        type: string
      createdDate:
        type: string
        format: dataTime
      updatedDate:
        type: string
        format: dataTime
    title: CreateDataLakeResponse
  UpdateDataRegistryRequest:
    type: object
    properties:
      defaultRootTag:
        type: string
      filePattern:
        type: string
      fileUploadStrategy:
        type: string
        enum:
          - append
          - replace
      metaDataTags:
        type: array
        items:
          type: string
      xmlProcessRules:
        type: array
        items:
          type: string
      schemaFrozen:
        type: boolean
        description: "This property can be changed to true after creating the initial schema to reuse the schema for the newly ingested data"
        example: false
    title: UpdateDataRegistryRequest
  CreateDataRegistryRequest:
    type: object
    properties:
      dataTag:
        type: string
      defaultRootTag:
        type: string
      filePattern:
        type: string
      fileUploadStrategy:
        type: string
        enum:
          - append
          - replace
      metaDataTags:
        type: array
        items:
          type: string
      sourceName:
        type: string
      xmlProcessRules:
        type: array
        items:
          type: string
      partitionKeys:
        type: array
        items:
          type: string
        description: "A single paritionKey can be specified at the time of registry creation. It can be set to 'sdi-default-partition-key' to enable default paritioning. It can be set to a custom attribute present in the data to enable paritioning based on that attribute."
      schemaFrozen:
        type: boolean
        default: false
        description: "This property must be set to false during initial creation of a registry. It can be changed to true after the initial schema creation to reuse the existing schema for the newly ingested data"
        example: false
    title: CreateDataRegistryRequest
  SchemaSearchRequest:
    type: object
    properties:
      schemas:
        type: array
        items:
          $ref: '#/definitions/SchemaSearchObject'
    title: SchemaSearchRequest
  InferSchemaSearchRequest:
    type: object
    properties:
      schemas:
        type: array
        items:
          $ref: '#/definitions/InferSearchObject'
      excludeProperties:
        type: array
        items:
          type: string
    title: InferSchemaSearchRequest
  ListOfJobIds:
    type: object
    properties:
      ingestJobStatus:
        type: array
        items:
          $ref: '#/definitions/SdiJobStatusResponse'
      page:
        $ref: '#/definitions/TokenPage'
    title: List of jobIds
  ListOfSchemaRegistry:
    type: object
    properties:
      schemas:
        type: array
        items:
          $ref: '#/definitions/SDISchemaRegistry'
      page:
        $ref: '#/definitions/TokenPage'
    title: List of Schema Registry
  ListOfSchemaProperties:
      $ref: '#/definitions/SDISchemaProperty'
  SDISchemaProperty:
    type: object
    required: ["dataType"]
    properties:
        dataType:
          type: string
          example: integer
        customTypes:
          type: array
          example:
            - us_state
            - vin_number
          items:
            type: string
  SDISchemaRegistry:
    type: object
    properties:
      createdDate:
        type: string
        format: dataTime
      id:
        type: string
      updatedDate:
        type: string
        format: dataTime
      originalFileNames:
        type: array
        items:
          type: string
      schema:
       type: object
       additionalProperties:
         $ref: '#/definitions/ListOfSchemaProperties'
       description: This is a loosely defined schema string containing property name, one or more data type for given property and list of regex patterns for a type.
      schemaName:
        type: string
      registryId:
        type: string
      category:
        type: string
    title: SDI SchemaRegistry
  ApiFieldError:
    type: object
    properties:
      code:
        type: string
        example: mdsp.core.sdi.exampleCode
      logref:
        type: string
        example: 0bff7e7a-cd25-4576-9908-4180ef086174
      message:
        type: string
        example: Example error message with parameter value 100
      messageParameters:
        type: array
        items:
          $ref: '#/definitions/MessageParameter'
    title: ApiFieldError
  DataQuerySQLRequest:
    type: object
    required: ["sqlStatement", "name" ]
    properties:
      description:
        type: string
        example: Analysis of vehicle accident
      isBusinessQuery:
        type: boolean
        default: false
        example: true
      ontologyId:
        description: >-
          If isBusinessQuery is true then ontologyId must be passed.
        type: string
        example: A065E2E5D2A36888AF88469073786B6F
      isDynamic:
        type: boolean
        default: false
        example: true
      name:
        type: string
        example: crashanalysis
      sqlStatement:
        description: "Pass base64 encode value of spark sql like SELECT vehicle.vin, make.def FROM vehicle, make WHERE vehicle.make = make.id. Please refer SDI-How -to-create-query documentation for preparing sqlStatement."
        type: string
        format: base64
        example: >-
          U0VMRUNUIHZlaGljbGUudmluLCBtYWtlLmRlZiBGUk9NIHZlaGljbGUsIG1ha2UgV0hFUkUgdmVoaWNsZS5tYWtlID0gbWFrZS5pZA==
    title: DataQuerySQLRequest.
  DataQuerySQLUpdateRequest:
    type: object
    properties:
      description:
        type: string
        example: Analysis of vehicle accident
      isBusinessQuery:
        type: boolean
        default: false
        example: true
      ontologyId:
        description: >-
          If isBusinessQuery is true then ontologyId must be passed.
        type: string
        example: A065E2E5D2A36888AF88469073786B6F
      isDynamic:
        type: boolean
        example: true
      name:
        type: string
        example: crashanalysis
      sqlStatement:
        description: "Pass base64 encode value of spark sql like SELECT vehicle.vin, make.def FROM vehicle, make WHERE vehicle.make = make.id. Please refer SDI-How -to-create-query documentation for preparing sqlStatement."
        type: string
        format: base64
        example: >-
          U0VMRUNUIHZlaGljbGUudmluLCBtYWtlLmRlZiBGUk9NIHZlaGljbGUsIG1ha2UgV0hFUkUgdmVoaWNsZS5tYWtlID0gbWFrZS5pZA==
    title: DataQuerySQLUpdateRequest.
  DataQueryExecuteQueryRequest:
    type: object
    description: Either parameters or aliases must be present.
    properties:
      description:
        type: string
        example: Running query with sample alias and parameters
      parameters:
        type: array
        items:
          $ref: '#/definitions/Parameters'
      aliases:
        type: array
        items:
          $ref: '#/definitions/Aliases'
    title: DataQueryExecuteQueryRequest
  DataQueryExecutionResponse:
    type: object
    properties:
      id:
        type: string
        example: 5d4d0aba988cdf4bata6f3f7
      description:
        type: string
        example: Running query with sample alias and parameters
      parameters:
        type: array
        items:
          $ref: '#/definitions/Parameters'
      aliases:
        type: array
        items:
          $ref: '#/definitions/Aliases'
      queryId:
        type: string
        example: 5e2000af8ee91c0e0e25ed2a
      status:
        type: string
        enum:
          - CURRENT
          - IN_PROGRESS
          - OUTDATED
          - FAILED
          - OBSOLETE
        description: >
          Status of execution job.

          - CURRENT: Job has executed successfully and results are current.

          - IN_PROGRESS: Job execution is in progress.

          - OUTDATED: Job execution completed but results are outdated.

          - FAILED: Job execution has failed.

          - OBSOLETE: Job execution completed but results are obsolete.
      createdDate:
        type: string
        example: '2019-08-08T05:55:06.119Z'
      updatedDate:
        type: string
        example: '2019-08-09T01:45:09.105Z'
    title: DataQueryExecutionResponse
  ResponseAllDataQueryExecutionResponse:
    type: object
    properties:
      page:
        $ref: '#/definitions/TokenPage'
      jobs:
        type: array
        items:
          $ref: '#/definitions/DataQueryExecutionResponse'
  DataQueryExecuteQueryResponse:
    type: object
    properties:
      id:
        type: string
        example: 5d4d0aba988cdf4bata6f3f7
      status:
        type: string
        example: IN_PROGRESS
      message:
        type: string
        example: Query execution is in progress.
    title: DataQueryExecuteQueryResponse
  DataQuerySQLResponse:
    type: object
    properties:
      createdDate:
        type: string
        example: '2019-08-08T05:55:06.119Z'
      description:
        type: string
        example: Analysis of vehicle accident
      executable:
        type: boolean
        example: false
      id:
        type: string
        example: 5d4d0aba988cdf4baca6f3f7
      isBusinessQuery:
        type: boolean
      isDynamic:
        type: boolean
      name:
        type: string
        example: crashanalysis
      ontologyId:
        type: string
        example: A065E2E5D2A36888AF88469073786B6F
      pendingActions:
        type: array
        items:
          $ref: '#/definitions/MappingErrorSQLDetails'
      sqlStatement:
        type: string
        example: >-
          SELECT vehicle.vin, make.def FROM vehicle, make WHERE vehicle.make =
          make.id
      updatedDate:
        type: string
        example: '2019-08-09T01:45:09.105Z'
    title: DataQuerySQLResponse
  NativeQueryGetResponse:
    type: object
    properties:
      createdDate:
        type: string
        example: '2019-08-08T05:55:06.119Z'
      description:
        type: string
        example: Analysis of vehicle accident
      executable:
        type: boolean
        example: false
      id:
        type: string
        example: 5d4d0aba988cdf4baca6f3f7
      isBusinessQuery:
        type: boolean
      isDynamic:
        type: boolean
      name:
        type: string
        example: crashanalysis
      ontologyId:
        type: string
        example: A065E2E5D2A36888AF88469073786B6F
      pendingActions:
        type: array
        items:
          $ref: '#/definitions/MappingErrorSQLDetails'
      sqlStatement:
        type: string
        example: >-
          SELECT vehicle.vin, make.def FROM vehicle, make WHERE vehicle.make =
          make.id
      updatedDate:
        type: string
        example: '2019-08-09T01:45:09.105Z'
      lastTenExecutionJobIds:
        type: array
        example:
          - 5d4d0aba988cdf4bata6f3f7
        items:
          type: string
    title: NativeQueryGetResponse
  GetAllSQLQueriesData:
    type: object
    properties:
      createdBy:
        type: string
        example: jsmith@example.com
      createdDate:
        type: string
        example: '2019-08-08T05:55:06.119Z'
      description:
        type: string
        example: Analysis of vehicle accident
      executable:
        type: boolean
        example: false
      id:
        type: string
        example: 5d52995b988cdf5c449874a5
      isBusinessQuery:
        type: boolean
        example: true
      isDynamic:
        type: boolean
        example: true
      name:
        type: string
        example: crashanalysis
      ontologyId:
        type: string
        example: A065E2E5D2A36888AF88469073786B6F
      pendingActions:
        type: array
        items:
          $ref: '#/definitions/MappingErrorSQLDetails'
      updatedBy:
        type: string
        example: jkale@example.com
      updatedDate:
        type: string
        example: '2019-08-09T01:45:09.105Z'
    title: GetAllSQLQueriesData
  ResponseAllDataSQLQuery:
    type: object
    properties:
      page:
        $ref: '#/definitions/TokenPage'
      queries:
        type: array
        items:
          $ref: '#/definitions/GetAllSQLQueriesData'
  ErrorMessage:
    type: object
    properties:
      errors:
        type: array
        items:
          $ref: '#/definitions/ApiFieldError'
    title: ErrorMessage
  MessageParameter:
    type: object
    properties:
      name:
        type: string
        example: exampleParameterName
      value:
        type: object
        example: 100
    title: MessageParameter
  MappingErrorSQLDetails:
    type: object
    properties:
      field:
        type: string
        example: sqlStatement
      message:
        type: string
        example: vehicle is not mapped in ontology
    title: MappingErrorSQLDetails
  ResponseAllOntologies:
    type: object
    properties:
      ontologies:
        type: array
        items:
          $ref: '#/definitions/OntologyMetadata'
      page:
        $ref: '#/definitions/TokenPage'
    title: ResponseAllOntologies

  OntologyMetadata:
    type: object
    properties:
      createdDate:
        type: string
        example: '2019-10-01T08:06:49.152Z'
      ontologyDescription:
        type: string
        example: vehicle ontology
        description: "Ontology description."
      id:
        type: string
        example: 605805A351B5A39B774079E620BFD8D2
        description: 'Ontology id.'
      ontologyName:
        type: string
        example: ns
        description: Ontology name.
      keyMappingType:
        type: string
        example: INNER JOIN
        description: Ontology keyMappingType.
      updatedDate:
        type: string
        example: '2019-10-01T08:06:49.152Z'
    title: OntologyMetadata
  OntologyJob:
    type: object
    properties:
      id:
        type: string
        format: string
        description: Unique Ontology job ID.
        example: 5d869eaba067690e06069433
      status:
        type: string
        enum:
          - SUBMITTED
          - IN_PROGRESS
          - ERROR
          - SUCCESS
        description: >
          Status of ontology creation/updation job.

          - SUBMITTED: job has been created but creation/updation of ontology
          not yet started.

          - IN_PROGRESS: Ontology creation or updation started.

          - FAILED: Ontology creation or updation has failed. No data is
          available to be retrieved.

          - SUCCESS: Ontology creation or updation has been successfully
          finished.
      message:
        type: string
        format: string
        example: "The Resuest for Create Ontology."
        description: |
          Contains an message in case the job created. Possible messages:
           - The Resuest for Create Ontology.
           - The Resuest for Create Ontology using owl file upload.
           - The Resuest for Update Ontology.
      createdDate:
        type: string
        format: dataTime
        description: Start time of Ontology job created in UTC date format.
        example: "2019-07-31T13:36:00.000Z"
      updatedDate:
        type: string
        format: dataTime
        example: "2019-07-31T13:36:00.000Z"
        description: >-
          Job last modified time in UTC date format. The backend updates this
          time whenever the job status changes.
  JobStatus:
    type: object
    properties:
      id:
        type: string
        format: string
        description: Unique Ontology job ID.
        example: 5d869eaba067690e06069433
      status:
        type: string
        example: IN_PROGRESS
        enum:
          - SUBMITTED
          - IN_PROGRESS
          - ERROR
          - SUCCESS
        description: >
          Status of ontology creation/updation job.

          - SUBMITTED: job has been created but creation/updation of ontology
          not yet started.

          - IN_PROGRESS: Ontology creation or updation started.

          - FAILED: Ontology creation or updation has failed. No data is
          available to be retrieved.

          - SUCCESS: Ontology creation or updation has been successfully
          finished.
      message:
        type: string
        format: string
        example: "The Resuest for Create Ontology."
        description: |
          Contains an message in case the job created. Possible messages:
           - The Request for Create Ontology.
           - The Request for Create Ontology using owl file upload.
           - The Request for Update Ontology.
      createdDate:
        type: string
        format: dataTime
        description: Start time of Ontology job created in UTC date format.
        example: "2019-07-31T13:36:00.000Z"
      updatedDate:
        type: string
        format: dataTime
        example: "2019-07-31T13:36:00.000Z"
        description: >-
          Job last modified time in UTC date format. The backend updates this
          time whenever the job status changes.
      ontologyResponse:
        description: >-
          ontologyResponse will contain either ontology id or ontology error based on job success or fail.
        type: object
        properties:
          ontologyId:
            type: string
            format: string
            example: "6AB08D833EC97CA18D9951BAD2C526B3"
            description: >-
              Ontology id will be present if ontology creation successful.
          ontologyErrors:
            type: array
            description: >-
              ontologyErrors will be present if ontology creation failed.
            items:
              $ref: '#/definitions/ApiFieldError'
  ApiErrorsView:
    type: object
    properties:
      errors:
        type: array
        items:
          $ref: '#/definitions/ApiFieldError'
    title: ApiErrorsView

  MappingFunction:
    type: object
    properties:
      operator:
        type: string
    title: MappingFunction
  IotDataRegistry:
    type: object
    properties:
      assetId:
        type: string
      aspectName:
        type: string
  OntologyResponseData:
    type: object
    properties:
      createdDate:
        type: string
        example: '2019-10-01T08:06:49.152Z'
      ontologyDescription:
        type: string
        example: vehicle ontology
        description: "Ontology description."
      id:
        type: string
        example: 605805A351B5A39B774079E620BFD8D2
        description: 'Ontology id.'
      ontologyName:
        type: string
        example: ns
        description: Ontology name.
      keyMappingType:
        type: string
        example: INNER JOIN
        description: Ontology keyMappingType.
      updatedDate:
        type: string
        example: '2019-10-01T08:06:49.152Z'
      classProperties:
        type: array
        items:
          $ref: '#/definitions/InputClassProperty'
      classes:
        type: array
        items:
          $ref: '#/definitions/InputClass'
      mappings:
        type: array
        items:
          $ref: '#/definitions/InputMapping'
      propertyRelations:
        type: array
        items:
          $ref: '#/definitions/InputPropertyRelation'
      schemaProperties:
        type: array
        items:
          $ref: '#/definitions/InputSchemaProperty'
      schemas:
        type: array
        items:
          $ref: '#/definitions/InputSchema'
    title: OntologyResponseData
  InputClass:
    type: object
    properties:
      description:
        type: string
        example: Make desc
      name:
        type: string
        example: Make
      primarySchema:
        type: string
        example: nhtsa1378436264_make_v1
        description: If class mapped with more than one schemas then user can define either one of them as primary schema.
      keyMappingType:
        type: string
        example: INNER JOIN
        enum:
            - INNER JOIN
            - FULL OUTER JOIN
        description: Class keyMappingType. If Parent level 'keyMappingType' is defined then class 'keyMappingType' property will overwrite Parent level 'keyMappingType' value.
    title: InputClass
  InputClassProperty:
    type: object
    properties:
      datatype:
        type: string
        example: String
      description:
        type: string
        example: id desc
      name:
        type: string
        example: id
      parentClass:
        $ref: '#/definitions/InputParent'
    title: InputClassProperty
  InputMapping:
    type: object
    properties:
      classProperty:
        $ref: '#/definitions/InputMappingClassProperty'
      description:
        type: string
        example: id mapping desc
      functionalMapping:
        type: boolean
        example: false
      keyMapping:
        type: boolean
        example: true
      mappingFunction:
        $ref: '#/definitions/MappingFunction'
      name:
        type: string
        example: id mapping
      schemaProperties:
        type: array
        items:
          $ref: '#/definitions/InputMappingSchemaProperty'
    title: InputMapping
  InputMappingClassProperty:
    type: object
    properties:
      name:
        type: string
        example: Year
      parentClass:
        $ref: '#/definitions/InputParent'
    title: InputMappingClassProperty
  InputMappingSchemaProperty:
    type: object
    properties:
      name:
        type: string
        example: latitude
      order:
        type: string
      parentSchema:
        $ref: '#/definitions/InputParent'
    title: InputMappingSchemaProperty
  InputParent:
    type: object
    properties:
      name:
        type: string
        example: vehicle
    title: InputParent
  InputPropertyRelation:
    type: object
    properties:
      description:
        type: string
        example: Property relation between Make and Vehicle Classes
      endClassProperty:
        $ref: '#/definitions/InputMappingClassProperty'
      name:
        type: string
        example: make-vehicle-property-relation
      relationType:
        type: string
        example: one-to-one
      startClassProperty:
        $ref: '#/definitions/InputMappingClassProperty'
    title: InputPropertyRelation
  InputSchema:
    type: object
    properties:
      description:
        type: string
        example: nhtsa1378436264_make_v1 desc
      name:
        type: string
        example: nhtsa1378436264_make_v1
    title: InputSchema
  InputSchemaProperty:
    type: object
    properties:
      datatype:
        type: string
        example: String
      description:
        type: string
        example: id mapping desc
      name:
        type: string
        example: id
      parentSchema:
        $ref: '#/definitions/InputParent'
    title: InputSchemaProperty
  QueryResult:
    type: object
    description: If user creates query 'SELECT vehicle.vin, make.def FROM vehicle, make WHERE vehicle.make = make.id' returns results as array of json object contaning keys as 'vehicle.vin', 'make.def' and values matching according to criteria.
    properties:
      status:
        type: string
        example: CURRENT
        description: "Query result status."
      timestamp:
        type: string
        example: '2019-10-01T08:06:49.152Z'
      data:
        type: array
        example:
          - vehicle.vin: MH1234
            make.def: sampleDef
        items:
          additionalProperties: true
  QueryObsoleteResult:
    type: object
    properties:
      errors:
        type: array
        items:
          $ref: '#/definitions/ApiFieldError'
      data:
        type: array
        example:
          - column1: sampleStr
            column2: 1234
        items:
            additionalProperties: true
  Aliases:
    type: object
    required: ["attributeName", "aliasValue"]
    properties:
      attributeName:
        type: string
        example: column1
      aliasValue:
        type: string
        example: abc
    title: Aliases
  Parameters:
    type: object
    required: ["paramName", "paramValue"]
    properties:
      paramName:
        type: string
        example: column1
      paramValue:
        type: string
        example: abc
    title: Parameters
