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

# Compare 2 stored versions of a namespace ontology

> The statements added and removed from one version to the other, both limited to the datasets the caller can view now; a deleted dataset of the namespace shows only its IRIs, and only to the namespace's owner, not through a token limited to some datasets. A newer `from` gives the reverse change. As JSON, grouped by resource; as an RDF Patch with an id of its own, whose from and to headers name the 2 versions, and which applies to the default graph of the `from` version as the caller gets it now, without its owl:versionIRI and owl:priorVersion; for N-Quads or TriG, apply it to the named graph of the download taken as the default graph. The format comes from the format query parameter, else the Accept header, else JSON.



## OpenAPI

````yaml /api-reference/openapi.yml get /rdf/{username}/{namespace}/ontology/versions/{from}/diff/{to}
openapi: 3.0.3
info:
  title: DataLinks
  version: 3.20.0
servers:
  - url: https://api.datalinks.com/api/v1
    description: production server
security:
  - bearerAuth: []
  - openId:
      - implicit
paths:
  /rdf/{username}/{namespace}/ontology/versions/{from}/diff/{to}:
    get:
      tags:
        - rdf
      summary: Compare 2 stored versions of a namespace ontology
      description: >-
        The statements added and removed from one version to the other, both
        limited to the datasets the caller can view now; a deleted dataset of
        the namespace shows only its IRIs, and only to the namespace's owner,
        not through a token limited to some datasets. A newer `from` gives the
        reverse change. As JSON, grouped by resource; as an RDF Patch with an id
        of its own, whose from and to headers name the 2 versions, and which
        applies to the default graph of the `from` version as the caller gets it
        now, without its owl:versionIRI and owl:priorVersion; for N-Quads or
        TriG, apply it to the named graph of the download taken as the default
        graph. The format comes from the format query parameter, else the Accept
        header, else JSON.
      operationId: getRdfOntologyDiff
      parameters:
        - name: username
          in: path
          description: The username associated with the request.
          required: true
          schema:
            type: string
        - name: namespace
          in: path
          description: Namespace for the dataset.
          required: true
          schema:
            type: string
          example: cinematography
        - name: from
          in: path
          description: The number of the version the change starts from.
          required: true
          schema:
            minimum: 1
            type: integer
        - name: to
          in: path
          description: The number of the version the change leads to.
          required: true
          schema:
            minimum: 1
            type: integer
        - name: format
          in: query
          required: false
          schema:
            type: string
            enum:
              - json
              - rdfpatch
      responses:
        '200':
          description: The change from one version to the other.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RdfOntologyDiff'
            application/rdf-patch:
              schema:
                type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
components:
  schemas:
    RdfOntologyDiff:
      required:
        - from
        - resources
        - to
      type: object
      properties:
        from:
          type: integer
          format: int32
        to:
          type: integer
          format: int32
        resources:
          type: array
          description: The resources whose statements differ, sorted by IRI.
          items:
            $ref: '#/components/schemas/RdfResourceDiff'
    RdfResourceDiff:
      required:
        - added
        - iri
        - removed
      type: object
      properties:
        iri:
          type: string
        added:
          type: array
          items:
            $ref: '#/components/schemas/RdfStatement'
        removed:
          type: array
          items:
            $ref: '#/components/schemas/RdfStatement'
    ErrorResponse:
      required:
        - error_code
        - message
      type: object
      properties:
        error_code:
          type: string
          example: UNAUTHORIZED
        error_message:
          type: string
          example: ''
        message:
          type: string
          example: Missing authentication token
        sub_errors:
          type: array
          items:
            required:
              - code
              - message
            type: object
            properties:
              code:
                type: string
              message:
                type: string
    RdfStatement:
      required:
        - object
        - predicate
      type: object
      properties:
        predicate:
          type: string
        object:
          $ref: '#/components/schemas/RdfTerm'
    RdfTerm:
      type: object
      properties:
        iri:
          type: string
        literal:
          type: string
        datatype:
          type: string
        language:
          type: string
      description: >-
        Either an IRI, or a literal with its datatype (absent for a plain
        string) or its language.
  responses:
    BadRequest:
      description: Bad request. The request was malformed or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: >-
        Unauthorized. This error occurs if the authentication token is missing
        or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotAcceptable:
      description: >-
        The Accept header allows none of the formats this operation serves, and
        no format parameter names one.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      description: >
        Use a Bearer token for authentication. Submit the token using the
        `Authorization`

        header: `Authorization: Bearer <token>`.
      scheme: bearer
    openId:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: >-
            https://login.datalinks.com/realms/datalinks-realm/protocol/openid-connect/auth
          scopes:
            openid: openid

````

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