Netter ontology-relationships API

The ontology-relationships API from Netter — 3 operation(s) for ontology-relationships.

OpenAPI Specification

netter-ontology-relationships-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: DMI Backend actions ontology-relationships API
  version: 0.1.0
tags:
- name: ontology-relationships
paths:
  /api/v1/ontology/relationships:
    get:
      tags:
      - ontology-relationships
      summary: List Relationships
      description: List all relationships for the company.
      operationId: list_relationships_api_v1_ontology_relationships_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/RelationshipRead'
                type: array
                title: Response List Relationships Api V1 Ontology Relationships Get
    post:
      tags:
      - ontology-relationships
      summary: Create Relationship
      description: Manually create a relationship (and its inverse). Requires admin/owner.
      operationId: create_relationship_api_v1_ontology_relationships_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RelationshipCreate'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RelationshipRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/ontology/entities/{entity_id}/relationships:
    get:
      tags:
      - ontology-relationships
      summary: List Entity Relationships
      description: List relationships for one entity (both directions).
      operationId: list_entity_relationships_api_v1_ontology_entities__entity_id__relationships_get
      parameters:
      - name: entity_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Entity Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RelationshipRead'
                title: Response List Entity Relationships Api V1 Ontology Entities  Entity Id  Relationships Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/ontology/relationships/{relationship_id}:
    patch:
      tags:
      - ontology-relationships
      summary: Update Relationship
      description: Update relationship name, type, or description. Requires admin/owner.
      operationId: update_relationship_api_v1_ontology_relationships__relationship_id__patch
      parameters:
      - name: relationship_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Relationship Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RelationshipUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RelationshipRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - ontology-relationships
      summary: Delete Relationship
      description: Delete a relationship and its paired inverse. Requires admin/owner.
      operationId: delete_relationship_api_v1_ontology_relationships__relationship_id__delete
      parameters:
      - name: relationship_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Relationship Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    RelationshipCreate:
      properties:
        from_entity_id:
          type: string
          format: uuid
          title: From Entity Id
        to_entity_id:
          type: string
          format: uuid
          title: To Entity Id
        name:
          type: string
          title: Name
        relationship_type:
          type: string
          title: Relationship Type
        cardinality:
          type: string
          title: Cardinality
        from_key:
          type: string
          title: From Key
        to_key:
          type: string
          title: To Key
        description:
          type: string
          title: Description
          default: ''
      type: object
      required:
      - from_entity_id
      - to_entity_id
      - name
      - relationship_type
      - cardinality
      - from_key
      - to_key
      title: RelationshipCreate
      description: Input for POST /ontology/relationships.
    RelationshipUpdate:
      properties:
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        relationship_type:
          anyOf:
          - type: string
          - type: 'null'
          title: Relationship Type
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
      type: object
      title: RelationshipUpdate
      description: Input for PATCH /ontology/relationships/{id}.
    RelationshipRead:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        company_id:
          type: string
          format: uuid
          title: Company Id
        from_entity_id:
          type: string
          format: uuid
          title: From Entity Id
        from_entity_name:
          type: string
          title: From Entity Name
          default: ''
        to_entity_id:
          type: string
          format: uuid
          title: To Entity Id
        to_entity_name:
          type: string
          title: To Entity Name
          default: ''
        name:
          type: string
          title: Name
        relationship_type:
          type: string
          title: Relationship Type
        cardinality:
          type: string
          title: Cardinality
        from_key:
          type: string
          title: From Key
        to_key:
          type: string
          title: To Key
        description:
          type: string
          title: Description
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
      - id
      - company_id
      - from_entity_id
      - to_entity_id
      - name
      - relationship_type
      - cardinality
      - from_key
      - to_key
      - description
      - created_at
      - updated_at
      title: RelationshipRead
      description: Full relationship for GET endpoints.