openapi: 3.0.3
info:
  version: '4.0'
  title: Laces Data Platform API
  contact:
    name: Semmtech B.V.
servers:
  - url: "https://hub.laces.tech"
    description: Laces Data Platform
tags:
  - name: Groups
    description: CRUD operations for Group
  - name: Repositories
    description: CRUD operations for Repository
  - name: Publications
    description: CRUD operations for Publication
  - name: Files
    description: CRUD operations for File
  - name: Licences
    description: CRUD operations for Licences
paths:
  /api/v4/groups:
    get:
      tags:
        - Groups
      summary: "Get top level groups"
      description: "**Get all top level groups that the provided access token has access to**"
      operationId: "getTopGroups"
      parameters:
        - in: query
          name: page
          required: false
          schema:
            type: integer
            format: int64
            minimum: 0
            default: 0
            example: 5
          description: "Specifies which page of results to return"
        - in: query
          name: pageSize
          required: false
          schema:
            type: integer
            format: int64
            minimum: 1
            maximum: 100
            default: 10
            example: 20
          description: "The page size determines the number of groups displayed per page"
        - in: query
          name: searchText
          required: false
          schema:
            type: string
          description: "Search groups by name or description"
        - in: query
          name: sortBy
          required: false
          schema:
            type: string
            enum:
              - name
              - description
              - createdOn
              - modifiedOn
            default: "name"
          description: "Sort groups by name, description, createdOn, modifiedOn"
          example: "name"
        - in: query
          name: sortDirection
          required: false
          schema:
            type: string
            enum:
              - ASC
              - DESC
            default: ASC
          description: "Sort direction can be either ASC or DESC"
      responses:
        '200':
          description: "The successful retrieval of groups accessible to the token"
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PaginatedGroups'
        '400':
          description: "The request could not be processed due to one or more invalid parameters. This error occurs when the provided parameter, such as the sort by parameter, are invalid or not supported by the API. Please review and ensure that the parameters are correctly formatted and comply with the API documentation."
        '401':
          description: "No valid authorization provided"
        '403':
          description: "The access token lacks the required permissions to access the repository, resulting in the failure of the request."
    post:
      tags:
        - Groups
      summary: "Create a top group"
      description: "**Create a top-level group**"
      operationId: "createTopGroup"
      requestBody:
        description: JSON object
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GroupCreate'
      responses:
        '201':
          description: "The process of creating the group has been completed with success."
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Group'
        '401':
          description: "Indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource."
        '403':
          description: "The access token lacks the required permissions to access the repository, resulting in the failure of the request."
        '422':
          description: "The request has failed because the required properties 'name', 'pathSegment', and 'type' have not been specified. These fields are mandatory and must be provided in order to complete the request."
  /api/v4/groups/{id}:
    get:
      tags:
        - Groups
      summary: "Get group details"
      description: "**Get the details of one group**"
      operationId: "getGroup"
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            example: "26a0bac8-5c37-4c54-b3b1-1ad4551db060"
      responses:
        '200':
          description: "The successful retrieval of the requested group"
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Group'
        '401':
          description: "Indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource."
        '403':
          description: "Indicates the client is not authorized to access the requested parent group for subgroup creation."
        '404':
          description: "No group could be found by the provided id."
    post:
      tags:
        - Groups
      summary: "Create a subgroup"
      description: "**Create a subgroup of the group id provided**"
      operationId: "createSubGroup"
      parameters:
        - name: id
          in: path
          required: true
          description: 'Id of the parent group under which the subgroup will be created'
          schema:
            type: string
            example: "26a0bac8-5c37-4c54-b3b1-1ad4551db060"
      requestBody:
        description: JSON object
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GroupCreate'
      responses:
        '201':
          description: "The process of creating the group has been completed with success."
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Group'
        '401':
          description: "Indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource."
        '403':
          description: "Indicates the client is not authorized to access the requested parent group for subgroup creation."
        '404':
          description: "No group could be found with the provided id."
        '422':
          description: "The request has failed because the required properties 'name', 'pathSegment', and 'type' have not been specified. These fields are mandatory and must be provided in order to complete the request."
    patch:
      tags:
        - Groups
      summary: "Update individual fields of a group"
      description: "**Update fields of the group with the fields that are provided in the request body**"
      operationId: "partiallyUpdateGroup"
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            example: "26a0bac8-5c37-4c54-b3b1-1ad4551db060"
      requestBody:
        description: JSON object
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GroupUpdate'
      responses:
        '200':
          description: "The process of updating the group has been completed with success."
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Group'
        '401':
          description: "Indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource."
        '403':
          description: "Indicates the client is not authorized to access the requested group for updating."
        '404':
          description: "No group could be found with the provided id."
    delete:
      tags:
        - Groups
      summary: "Delete the group"
      description: "**Delete the group with the provided id**"
      operationId: "deleteGroup"
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            example: "26a0bac8-5c37-4c54-b3b1-1ad4551db060"
      responses:
        '204':
          description: "The process of deleting the group has been completed with success."
        '401':
          description: "Indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource."
        '403':
          description: "Indicates the client is not authorized to delete the group."
        '404':
          description: "No group could be found with the provided id."
  /api/v4/groups/{id}/subgroups:
    get:
      tags:
        - Groups
      summary: "Get subgroups"
      description: "**Get all subgroups of the provided group that the token has access to**"
      operationId: "getSubGroups"
      parameters:
        - name: id
          in: path
          required: true
          description: 'Id of the parent group for which the subgroups will be retrieved'
          schema:
            type: string
            example: "26a0bac8-5c37-4c54-b3b1-1ad4551db060"
        - in: query
          name: page
          required: false
          schema:
            type: integer
            format: int64
            minimum: 0
            default: 0
            example: 5
          description: "Specifies which page of results to return to the user"
        - in: query
          name: pageSize
          required: false
          schema:
            type: integer
            format: int64
            minimum: 1
            maximum: 100
            default: 10
            example: 20
          description: "The page size determines the number of groups displayed per page of results"
        - in: query
          name: searchText
          required: false
          schema:
            type: string
          description: "Search group by name or description"
        - in: query
          name: sortBy
          required: false
          schema:
            type: string
            default: "name"
            enum:
              - name
              - description
              - createdOn
              - modifiedOn
          description: "Sort group by name, description, createdOn, modifiedOn"
          example: "name"
        - in: query
          name: sortDirection
          required: false
          schema:
            type: string
            enum:
              - ASC
              - DESC
            default: ASC
          description: "Sort direction can be either ASC or DESC"
      responses:
        '200':
          description: "The successful retrieval of groups accessible to the token"
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PaginatedGroups'
        '401':
          description: "Indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource."
        '403':
          description: "Indicates the client is not authorized to access the group."
        '404':
          description: "No group could be found with the provided id."
  /api/v4/repositories:
    get:
      tags:
        - Repositories
      summary: "Get repositories"
      description: "**Get all repositories that user has access to**"
      operationId: "getAll"
      parameters:
        - in: query
          name: groupId
          required: false
          schema:
            type: string
          description: "Group id where repository is located"
          example: "67193215-bc14-43d9-a646-14ac95c089f6"
        - in: query
          name: searchText
          required: false
          schema:
            type: string
          description: "Search repository by name or description"
        - in: query
          name: sortBy
          required: false
          schema:
            type: string
          description: "Sort repository by name, description, createdOn, modifiedOn"
          example: "name"
        - in: query
          name: sortDirection
          required: false
          schema:
            type: string
            enum:
              - ASC
              - DESC
            default: ASC
          description: "Sort direction can be either ASC or DESC"
        - in: query
          name: page
          required: false
          schema:
            type: integer
            format: int64
          description: "Specifies which page of results to return to the user"
        - in: query
          name: pageSize
          required: false
          schema:
            type: integer
            format: int64
            minimum: 1
            maximum: 100
            example: 1
          description: "The page size determines the number of repositories displayed per page"
      responses:
        '200':
          description: "The successful retrieval of repositories accessible to the user"
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PaginatedRepositories'
    post:
      tags:
        - Repositories
      summary: Create a repository
      description: "**Create a repository**"
      operationId: createRepository
      requestBody:
        description: JSON object
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/Repository'
                - type: object
                  required:
                    - name
                    - pathSegment
                    - parentId
      responses:
        '201':
          description: The process of creating the repository has been completed with success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Repository'
        '401':
          description: "No valid authorization provided"
        '403':
          description: "The access token lacks the required permissions to access the repository, resulting in the failure of the request."
        '404':
          description: "This status code indicates that the requested file ID could not be found"
        '422':
          description: "The request has failed because the required properties 'name', 'pathSegment', and 'parentId' have not been specified. These fields are mandatory and must be provided in order to complete the request."

  /api/v4/repositories/{id}:
    get:
      tags:
        - Repositories
      summary: "Get repository"
      description: "**Get repository by id that user has access to**"
      operationId: "getOne"
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          description: "Repository id"
          example: "611d6734-f3b0-4eb3-80ee-37bec7348bf2"
      responses:
        '200':
          description: "The successful retrieval of repository accessible to the user"
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Repository'
        '400':
          description: "The request has failed because the required properties 'id' have not been specified. The id is mandatory and must be provided in order to complete the request."
        '401':
          description: "No valid authorization provided"
        '403':
          description: "The access token lacks the required permissions to access the repository, resulting in the failure of the request."
        '404':
          description: "This status code indicates that the requested file ID could not be found"
    patch:
      tags:
        - Repositories
      summary: Partially update a repository
      description: "**Partially update current repository**"
      operationId: updateRepository
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        description: JSON object
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/Repository'
                - type: object
                  properties:
                    pathSegment:
                      readOnly: true
                    parentId:
                      readOnly: true

      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Repository'
        '401':
          description: "No valid authorization provided"
        '403':
          description: "The access token lacks the required permissions to access the repository, resulting in the failure of the request."
        '404':
          description: "This status code indicates that the requested file ID could not be found"
        '422':
          description: "The request has failed because the properties 'pathSegment', or 'public' have been specified. These fields can't be used in order to complete the request."
    delete:
      tags:
        - Repositories
      summary: "Remove the repository based on its ID."
      description: "**Delete repository file using its unique identifier.**"
      operationId: deleteRepository
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: "Provide the ID of the repository to be updated with new content."
            example: "5e6bfcc6-eda9-11ed-a05b-0242ac120003"
      responses:
        '204':
          description: successful operation
        '401':
          description: "No valid authorization provided"
        '403':
          description: "The access token lacks the required permissions to access the repository, resulting in the failure of the request."
        '404':
          description: "This status code indicates that the requested file ID could not be found"
  /api/v4/publications:
    get:
      tags:
        - Publications
      summary: Get publication metadata for publications
      description: >-
        **Get publication metadata for all publications, or all publications
        in the repository in case a repository id is provided**
      operationId: getAllPublications
      parameters:
        - name: groupIds
          in: query
          schema:
            type: array
            items:
              type: string
              example: "67193215-bc14-43d9-a646-14ac95c089f6"
        - name: repositoryId
          in: query
          schema:
            type: string
          example: "67193215-bc14-43d9-a646-14ac95c089f6"
        - name: latestVersionsOnly
          in: query
          schema:
            type: boolean
          example: false
          description: "If true, only the latest version of each publication is returned"
        - name: searchText
          in: query
          schema:
            type: string
          example: "anything"
        - name: sortBy
          in: query
          schema:
            type: string
            enum:
              - name
              - description
              - uri
              - publicationDate
          description: "Sort publication by name, description, uri, publicationDate"
        - name: sortDirection
          in: query
          schema:
            type: string
            enum:
              - ASC
              - DESC
            example: DESC
        - name: page
          in: query
          schema:
            minimum: 0
            type: integer
            format: int32
          example: 1
          description: "Page number, zero based"
        - name: pageSize
          in: query
          schema:
            maximum: 100
            minimum: 1
            type: integer
            format: int32
          example: 10
          description: "Number of publications per page of results"
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedPublications'
        '400':
          description: The request has failed due to bad syntax, please check the request parameters.
        '401':
          description: The client request has not been completed because it lacks valid authentication credentials for the requested resource.
        '403':
          description: The client is not authorized to access the requested resource.
    post:
      tags:
        - Publications
      summary: Create publication
      description: "**Create a new publication with the provided metadata and RDF content** \n\n For an example of what fields to provide for the `metadata` request part, see the `PublicationCreate` schema in the *Schemas* section below."
      operationId: createPublication
      parameters:
        - name: repositoryId
          in: query
          required: true
          schema:
            type: string
          example: "67193215-bc14-43d9-a646-14ac95c089f6"
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - content
                - metadata
              properties:
                metadata:
                  $ref: '#/components/schemas/PublicationCreate'
                content:
                  type: string
                  format: binary
            encoding:
              file:
                contentType: text/turtle, application/x-turtle, application/rdf+xml, application/n-triples, application/ld+json
        required: true
      responses:
        '201':
          description: Successful operation, created a publication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Publication'
        '400':
          description: The request could not be processed due to a client error. This can occur if the request payload is malformed, missing required attributes, or contains invalid data that does not comply with the expected format.
        '401':
          description: The client request has not been completed because it lacks valid authentication credentials for the requested resource.
        '403':
          description: The client is not authorized to access the requested resource.
        '404':
          description: The requested resource could not be found. Possibly a repository with given id does not exist.
        '422':
          description: The request has failed due to validation errors.
  /api/v4/publications/async:
    post:
      tags:
        - Publications
      summary: Create publication asynchronously
      description: "**Asynchronously create a new publication with the provided metadata and RDF content** \n\n For an example of what fields to provide for the `metadata` request part, see the `PublicationCreate` schema in the *Schemas* section below."
      operationId: createPublicationAsync
      parameters:
        - name: repositoryId
          in: query
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - content
                - metadata
              properties:
                metadata:
                  $ref: '#/components/schemas/PublicationCreate'
                content:
                  type: string
                  format: binary
            encoding:
              file:
                contentType: text/turtle, application/x-turtle, application/rdf+xml, application/n-triples, application/ld+json
        required: true
      responses:
        '201':
          description: Successful operation, created a publication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Publication'
        '400':
          description: The request could not be processed due to a client error. This can occur if the request payload is malformed, missing required attributes, or contains invalid data that does not comply with the expected format.
        '401':
          description: The client request has not been completed because it lacks valid authentication credentials for the requested resource.
        '403':
          description: The client is not authorized to access the requested resource.
        '404':
          description: The requested resource could not be found. Possibly a repository with given id does not exist.
        '422':
          description: The request has failed due to validation errors.
  /api/v4/publications/{id}:
    get:
      tags:
        - Publications
      summary: Get publication metadata
      description: "**Get publication metadata**"
      operationId: getPublication
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Publication'
        '401':
          description: The client request has not been completed because it lacks valid authentication credentials for the requested resource.
        '403':
          description: The client is not authorized to access the requested resource.
        '404':
          description: Publication not found
    delete:
      tags:
        - Publications
      summary: Delete publication
      description: "**Delete publication**"
      operationId: deletePublication
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '204':
          description: successful operation
          content: { }
        '401':
          description: The client request has not been completed because it lacks valid authentication credentials for the requested resource.
        '403':
          description: The client is not authorized to access the requested resource.
    patch:
      tags:
        - Publications
      summary: Partially update publication metadata
      description: "**Partially update publication metadata**"
      operationId: updatePublicationMetadata
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          example: "67193215-bc14-43d9-a646-14ac95c089f6"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicationUpdate'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Publication'
        '401':
          description: The client request has not been completed because it lacks valid authentication credentials for the requested resource.
        '403':
          description: The client is not authorized to access the requested resource.
        '404':
          description: Publication not found
        '422':
          description: The request has failed due to validation errors.
  /api/v4/publications/{id}/sparql:
    get:
      tags:
        - Publications
      summary: Query publication with GET Request
      description: |
        **Query publication with a GET request.**

        **Format Support:**
        - SELECT queries return tabular data and support formats like: application/json, text/csv, application/sparql-results+json, application/sparql-results+xml, text/tab-separated-values, application/xml, text/xml, application/xhtml+xml, text/html, text/plain
        - CONSTRUCT queries return RDF graphs and support formats like: text/turtle, application/rdf+xml, application/ld+json, application/n-triples, application/n-quads, application/trig, application/x-turtle, application/rdf+json, text/n3, application/x-trig, text/rdf+n3, application/x-trigstar, application/trix, text/x-turtlestar, application/x-turtlestar, application/vnd.hdt, application/x-ld+ndjson, text/x-nquads, text/nquads
      operationId: queryPublicationGet
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          example: "67193215-bc14-43d9-a646-14ac95c089f6"
        - name: query
          in: query
          required: true
          schema:
            type: string
          example: SELECT%20%3Fs%20%3Fp%20%3Fo%20WHERE%20%7B%20%3Fs%20%3Fp%20%3Fo%20.%20%7D%20LIMIT%2010
        - name: default-graph-uri
          in: query
          description: >-
            Any (additional) publications/datasets that should be added as
            default graph
          schema:
            $ref: '#/components/schemas/GraphUri'
        - name: named-graph-uri
          in: query
          description: Named graphs that should be queried
          style: form
          explode: true
          schema:
            $ref: '#/components/schemas/GraphUri'
        - name: Accept
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: string
            text/csv:
              schema:
                type: string
            application/sparql-results+json:
              schema:
                type: string
            application/sparql-results+xml:
              schema:
                type: string
            text/tab-separated-values:
              schema:
                type: string
            application/xml:
              schema:
                type: string
            application/n-quads:
              schema:
                type: string
            application/ld+json:
              schema:
                type: string
            application/vnd.hdt:
              schema:
                type: string
            text/turtle:
              schema:
                type: string
            application/xhtml+xml:
              schema:
                type: string
            application/rdf+json:
              schema:
                type: string
            text/n3:
              schema:
                type: string
            application/trig:
              schema:
                type: string
            application/n-triples:
              schema:
                type: string
            text/plain:
              schema:
                type: string
            text/x-nquads:
              schema:
                type: string
            text/nquads:
              schema:
                type: string
            application/x-turtle:
              schema:
                type: string
            application/x-ld+ndjson:
              schema:
                type: string
            application/x-trig:
              schema:
                type: string
            application/rdf+xml:
              schema:
                type: string
            text/xml:
              schema:
                type: string
            application/html:
              schema:
                type: string
            text/rdf+n3:
              schema:
                type: string
            application/x-trigstar:
              schema:
                type: string
            application/trix:
              schema:
                type: string
            text/html:
              schema:
                type: string
            text/x-turtlestar:
              schema:
                type: string
            application/x-turtlestar:
              schema:
                type: string
        '401':
          description: The client request has not been completed because it lacks valid authentication credentials for the requested resource.
        '403':
          description: The client is not authorized to access the requested resource.
        '404':
          description: Publication not found
    post:
      tags:
        - Publications
      operationId: queryPublicationPost
      summary: Query Publication with POST Request
      description: |
        **Query publication with a POST request, either direct or via URL-encoded POST**<br />
        (see <a href="https://www.w3.org/TR/sparql11-protocol/#query-operation">https://www.w3.org/TR/sparql11-protocol/#query-operation</a>).

        **Format Support:**
        - SELECT queries return tabular data and support formats like: application/json, text/csv, application/sparql-results+json, application/sparql-results+xml, text/tab-separated-values, application/xml, text/xml, application/xhtml+xml, text/html, text/plain
        - CONSTRUCT queries return RDF graphs and support formats like: text/turtle, application/rdf+xml, application/ld+json, application/n-triples, application/n-quads, application/trig, application/x-turtle, application/rdf+json, text/n3, application/x-trig, text/rdf+n3, application/x-trigstar, application/trix, text/x-turtlestar, application/x-turtlestar, application/vnd.hdt, application/x-ld+ndjson, text/x-nquads, text/nquads
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: Accept
          in: header
          required: true
          schema:
            type: string
        - name: default-graph-uri
          in: query
          description: >-
            Any (additional) publications/datasets that should be added as
            default graph. **NB: only for a direct POST, not for URL-encoded POST**
          schema:
            $ref: '#/components/schemas/GraphUri'
        - name: named-graph-uri
          in: query
          description: >-
            Named graphs that should be queried. **NB: only for a direct POST, not for URL-encoded POST**
          schema:
            $ref: '#/components/schemas/GraphUri'
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                query:
                  type: string
                  example: SELECT%20%3Fs%20%3Fp%20%3Fo%20WHERE%20%7B%20%3Fs%20%3Fp%20%3Fo%20.%20%7D%20LIMIT%2010
                default-graph-uri:
                  type: array
                  items:
                    type: string
                    example: http%3A%2F%2Fwww.example.org%2Fex
                named-graph-uri:
                  type: array
                  items:
                    type: string
                    example: http%3A%2F%2Fwww.example.org%2Fex
              required:
                - query
          application/sparql-query:
            schema:
              type: string
              example: SELECT ?s ?p ?o WHERE { ?s ?p ?o . } LIMIT 10
        required: true
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: string
            text/csv:
              schema:
                type: string
            application/sparql-results+json:
              schema:
                type: string
            application/sparql-results+xml:
              schema:
                type: string
            text/tab-separated-values:
              schema:
                type: string
            application/xml:
              schema:
                type: string
            application/n-quads:
              schema:
                type: string
            application/ld+json:
              schema:
                type: string
            application/vnd.hdt:
              schema:
                type: string
            text/turtle:
              schema:
                type: string
            application/xhtml+xml:
              schema:
                type: string
            application/rdf+json:
              schema:
                type: string
            text/n3:
              schema:
                type: string
            application/trig:
              schema:
                type: string
            application/n-triples:
              schema:
                type: string
            text/plain:
              schema:
                type: string
            text/x-nquads:
              schema:
                type: string
            text/nquads:
              schema:
                type: string
            application/x-turtle:
              schema:
                type: string
            application/x-ld+ndjson:
              schema:
                type: string
            application/x-trig:
              schema:
                type: string
            application/rdf+xml:
              schema:
                type: string
            text/xml:
              schema:
                type: string
            application/html:
              schema:
                type: string
            text/rdf+n3:
              schema:
                type: string
            application/x-trigstar:
              schema:
                type: string
            application/trix:
              schema:
                type: string
            text/html:
              schema:
                type: string
            text/x-turtlestar:
              schema:
                type: string
            application/x-turtlestar:
              schema:
                type: string
        '401':
          description: The client request has not been completed because it lacks valid authentication credentials for the requested resource.
        '403':
          description: The client is not authorized to access the requested resource.
        '404':
          description: Publication not found
  /api/v4/publications/{id}/statements:
    get:
      tags:
        - Publications
      summary: Get publication content
      description: "**Get publication content**"
      operationId: getPublicationContent
      parameters:
        - name: Accept
          in: header
          schema:
            type: string
            enum:
              - text/turtle
              - application/x-turtle
              - application/rdf+xml
              - application/n-triples
              - application/ld+json
        - name: id
          in: path
          required: true
          schema:
            type: string
          example: "67193215-bc14-43d9-a646-14ac95c089f6"
      responses:
        '200':
          description: successful operation
          content:
            text/turtle:
              schema:
                type: string
            application/x-turtle:
              schema:
                type: string
            application/rdf+xml:
              schema:
                type: string
            application/n-triples:
              schema:
                type: string
            application/ld+json:
              schema:
                type: string
        '401':
          description: The client request has not been completed because it lacks valid authentication credentials for the requested resource.
        '403':
          description: The client is not authorized to access the requested resource.
        '404':
          description: Publication not found
    patch:
      tags:
        - Publications
      summary: Replace publication content
      description: "**Replace publication content**"
      operationId: replacePublicationContent
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          example: "67193215-bc14-43d9-a646-14ac95c089f6"
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - content
                - publisher
              properties:
                publisher:
                  type: string
                  example: "Hannah Smith"
                content:
                  type: string
                  format: binary
            encoding:
              file:
                contentType: text/turtle, application/x-turtle, application/rdf+xml, application/n-triples, application/ld+json
        required: true
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Publication'
        '401':
          description: The client request has not been completed because it lacks valid authentication credentials for the requested resource.
        '403':
          description: The client is not authorized to access the requested resource.
        '404':
          description: Publication not found
  /api/v4/publications/{id}/statements/async:
    patch:
      tags:
        - Publications
      summary: Replace publication content
      description: "**Replace publication content**"
      operationId: replacePublicationContentAsync
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          example: "67193215-bc14-43d9-a646-14ac95c089f6"
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - content
                - publisher
              properties:
                publisher:
                  type: string
                  example: "Hannah Smith"
                content:
                  type: string
                  format: binary
            encoding:
              file:
                contentType: text/turtle, application/x-turtle, application/rdf+xml, application/n-triples, application/ld+json
        required: true
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Publication'
        '401':
          description: The client request has not been completed because it lacks valid authentication credentials for the requested resource.
        '403':
          description: The client is not authorized to access the requested resource.
        '404':
          description: Publication not found
  /api/v4/publications/{id}/versions:
    get:
      tags:
        - Publications
      summary: Get publication metadata for all versions
      description: "**Get publication metadata for all versions**"
      operationId: getPublicationVersions
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          example: "67193215-bc14-43d9-a646-14ac95c089f6"
        - name: sortBy
          in: query
          schema:
            type: string
            enum:
              - uri
              - publicationDate
          description: "Sort publication by uri, publicationDate"
        - name: sortDirection
          in: query
          schema:
            type: string
            enum:
              - ASC
              - DESC
            example: DESC
        - name: page
          in: query
          schema:
            minimum: 0
            type: integer
            format: int32
          example: 1
          description: "Page number, zero based"
        - name: pageSize
          in: query
          schema:
            maximum: 100
            minimum: 1
            type: integer
            format: int32
          example: 10
          description: "Number of search results per page"
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedPublications'
        '400':
          description: Unable to retrieve version from non-versioned publication
        '401':
          description: The client request has not been completed because it lacks valid authentication credentials for the requested resource.
        '403':
          description: The client is not authorized to access the requested resource.
        '404':
          description: Publication not found
  /api/v4/publications/{id}/asyncstatements:
    get:
      tags:
        - Publications
      summary: Initiate asynchronous download of publication content
      description: "**Initiates an asynchronous download of the content of a specific publication based on the specified download type.**"
      operationId: initiateAsyncDownload
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Unique identifier of the publication
        - name: downloadType
          in: header
          required: true
          schema:
            type: string
            enum:
              - text/turtle
              - application/x-turtle
              - application/rdf+xml
              - application/n-triples
              - application/ld+json
          description: Specifies the content format for download.
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DownloadInitiationResponse'
        '400':
          description: >
            The request could not be processed due to a client error. This can occur if the request
            payload is malformed, required attributes are missing, or contains invalid data that does
            not comply with the expected format. For example, if the required header 'downloadType' is not
            present, this error will be returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: "Required header 'downloadType' is not present."
        '401':
          description: The client request has not been completed because it lacks valid authentication credentials for the requested resource.
        '403':
          description: The client is not authorized to access the requested resource.
        '404':
          description: Publication not found
        '415':
          description: >
            The server is refusing to accept the request because the payload is in an unsupported format.
            This status is typically returned when the 'DownloadType' header specifies a media type that is not supported
            for the requested resource, such as 'text/html' when expecting specific RDF media types.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: "Unsupported media type: text/html"
  /api/v4/publications/delta:
    get:
      tags:
        - Publications
      summary: Delta between two publications
      description: "**The delta between the publication versions in the specified format.**"
      operationId: findDeltaForPublicationVersions
      parameters:
        - name: Accept
          in: header
          schema:
            type: string
            enum:
              - application/n-quads
              - application/trig
          required: true
          description: The desired response format. Choose between 'application/n-quads' and 'application/trig'.
        - name: version1
          in: query
          schema:
            type: string
          example: "4abb0115-cebd-4a88-afb8-f11a3ce6507b"
          description: "Publication ID for Version 1"
        - name: version2
          in: query
          schema:
            type: string
          example: "dcc5521f-4c2e-47a4-a61a-370f0595f245"
          description: "Publication ID for Version 2"
      responses:
        '200':
          description: successful operation
          content:
            application/n-quads:
              schema:
                type: string
              example: "n-quads content goes here..."
            application/trig:
              schema:
                type: string
              example: "trig content goes here..."
        '400':
          description: Required request parameter 'version1/2' for method parameter type String is not present
        '401':
          description: The client request has not been completed because it lacks valid authentication credentials for the requested resource.
        '403':
          description: The client is not authorized to access the requested resource.
        '404':
          description: A publication ID could not be located.
  /api/v4/files:
    get:
      tags:
        - Files
      summary: "Get metadata of all files in a repository."
      description: "**Retrieve the metadata for every file in a repository by specifying the repository identifier.**"
      operationId: "getAllFiles"
      parameters:
        - in: query
          name: repositoryId
          required: true
          schema:
            type: string
          description: "Repository id where files are located"
          example: "67193215-bc14-43d9-a646-14ac95c089f6"
        - $ref: '#/components/parameters/searchTextParam'
        - $ref: '#/components/parameters/sortByParam'
        - $ref: '#/components/parameters/sortDirectionParam'
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/pageSizeParam'
      responses:
        '200':
          description: "The successful retrieval of files accessible to the user"
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PaginatedFiles'
        '400':
          description: "The request could not be processed due to one or more invalid parameters. This error occurs when the provided parameter, such as the sort by parameter, are invalid or not supported by the API. Please review and ensure that the parameters are correctly formatted and comply with the API documentation."
        '401':
          description: "No valid authorization provided"
        '403':
          description: "The access token lacks the required permissions to access the repository, resulting in the failure of the request."
    post:
      tags:
        - Files
      summary: "Upload a file and add it to a specified repository."
      description: "**Create a new file with the provided metadata and file content** \n\n For an example of what fields to provide for the `fileMetadata` request part, see the `FileCreate` schema in the *Schemas* section below."
      operationId: addFile
      parameters:
        - in: query
          name: repositoryId
          required: true
          schema:
            type: string
            description: "Repository ID where files will be located"
            example: "67193215-bc14-43d9-a646-14ac95c089f6"
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - fileMetadata
                - content
              properties:
                fileMetadata:
                  $ref: "#/components/schemas/FileCreate"
                content:
                  format: binary
                  type: string
        required: true
      responses:
        '201':
          description: File created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileCreate'
        '400':
          description: "The request could not be processed due to one or more invalid parameters. This error occurs when the provided parameter, such as the sort by parameter, are invalid or not supported by the API. Please review and ensure that the parameters are correctly formatted and comply with the API documentation."
        '401':
          description: "No valid authorization provided"
        '403':
          description: "The access token lacks the required permissions to access the repository, resulting in the failure of the request."
  /api/v4/files/async:
    post:
      tags:
        - Files
      summary: Upload a file asynchronously and add it to a specified repository.
      description: "**Asynchronously create a new file with the provided metadata and file content** \n\n For an example of what fields to provide for the `fileMetadata` request part, see the `FileCreate` schema in the *Schemas* section below."
      operationId: addFileAsync

      parameters:
        - in: query
          name: repositoryId
          required: true
          schema:
            type: string
            description: "Repository ID where files will be located"
            example: "67193215-bc14-43d9-a646-14ac95c089f6"
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - fileMetadata
                - content
              properties:
                fileMetadata:
                  $ref: "#/components/schemas/FileCreate"
                content:
                  format: binary
                  type: string
        required: true
      responses:
        '201':
          description: File created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileCreate'
        '400':
          description: "The request could not be processed due to one or more invalid parameters. This error occurs when the provided parameter, such as the sort by parameter, are invalid or not supported by the API. Please review and ensure that the parameters are correctly formatted and comply with the API documentation."
        '401':
          description: "No valid authorization provided"
        '403':
          description: "The access token lacks the required permissions to access the repository, resulting in the failure of the request."
  /api/v4/files/{id}:
    get:
      tags:
        - Files
      summary: "Get metadata of a file."
      description: "**Obtain the metadata for a file by providing the file identifier.**"
      operationId: "getFile"
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          description: "File id where files are located"
          example: "67193215-bc14-43d9-a646-14ac95c089f6"
      responses:
        '200':
          description: "The successful retrieval of file accessible to the user"
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/File'
        '400':
          description: "The request could not be processed due to one or more invalid parameters. This error occurs when the provided parameter, such as the sort by parameter, are invalid or not supported by the API. Please review and ensure that the parameters are correctly formatted and comply with the API documentation."
        '401':
          description: "No valid authorization provided"
        '403':
          description: "The access token lacks the required permissions to access the repository, resulting in the failure of the request."
        '404':
          description: "This status code indicates that the requested file ID could not be found"
    put:
      tags:
        - Files
      summary: "Replace content of an unversioned file using its unique identifier."
      description: "**Update the content of an unversioned file.**"
      operationId: updateFileContent
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: "Provide the ID of the file to be updated with new content."
            example: "5e6bfcc6-eda9-11ed-a05b-0242ac120003"
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                content:
                  format: binary
                  type: string
        required: true
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/File'
        '401':
          description: "No valid authorization provided"
        '403':
          description: "The access token lacks the required permissions to access the repository, resulting in the failure of the request."
        '404':
          description: "This status code indicates that the requested file ID could not be found"
    delete:
      tags:
        - Files
      summary: "Remove the file based on its ID."
      description: "**Delete the file using its unique identifier.**"
      operationId: deleteFile
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: "The ID of the file to be deleted."
            example: "5e6bfcc6-eda9-11ed-a05b-0242ac120003"
      responses:
        '204':
          description: successful operation
        '401':
          description: "No valid authorization provided"
        '403':
          description: "The access token lacks the required permissions to access the repository, resulting in the failure of the request."
        '404':
          description: "This status code indicates that the requested file ID could not be found"
  /api/v4/files/{id}/async:
    put:
      tags:
        - Files
      summary: Replace content of unversioned file asynchronously using its unique identifier.
      description: >-
        **Update the content of an unversioned file asynchronously.**<br /><br />
        To see the status of the upload perform a GET request on /api/v4/files/{id}.
      operationId: updateFileContentAsync
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: "The ID of the file to be updated with new content."
            example: "5e6bfcc6-eda9-11ed-a05b-0242ac120003"
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                content:
                  format: binary
                  type: string
        required: true
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/File'
        '401':
          description: "No valid authorization provided"
        '403':
          description: "The access token lacks the required permissions to access the repository, resulting in the failure of the request."
        '404':
          description: "This status code indicates that the requested file ID could not be found"
  /api/v4/files/{id}/versions:
    get:
      tags:
        - Files
      summary: "Get metadata of all verions of a file."
      description: "**Retrieves the metadata for all versions of a file by providing the file identifier.**"
      operationId: "getAllVersions"
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          description: "File ID of a specific version of the file"
          example: "67193215-bc14-43d9-a646-14ac95c089f6"
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/pageSizeParam'
      responses:
        '200':
          description: "The successful retrieval of files accessible to the user"
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PaginatedFiles'
        '401':
          description: "No valid authorization provided"
        '403':
          description: "The access token lacks the required permissions to access the repository, resulting in the failure of the request."
        '404':
          description: "This status code indicates that the requested file ID could not be found"
  /api/v4/files/{id}/content:
    get:
      tags:
        - Files
      summary: "Retrieving the content of a file using its ID."
      description: "**Retrieves the content of a file using its ID. In the case of versioned files, it will return the content of the latest version available.**"
      operationId: "downloadFile"
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          description: "File id where files are located"
          example: "67193215-bc14-43d9-a646-14ac95c089f6"
      responses:
        '200':
          description: "File downloaded successfully"
          content:
            '*/*':
              schema:
                type: string
                format: binary
                example: "Base64-encoded string"
        '401':
          description: "No valid authorization provided"
        '403':
          description: "The access token lacks the required permissions to access the repository, resulting in the failure of the request."
        '404':
          description: "This status code indicates that the requested file ID could not be found"
  /api/v4/files/{id}/content/{version}:
    get:
      tags:
        - Files
      summary: "Retrieving the content of a file using its ID and a version."
      description: "**Retrieves the content of a file using its ID and version.**"
      operationId: "downloadFileByVersion"
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          description: "File id of a specific version of the file"
          example: "67193215-bc14-43d9-a646-14ac95c089f6"
        - in: path
          name: version
          required: true
          schema:
            type: string
          description: "Version can be of Custom, Datetime, or Incremental."
          examples:
            custom:
              value: "CV01"
            datetime:
              value: "20230508074945"
            incremental:
              value: "22"
      responses:
        '200':
          description: "File downloaded successfully"
          content:
            '*/*':
              schema:
                type: string
                format: binary
                example: "Base64-encoded string"
        '401':
          description: "No valid authorization provided"
        '403':
          description: "The access token lacks the required permissions to access the repository, resulting in the failure of the request."
        '404':
          description: "This status code indicates that the requested file ID could not be found"
  /api/v4/licences:
    get:
      tags:
        - Licences
      summary: Get licences
      description: "**Get all enabled licences for a repository**"
      operationId: getLicences
      parameters:
        - name: repositoryId
          in: query
          description: ID of the repository to return licences for
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: A list of licences
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Licence'
        '401':
          description: "Indicates that the client request has not been completed because it lacks valid authentication credentials."
        '403':
          description: "Indicates that the client request has not been completed because the authentication credentials do not give access for the requested resource."
        '404':
          description: "Indicates that no repository was found with the given id."

components:
  parameters:
    searchTextParam:
      in: query
      name: searchText
      required: false
      schema:
        type: string
      description: "Search file by name"
    sortByParam:
      in: query
      name: sortBy
      required: false
      schema:
        type: string
        enum:
          - name
          - createdOn
          - modifiedOn
      description: "Sort file by name, createdOn, modifiedOn"
      example: "name"
    sortDirectionParam:
      in: query
      name: sortDirection
      required: false
      schema:
        type: string
        enum:
          - ASC
          - DESC
        default: ASC
      description: "Sort direction can be either ASC or DESC"
    pageParam:
      in: query
      name: page
      required: false
      schema:
        type: integer
        format: int64
      description: "Specifies which page of results to return to the user"
    pageSizeParam:
      in: query
      name: pageSize
      required: false
      schema:
        type: integer
        format: int64
        minimum: 1
        maximum: 100
        example: 1
      description: "The page size determines the number of files displayed per page"
  schemas:
    GroupUpdate:
      type: object
      required:
        - name
        - type
      properties:
        type:
          type: string
          enum:
            - PRIVATE
            - PUBLIC
            - USER
        name:
          type: string
          example: 'General Suggestions'
        description:
          type: string
          example: 'lorem ipsum'
    GroupCreate:
      type: object
      required:
        - pathSegment
        - name
        - type
      properties:
        pathSegment:
          type: string
          pattern: "^([a-z0-9\\_\\-]+)$"
          example: 'general-suggestions'
        name:
          type: string
          example: 'General Suggestions'
        type:
          type: string
          enum:
            - PRIVATE
            - PUBLIC
            - USER
        description:
          type: string
          example: 'lorem ipsum'
    Group:
      type: object
      properties:
        id:
          type: string
          minLength: 36
          maxLength: 36
          readOnly: true
          example: '26a0bac8-5c37-4c54-b3b1-1ad4551db060'
        pathSegment:
          type: string
          pattern: "^([a-z0-9\\_\\-]+)$"
          example: 'general-suggestions'
        path:
          type: string
          readOnly: true
          example: 'stadion-improvements/general-suggestions'
        createdBy:
          type: string
          readOnly: true
          example: 'Cruijff14'
        createdOn:
          type: integer
          format: int64
          readOnly: true
          example: 1673971427542
          description: 'Timestamp in unix epoch format: number of seconds since 1 january 1970 (midnight UTC/GMT)'
        modifiedBy:
          type: string
          readOnly: true
          example: 'Cruijff14'
        modifiedOn:
          type: integer
          format: int64
          readOnly: true
          example: 1673971427542
          description: 'Timestamp in unix epoch format: number of seconds since 1 january 1970 (midnight UTC/GMT)'
        owner:
          type: string
          example: 'Cruijff14'
          readOnly: true
        parentId:
          type: string
          minLength: 36
          maxLength: 36
          readOnly: true
          example: '67193215-bc14-43d9-a646-14ac95c089f6'
          description: 'The id of the parent group'
        name:
          type: string
          example: 'General Suggestions'
        type:
          type: string
          enum:
            - PRIVATE
            - PUBLIC
            - USER
        description:
          type: string
          example: 'lorem ipsum'
    PaginatedGroups:
      type: object
      properties:
        content:
          type: array
          items:
            $ref: "#/components/schemas/Group"
        total:
          type: integer
          format: int32
          example: 10
          description: 'Total number of groups returned by the query'
    Role:
      type: string
      enum:
        - VIEWER
        - PUBLISHER
        - MANAGER
      example: PUBLISHER
    Repository:
      type: object
      properties:
        id:
          type: string
          minLength: 36
          maxLength: 36
          readOnly: true
          example: '26a0bac8-5c37-4c54-b3b1-1ad4551db061'
        name:
          type: string
          example: 'General Suggestions'
        description:
          type: string
          example: 'lorem ipsum'
        pathSegment:
          type: string
          pattern: "^([a-z0-9\\_\\-]+)$"
          example: 'general-suggestions'
        public:
          type: boolean
          example: false
        owner:
          type: string
          example: 'Cruijff14'
          readOnly: true
        path:
          type: string
          readOnly: true
          example: 'stadion-improvements/general-suggestions'
        parentId:
          type: string
          minLength: 36
          maxLength: 36
          example: '67193215-bc14-43d9-a646-14ac95c089f6'
        createdBy:
          type: string
          readOnly: true
          example: 'Cruijff14'
        createdOn:
          type: integer
          format: int64
          readOnly: true
          example: 1673971427542
        modifiedBy:
          type: string
          readOnly: true
          example: 'Cruijff14'
        modifiedOn:
          type: integer
          format: int64
          readOnly: true
          example: 1673971427542
        role:
          $ref: "#/components/schemas/Role"
          readOnly: true
          description: 'The Role which the requesting Access Token has on this repository'
    PaginatedRepositories:
      type: object
      properties:
        content:
          type: array
          items:
            $ref: "#/components/schemas/Repository"
        total:
          type: integer
          format: int32
          example: 10,
          description: 'Total number of repositories returned by the query'
    Url:
      type: string
      format: uri
      example: "http://www.laces.com"
    PartialURI:
      type: string
      example: "/ns/semmtech/live/laces/schema/otl-manager/"
    SchemaURIs:
      type: array
      description: 'List of URIs for schemas which are relevant for this publication'
      items:
        $ref: '#/components/schemas/Url'
    UnixTimestamp:
      type: integer
      format: int64
      description: "Unix epoch timestamp: number of seconds since 1 january 1970 00:00 UTC/GMT"
      example: 1687766202235
    VersioningMode:
      type: string
      enum:
        - UNDEFINED
        - NONE
        - TIMESTAMP
        - INCREMENTAL
        - DATE_TIME
        - CUSTOM
      example: TIMESTAMP
    InternalId:
      type: string
      format: uuid
      example: "67193215-bc14-43d9-a646-14ac95c089f6"
    Licence:
      type: object
      description: "A licence which dictates how the content of the Publication may be used"
      required:
        - name
      properties:
        name:
          type: string
          example: "MIT"
          description: "The name of the license"
        url:
          $ref: "#/components/schemas/Url"
          description: "The URL where the licence text can be found"
    GraphUri:
      type: array
      items:
        type: string
        example: http%3A%2F%2Fwww.example.org%2Fex
    PaginatedPublications:
      description: "A paginated list of publications including the total number of publications and the current page of results"
      required:
        - contents
        - total
      type: object
      properties:
        contents:
          type: array
          description: "Current page of results returned from the request"
          items:
            $ref: '#/components/schemas/Publication'
        total:
          type: integer
          description: "Total number of results which match the request"
          format: int64
    Publication:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/InternalId'
          description: "Internal ID of the Publication"
        name:
          type: string
          example: "OTL Manager Schema"
        description:
          type: string
        repositoryId:
          $ref: "#/components/schemas/InternalId"
          description: "Internal ID of the Repository which contains the Publication"
        owner:
          type: string
          description: "Name of the person or organization responsible for the content of the publication"
          example: "Semmtech"
        publisher:
          type: string
          description: "Name of the person who published the Publication"
          example: "Hannah Smith"
        publicationDate:
          $ref: '#/components/schemas/UnixTimestamp'
        uri:
          $ref: '#/components/schemas/PartialURI'
          description: "Relative uri of the Publication starting with the top group path segment"
          readOnly: true
        sequenceId:
          type: string
          format: uuid
          description: "Unique identifier which is common to all versions of a versioned publication"
        sparqlEndpoint:
          $ref: '#/components/schemas/PartialURI'
          description: "Relative uri of the Publication SPARQL query endpoint starting with the top group path segment"
          readOnly: true
        useVersionedBaseUri:
          type: boolean
          example: false
        versioningMode:
          $ref: '#/components/schemas/VersioningMode'
        licence:
          $ref: '#/components/schemas/Licence'
        schemaURIs:
          $ref: '#/components/schemas/SchemaURIs'
        pending:
          type: boolean
          readOnly: true
          example: false
        icon:
          type: string
          description: "Base 64 encoded image representing the Publication"
          example: "data:image/jpeg;base64,/9j/4R/+RXh..."
        ldvLink:
          $ref: '#/components/schemas/Url'
          description: "Linked Data Viewer Link"
        abstract:
          type: string
          example: "Repellendus nobis nesciunt. Labore explicabo quidem tempore. Voluptatibus quam velit commodi."
          description: "Abstract of the publication, a brief overview of the content. Can contain markdown."
        contributor:
          type: string
          example: "Hannah Smith"
          description: "Person who has contributed the content of the Publication"
        creator:
          type: string
          example: "smithhannah"
          description: "Username or name of the person who created the Publication by publishing it on the platform"
      additionalProperties:
        description: "Additional metadata which has been added to the Publication"
        example: 'projectTeam: {
          name: "Bridge X",
          members: ["Alice", "Bob", "Charlie"]}'
        oneOf:
          - type: string
          - type: integer
          - type: boolean
          - type: object
          - type: array
    PublicationCreate:
      type: object
      required:
        - publicationUri
        - name
        - owner
        - description
        - versioningMode
      properties:
        publicationUri:
          $ref: '#/components/schemas/PartialURI'
          description: "Name of the publication, converted to a URI-friendly string to be used in the Publication path"
        name:
          type: string
          example: "OTL Manager Schema"
        publisher:
          type: string
          description: "Name of the person who published the Publication"
          example: "Hannah Smith"
        owner:
          type: string
          description: "Name of the person or organization responsible for the content of the Publication"
          example: "Semmtech"
        creator:
          type: string
          description: "Username or name of the person who created the Publication by publishing it on the platform"
          example: "smithhannah"
        contributor:
          type: string
          description: "Person who has contributed the content of the Publication"
          example: "Hannah Smith"
        description:
          type: string
          description: "Description of the content of the Publication"
          example: "This publication contains an ontology of road signs used by the Dutch government"
        versioningMode:
          $ref: '#/components/schemas/VersioningMode'
        abstract:
          type: string
          example: "Repellendus nobis nesciunt. Labore explicabo quidem tempore. Voluptatibus quam velit commodi."
          description: "Abstract of the publication, a brief overview of the content. Can contain markdown."
        versionLabel:
          type: string
          description: "In case versioningMode is CUSTOM, this field describes the version applied"
          example: "Version 2.0"
        licence:
          $ref: '#/components/schemas/Licence'
        useVersionedBaseUri:
          type: boolean
        addVersionToContent:
          type: boolean
        schemaURIs:
          $ref: '#/components/schemas/SchemaURIs'
        icon:
          type: string
          description: "Base 64 encoded image representing the Publication"
          example: "data:image/jpeg;base64,/9j/4R/+RXh..."
        ldvLink:
          $ref: '#/components/schemas/Url'
          description: "Linked Data Viewer Link"
      additionalProperties:
        example: 'projectTeam: {
          name: "Bridge X",
          members: ["Alice", "Bob", "Charlie"]}'
        oneOf:
          - type: string
          - type: integer
          - type: boolean
          - type: object
          - type: array
    PublicationUpdate:
      type: object
      properties:
        name:
          type: string
          description: "Name of the Publication"
          example: "OTL Manager Schema"
        publisher:
          type: string
          description: "Name of the person who published the Publication"
          example: "Hannah Smith"
        owner:
          type: string
          description: "Name of the person or organization responsible for the content of the Publication"
          example: "Semmtech"
        contributor:
          type: string
          description: "Person who has contributed the content of the Publication"
          example: "Hannah Smith"
        abstract:
          type: string
          example: "Repellendus nobis nesciunt. Labore explicabo quidem tempore. Voluptatibus quam velit commodi."
          description: "Abstract of the publication, a brief overview of the content. Can contain markdown."
        versionLabel:
          type: string
          description: "In case versioningMode is CUSTOM, this field describes the version applied"
          example: "Version 2.0"
        useVersionedBaseUri:
          type: boolean
        addVersionToContent:
          type: boolean
        description:
          type: string
        schemaURIs:
          $ref: '#/components/schemas/SchemaURIs'
        icon:
          type: string
          description: "Base 64 encoded image representing the Publication"
          example: "data:image/jpeg;base64,/9j/4R/+RXh..."
        ldvLink:
          $ref: '#/components/schemas/Url'
          description: "Linked Data Viewer Link"
      additionalProperties:
        example: 'projectTeam: {
          name: "Bridge X",
          members: ["Alice", "Bob", "Charlie"]}'
        oneOf:
          - type: string
          - type: integer
          - type: boolean
          - type: object
          - type: array
    DownloadInitiationResponse:
      type: object
      required:
        - statusFileUrl
        - downloadFileUrl
      properties:
        statusFileUrl:
          type: string
          format: uri
          description: "URL where the status of the download can be monitored."
          example: "http://localhost:4566/aws-s3-bucket/[unique-id]/status.txt?...[additional parameters]..."
        downloadFileUrl:
          type: string
          format: uri
          description: "URL where the downloaded file can be accessed once ready."
          example: "http://localhost:4566/aws-s3-bucket/[unique-id]/pub.ttl?...[additional parameters]..."
    FileCreate:
      type: object
      required:
        - name
        - versioningMode
      properties:
        name:
          type: string
          maxLength: 100
          pattern: "^[A-Za-z0-9-_.()]+$"
          example: "screen-capture.webm"
          description: "only alphanumeric characters, dashes, underscores, parentheses and dots are allowed."
        versioningMode:
          $ref: "#/components/schemas/VersioningMode"
        versionLabel:
          type: string
          description: "In case versioningMode is CUSTOM, this field describes the version applied"
          example: "Version 2.0"
        licence:
          $ref: "#/components/schemas/Licence"
      additionalProperties:
        example: 'projectTeam: {
          name: "Bridge X",
          members: ["Alice", "Bob", "Charlie"]}'
        oneOf:
          - type: string
          - type: integer
          - type: boolean
          - type: object
          - type: array
    File:
      type: object
      required:
        - name
        - versioningMode
      properties:
        id:
          $ref: "#/components/schemas/InternalId"
          readOnly: true
        name:
          type: string
          maxLength: 100
          pattern: "^[A-Za-z0-9-_.()]+$"
          example: "screen-capture.webm"
          description: "only alphanumeric characters, dashes, underscores, parentheses and dots are allowed."
        version:
          type: string
          example: "2"
        versioningMode:
          type: string
          enum:
            - UNDEFINED
            - NONE
            - TIMESTAMP
            - INCREMENTAL
            - CUSTOM
            - DATE_TIME
          example: "CUSTOM"
        repositoryId:
          type: string
          minLength: 36
          maxLength: 36
          readOnly: true
          example: 'bc8d0ce8-e9a6-11ed-a05b-0242ac120003'
        licence:
          $ref: "#/components/schemas/Licence"
        location:
          type: string
          readOnly: true
        mimeType:
          type: string
          readOnly: true
        publisherName:
          type: string
        createdBy:
          type: string
          readOnly: true
          example: 'Cruijff14'
          description: 'The userID of the user who created the file. May be an access token ID if file was created via the API'
        createdOn:
          $ref: "#/components/schemas/UnixTimestamp"
        modifiedBy:
          type: string
          readOnly: true
          example: 'Cruijff14'
          description: 'The userID of the user who created the file. May be an access token ID if file was created via the API'
        modifiedOn:
          $ref: "#/components/schemas/UnixTimestamp"
        pending:
          type: boolean
      additionalProperties:
        example: 'projectTeam: {
          name: "Bridge X",
          members: ["Alice", "Bob", "Charlie"]}'
        oneOf:
          - type: string
          - type: integer
          - type: boolean
          - type: object
          - type: array
    PaginatedFiles:
      type: object
      properties:
        content:
          type: array
          items:
            $ref: "#/components/schemas/File"
        total:
          type: integer
          format: int32
          example: 10
          description: 'Total number of files returned by the query'

  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
      description: 'Basic Authentication using Access Token credentials: username=token-id, password=token-password'
    LacesToken:
      type: apiKey
      name: Authorization
      in: header
      description: 'Provide the access token private key.'
security:
  - BasicAuth: [ ]
  - LacesToken: [ ]

