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

# Stream a namespace's rows as RDF

> Streams every row the caller can view, as a resource of its dataset's class with a literal for each cell; a row's IRI is minted under /.well-known/genid/ for this export only. A column that a link the caller can see uses also gets a datalinks:Value node for each distinct value, named by the value when it is short; a cell holding 2 or more values gets a node of its own, whose datalinks:element are its values. Each exact, geo or date link the caller can see adds an edge from a cell to each cell it matches, as DataLinks matches them (a date link adds no edges when its target column does not hold dates).
When a cell matches more than 100 rows through one link, the stream writes only the edges to the values of the 100 best rows. Thus edges to the values of the other rows can be missing. Rows with the same score keep the same order in each export.
Comment lines at the end of the stream count the cells that matched more than 100 rows. They also identify the links with the most of these cells. For each of these links, they give the number of its cells, an example cell and how to change the link. A last line counts the other links. A stream without these comment lines has all its edges.
Other IRIs are made from names. The response is compressed when the client sends Accept-Encoding. The ontology itself is not part of this stream. Each dataset is a named graph in N-Quads and TriG. The serialisation comes from the format query parameter, else the Accept header, else Turtle; only streaming formats are accepted. A failure after the response has started closes the connection before the final chunk, so a client detects the truncation.



## OpenAPI

````yaml /api-reference/openapi.yml get /rdf/{username}/{namespace}/data
openapi: 3.0.3
info:
  title: DataLinks
  version: 3.21.1
servers:
  - url: https://api.datalinks.com/api/v1
    description: production server
security:
  - bearerAuth: []
  - openId:
      - implicit
paths:
  /rdf/{username}/{namespace}/data:
    get:
      tags:
        - rdf
      summary: Stream a namespace's rows as RDF
      description: >-
        Streams every row the caller can view, as a resource of its dataset's
        class with a literal for each cell; a row's IRI is minted under
        /.well-known/genid/ for this export only. A column that a link the
        caller can see uses also gets a datalinks:Value node for each distinct
        value, named by the value when it is short; a cell holding 2 or more
        values gets a node of its own, whose datalinks:element are its values.
        Each exact, geo or date link the caller can see adds an edge from a cell
        to each cell it matches, as DataLinks matches them (a date link adds no
        edges when its target column does not hold dates).

        When a cell matches more than 100 rows through one link, the stream
        writes only the edges to the values of the 100 best rows. Thus edges to
        the values of the other rows can be missing. Rows with the same score
        keep the same order in each export.

        Comment lines at the end of the stream count the cells that matched more
        than 100 rows. They also identify the links with the most of these
        cells. For each of these links, they give the number of its cells, an
        example cell and how to change the link. A last line counts the other
        links. A stream without these comment lines has all its edges.

        Other IRIs are made from names. The response is compressed when the
        client sends Accept-Encoding. The ontology itself is not part of this
        stream. Each dataset is a named graph in N-Quads and TriG. The
        serialisation comes from the format query parameter, else the Accept
        header, else Turtle; only streaming formats are accepted. A failure
        after the response has started closes the connection before the final
        chunk, so a client detects the truncation.
      operationId: getRdfData
      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: format
          in: query
          description: RDF serialisation.
          required: false
          schema:
            type: string
            enum:
              - turtle
              - ntriples
              - nquads
              - trig
      responses:
        '200':
          description: The RDF, served as a download.
          headers:
            Content-Disposition:
              description: >-
                Attachment named after the namespace and the format's file
                extension.
              schema:
                type: string
          content:
            text/turtle:
              schema:
                type: string
                format: binary
            application/n-triples:
              schema:
                type: string
                format: binary
            application/n-quads:
              schema:
                type: string
                format: binary
            application/trig:
              schema:
                type: string
                format: binary
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  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'
    TooManyRequests:
      description: Too many requests of this kind are in progress; retry later.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  schemas:
    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
  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.