> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nx1cloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Import an ontology file

> Read OWL/SKOS (.ttl, .owl, .rdf, .nt), a business glossary (.yml) or a CSV as a draft spec. Files up to 5 MB. Nothing is stored.



## OpenAPI

````yaml post /api/registry/ontologies/import/file
openapi: 3.1.0
info:
  title: Nx1 AI API
  description: |

    AI API for Nx1 Data Platform Management and Automated Data Tasks.

    Authentication is required via PSK in Authorization header.

    Default PSK is | [ask a friend] |
  version: 0.10.2
servers: []
security: []
paths:
  /api/registry/ontologies/import/file:
    post:
      tags:
        - Ontologies
      summary: Import an ontology file
      description: >-
        Read OWL/SKOS (.ttl, .owl, .rdf, .nt), a business glossary (.yml) or a
        CSV as a draft spec. Files up to 5 MB. Nothing is stored.
      operationId: import_file_api_registry_ontologies_import_file_post
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_import_file_api_registry_ontologies_import_file_post
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/api__models__ontology_models__ImportResponse
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Conflict
        '413':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Content Too Large
        '415':
          description: Unsupported Media Type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    Body_import_file_api_registry_ontologies_import_file_post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
          description: The file to read.
      type: object
      required:
        - file
      title: Body_import_file_api_registry_ontologies_import_file_post
    api__models__ontology_models__ImportResponse:
      properties:
        spec:
          $ref: '#/components/schemas/OntologySpec'
        warnings:
          items:
            type: string
          type: array
          title: Warnings
        counts:
          additionalProperties:
            type: integer
          type: object
          title: Counts
      type: object
      required:
        - spec
        - warnings
        - counts
      title: ImportResponse
      description: A spec read from a file or the catalog. Nothing is stored.
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: A brief description of the error that occurred.
        code:
          type: integer
          title: Code
          description: The HTTP status code associated with the error.
          default: 500
      type: object
      required:
        - error
      title: ErrorResponse
    OntologySpec:
      properties:
        root_name:
          type: string
          maxLength: 200
          title: Root Name
          description: 'Name of the root group in the catalog. Empty: the display name.'
          default: ''
        domain_urn:
          anyOf:
            - type: string
              maxLength: 400
            - type: 'null'
          title: Domain Urn
          description: A catalog domain every term is put in.
        stewards:
          items:
            type: string
          type: array
          maxItems: 20
          title: Stewards
        groups:
          items:
            $ref: '#/components/schemas/OntologyGroup'
          type: array
          maxItems: 500
          title: Groups
        concepts:
          items:
            $ref: '#/components/schemas/OntologyConcept'
          type: array
          maxItems: 2000
          title: Concepts
        relations:
          items:
            $ref: '#/components/schemas/OntologyRelation'
          type: array
          maxItems: 10000
          title: Relations
        mappings:
          items:
            $ref: '#/components/schemas/OntologyMapping'
          type: array
          maxItems: 10000
          title: Mappings
        source:
          additionalProperties:
            type: string
          type: object
          title: Source
          description: >-
            Where the first draft came from (format, file name, IRI). Informs
            review.
      additionalProperties: false
      type: object
      title: OntologySpec
      description: An ontology version.
    OntologyGroup:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          maxLength: 200
          minLength: 1
          title: Name
        description:
          type: string
          maxLength: 4000
          title: Description
          default: ''
        parent:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent
          description: Id of the parent group.
        catalog_urn:
          anyOf:
            - type: string
            - type: 'null'
          title: Catalog Urn
          description: The catalog node this group was adopted from. Kept on publish.
      additionalProperties: false
      type: object
      required:
        - id
        - name
      title: OntologyGroup
      description: A folder of concepts. A glossary node in the catalog.
    OntologyConcept:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          maxLength: 200
          minLength: 1
          title: Name
        group:
          anyOf:
            - type: string
            - type: 'null'
          title: Group
          description: Id of its group.
        definition:
          type: string
          maxLength: 8000
          title: Definition
          default: ''
        synonyms:
          items:
            type: string
          type: array
          maxItems: 30
          title: Synonyms
        properties:
          additionalProperties:
            type: string
          type: object
          title: Properties
          description: >-
            Free key/value facts (unit, owner team, …). Written to the catalog
            as custom properties.
        catalog_urn:
          anyOf:
            - type: string
            - type: 'null'
          title: Catalog Urn
          description: >-
            The catalog term this concept was adopted from. Kept on publish, so
            tags already on tables and columns stay attached.
        source_iri:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: Source Iri
          description: The IRI this concept was imported from (OWL/SKOS), if any.
      additionalProperties: false
      type: object
      required:
        - id
        - name
      title: OntologyConcept
      description: A business concept. A glossary term in the catalog.
    OntologyRelation:
      properties:
        source:
          type: string
          title: Source
        kind:
          type: string
          enum:
            - is_a
            - has_a
            - values
            - related
            - named
          title: Kind
        target:
          type: string
          title: Target
        label:
          anyOf:
            - type: string
              maxLength: 100
            - type: 'null'
          title: Label
      additionalProperties: false
      type: object
      required:
        - source
        - kind
        - target
      title: OntologyRelation
      description: |-
        A directed relation between two concepts.

        ``is_a``: the source is a kind of the target. ``has_a``: the source
        contains the target. ``values``: the target is one of the source's
        allowed values. ``related``: loosely related, both ways. ``named``: a
        verb (``label``) the catalog has no slot for.
    OntologyMapping:
      properties:
        concept:
          type: string
          title: Concept
        table:
          type: string
          title: Table
        column:
          anyOf:
            - type: string
            - type: 'null'
          title: Column
        note:
          type: string
          maxLength: 500
          title: Note
          default: ''
      additionalProperties: false
      type: object
      required:
        - concept
        - table
      title: OntologyMapping
      description: A concept found in a table, or in one column of it.
  securitySchemes:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          scopes: {}
          authorizationUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/auth
          tokenUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/token
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization-PSK

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.