openapi: 3.0.3 info: title: TriplyDB Accounts Datasets API version: 26.5.104 description: "REST API for TriplyDB — a linked data database platform.\n\n## Authentication\n\nRead operations on publicly published datasets can be performed without\nauthentication. Write operations and read operations on private or internal\ndatasets require a valid API token.\n\n### Creating an API token\n\n1. Log into your TriplyDB instance.\n2. Click on the user menu in the top-right corner and click on \"User settings\".\n3. Go to the \"API tokens\" tab.\n4. Click \"Create token\", enter a description (e.g., \"my-script\") and select\n the appropriate access rights.\n5. Click \"Create\" and copy the token. It is only shown once upon creation.\n\n### Using the API token\n\nInclude the token in the `Authorization` header of your HTTP requests:\n\n```\nAuthorization: Bearer YOUR_TOKEN\n```\n\n### Security considerations\n\n- **Do not commit tokens to git repositories.**\n- **Do not share tokens** with anyone who should not have access to your\n TriplyDB resources.\n- **Rotate tokens regularly**, especially if you suspect a compromise.\n\n## Pagination\n\nList endpoints are paginated. The response includes a `Link` header\n([RFC 8288](https://www.rfc-editor.org/rfc/rfc8288)) with URLs for\nnavigating the result set. To paginate, follow the URLs in the `Link`\nheader rather than constructing URLs manually.\n\nThe `Link` header contains up to three relations:\n\n| Relation | Meaning |\n|----------|---------|\n| `first` | URL to the first page of results |\n| `next` | URL to the next page (absent when on the last page) |\n| `prev` | URL to the previous page (absent when on the first page) |\n\nExample response header:\n\n```\nLink: ; rel=\"first\",\n ; rel=\"next\"\n```\n\nTo iterate through all results, keep following the `rel=\"next\"` URL until\nit is no longer present. You can control the page size with the `limit`\nquery parameter (default: 30).\n\n## Content negotiation\n\nLinked data endpoints support format negotiation in two ways:\n\n1. **Accept header** — set the `Accept` request header to the desired media type.\n2. **URL extension** — append a format extension to the URL path (e.g., `/run.csv`).\n When present, the extension takes precedence over the `Accept` header.\n" contact: name: Triply url: https://triply.cc servers: - url: https://api.lod.uba.uva.nl description: This instance security: - bearerAuth: [] - {} tags: - name: Datasets description: Dataset CRUD paths: /datasets: get: tags: - Datasets summary: List all datasets operationId: listAllDatasets security: - {} parameters: - name: q in: query description: Search term schema: type: string - $ref: '#/components/parameters/since' - $ref: '#/components/parameters/limit' - name: sparql in: query description: Filter datasets with active SPARQL service schema: type: string - name: verbose in: query description: Return verbose dataset information schema: type: string - $ref: '#/components/parameters/sortDirection' responses: '200': description: Paginated dataset list headers: Link: $ref: '#/components/headers/Link' content: application/json: schema: type: array items: $ref: '#/components/schemas/Dataset' /datasets/{account}: parameters: - $ref: '#/components/parameters/account' get: tags: - Datasets summary: List datasets for an account operationId: listAccountDatasets security: - {} parameters: - name: q in: query schema: type: string - $ref: '#/components/parameters/since' - name: accessLevel in: query schema: $ref: '#/components/schemas/AccessLevel' - name: sortBy in: query schema: type: string enum: - createdAt - updatedAt - name - $ref: '#/components/parameters/sortDirection' responses: '200': description: Datasets for the account headers: Link: $ref: '#/components/headers/Link' content: application/json: schema: type: array items: $ref: '#/components/schemas/Dataset' post: tags: - Datasets summary: Create a dataset operationId: createDataset requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/NewDataset' responses: '201': description: Dataset created content: application/json: schema: $ref: '#/components/schemas/Dataset' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /datasets/{account}/{dataset}: parameters: - $ref: '#/components/parameters/account' - $ref: '#/components/parameters/dataset' get: tags: - Datasets summary: Get dataset details operationId: getDataset security: - {} parameters: - name: verbose in: query description: Include services, graphs, and jobs schema: type: string responses: '200': description: Dataset details content: application/json: schema: oneOf: - $ref: '#/components/schemas/Dataset' - $ref: '#/components/schemas/DatasetVerbose' '404': $ref: '#/components/responses/NotFound' patch: tags: - Datasets summary: Update a dataset operationId: updateDataset requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateDataset' responses: '200': description: Updated dataset content: application/json: schema: $ref: '#/components/schemas/Dataset' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' delete: tags: - Datasets summary: Delete a dataset operationId: deleteDataset responses: '204': description: Dataset deleted '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /datasets/{account}/{dataset}/copy: parameters: - $ref: '#/components/parameters/account' - $ref: '#/components/parameters/dataset' post: tags: - Datasets summary: Copy a dataset operationId: copyDataset requestBody: required: true content: application/json: schema: type: object required: - toAccount properties: toAccount: type: string name: type: string responses: '201': description: Copied dataset content: application/json: schema: $ref: '#/components/schemas/Dataset' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /datasets/{account}/{dataset}/chown: parameters: - $ref: '#/components/parameters/account' - $ref: '#/components/parameters/dataset' post: tags: - Datasets summary: Transfer dataset ownership operationId: chownDataset requestBody: required: true content: application/json: schema: type: object required: - toAccount properties: toAccount: type: string responses: '200': description: Dataset with new owner content: application/json: schema: $ref: '#/components/schemas/Dataset' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /datasets/{account}/{dataset}/download: parameters: - $ref: '#/components/parameters/account' - $ref: '#/components/parameters/dataset' get: tags: - Datasets summary: Download dataset as RDF operationId: downloadDataset security: - {} parameters: - name: graph in: query description: Filter to a specific graph IRI schema: type: string responses: '200': description: Gzipped RDF data headers: Content-Encoding: schema: type: string enum: - gzip Content-Disposition: schema: type: string content: application/n-quads: schema: type: string format: binary application/trig: schema: type: string format: binary text/turtle: schema: type: string format: binary application/n-triples: schema: type: string format: binary application/ld+json: schema: type: string format: binary head: tags: - Datasets summary: Check dataset download headers operationId: headDownloadDataset security: - {} parameters: - name: graph in: query schema: type: string responses: '200': description: Headers only components: schemas: AccessLevel: type: string enum: - public - private - internal Capability: type: string enum: - sparql - sparqlApi - elasticSearch Dataset: type: object required: - id - name - displayName - description - owner - accessLevel - createdAt - updatedAt - graphCount - statements - serviceCount - assetCount - tags - prefixes - exampleResources - hasDataQualityIssues - toggles properties: id: type: string readOnly: true example: 64a1b2c3d4e5f60012345678 name: type: string example: knowledge-graph displayName: type: string example: Knowledge Graph description: type: string example: An enterprise knowledge graph linking people, projects, and publications. avatarUrl: type: string readOnly: true owner: readOnly: true allOf: - $ref: '#/components/schemas/Account' accessLevel: $ref: '#/components/schemas/AccessLevel' license: $ref: '#/components/schemas/DatasetLicenseId' createdAt: type: string format: date-time readOnly: true example: 2024-03-01 12:00:00+00:00 updatedAt: type: string format: date-time readOnly: true graphCount: type: integer readOnly: true example: 3 statements: type: integer readOnly: true example: 1250000 lastGraphsUpdateTime: type: string format: date-time readOnly: true serviceCount: type: integer readOnly: true example: 1 assetCount: type: integer readOnly: true example: 0 tags: type: array items: type: string example: - linked-data - knowledge-graph prefixes: $ref: '#/components/schemas/Prefixes' exampleResources: type: array items: type: string hasDataQualityIssues: type: boolean readOnly: true autogeneratedIdType: $ref: '#/components/schemas/AutoGeneratedIdType' toggles: $ref: '#/components/schemas/DatasetToggles' IndexJobStatus: type: string enum: - created - downloading - pending - indexing - finished - canceled - error DatasetToggles: type: object properties: browserUi: type: boolean tableUi: type: boolean dataEditorUi: type: boolean dataModelEditorUi: type: boolean insightsUi: type: boolean sparqlIdeUi: type: boolean graphqlUi: type: boolean elasticsearchUi: type: boolean graphsUi: type: boolean servicesUi: type: boolean assetsUi: type: boolean Graph: type: object required: - graphName - id - numberOfStatements properties: graphName: type: string example: https://example.org/graph/main id: type: string readOnly: true example: 64a1b2c3d4e5f60012345679 numberOfStatements: type: integer readOnly: true example: 500000 importedAt: type: string format: date-time readOnly: true uploadedAt: type: string format: date-time readOnly: true importedFrom: type: object properties: dataset: type: string graphName: type: string datasetName: type: string datasetAvatarUrl: type: string qualityReport: type: object qualityReportFor: type: string ServiceConfig: type: object description: 'Service-specific configuration. For Jena services, set `reasonerType`. For Elasticsearch services, set `indexTemplates` and/or `componentTemplates`. ' properties: reasonerType: $ref: '#/components/schemas/JenaReasoner' indexTemplates: type: array description: Elasticsearch index templates items: type: object properties: name: type: string index_patterns: type: string componentTemplates: type: array description: Elasticsearch component templates (mappings, settings) items: type: object properties: name: type: string template: type: object properties: mappings: type: object settings: type: object DatasetLicenseId: type: string nullable: true enum: - CC0 1.0 - CC BY - CC BY-ND - CC BY-NC - CC BY-NC-ND - CC BY-NC-SA - CC BY-SA v4.0 - ODC-By - ODC-ODbL - PDDL - GFDL - CC-BY-SA - null JenaReasoner: type: string enum: - OWL - RDFS - None Account: type: object discriminator: propertyName: type mapping: user: '#/components/schemas/User' org: '#/components/schemas/Org' required: - accountName - uid - createdAt - description - type properties: accountName: type: string example: acme-research uid: type: string readOnly: true example: 64a1b2c3d4e5f60012345678 name: type: string example: ACME Research Lab description: type: string example: Publishing linked open data for the sciences. avatarUrl: type: string readOnly: true createdAt: type: string format: date-time readOnly: true example: 2024-01-15 10:30:00+00:00 updatedAt: type: string format: date-time readOnly: true type: $ref: '#/components/schemas/AccountType' accountType: type: string enum: - user - group readOnly: true pinnedItems: type: array items: type: object datasetCount: type: integer readOnly: true queryCount: type: integer readOnly: true storyCount: type: integer readOnly: true email: type: string format: email AutoGeneratedIdType: type: string enum: - uuid - hex8 - hex10 IndexJobType: type: string enum: - upload - download DatasetVerbose: allOf: - $ref: '#/components/schemas/Dataset' - type: object properties: services: type: array items: $ref: '#/components/schemas/ServiceMetadata' largestGraphs: type: array items: $ref: '#/components/schemas/Graph' openJobs: type: array items: $ref: '#/components/schemas/IndexJob' ErrorResponse: type: object required: - message properties: message: type: string example: Resource not found. code: type: integer example: 404 errors: type: array items: $ref: '#/components/schemas/ErrorResponse' ServiceMetadata: type: object required: - type - name - id - status - capabilities - createdAt properties: type: $ref: '#/components/schemas/ServiceType' version: type: string readOnly: true capabilities: type: array readOnly: true items: $ref: '#/components/schemas/Capability' name: type: string example: sparql id: type: string readOnly: true example: 64a1b2c3d4e5f6001234567a numberOfLoadedStatements: type: integer readOnly: true numberOfLoadedGraphs: type: integer readOnly: true numberOfGraphs: type: integer readOnly: true numberOfGraphErrors: type: integer readOnly: true error: readOnly: true allOf: - $ref: '#/components/schemas/ErrorResponse' status: readOnly: true allOf: - $ref: '#/components/schemas/ServiceStatus' endpoint: type: string readOnly: true outOfSync: type: boolean readOnly: true loadedAt: type: string format: date-time readOnly: true createdAt: type: string format: date-time readOnly: true config: $ref: '#/components/schemas/ServiceConfig' Prefixes: type: object additionalProperties: type: string format: uri example: rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# rdfs: http://www.w3.org/2000/01/rdf-schema# IndexJob: type: object required: - createdAt - datasetId - downloadedBytes - downloadingProgress - files - indexedGraphCount - indexingProgress - jobId - skippedFileCount - skippedFileNames - status - type - updatedAt properties: baseIRI: type: string createdAt: type: string format: date-time readOnly: true datasetId: type: string readOnly: true defaultGraphName: type: string downloadedBytes: type: integer readOnly: true downloadingProgress: type: number readOnly: true example: 1 downloadUrls: type: array items: type: string error: readOnly: true allOf: - $ref: '#/components/schemas/ErrorResponse' files: type: array readOnly: true items: type: object properties: fileName: type: string fileSize: type: integer sourceFileId: type: string graphNames: type: array readOnly: true items: type: string indexedGraphCount: type: integer readOnly: true indexingProgress: type: number readOnly: true jobId: type: string readOnly: true example: 64a1b2c3d4e5f6001234567c skippedFileCount: type: integer readOnly: true skippedFileNames: type: array readOnly: true items: type: string status: readOnly: true allOf: - $ref: '#/components/schemas/IndexJobStatus' type: $ref: '#/components/schemas/IndexJobType' updatedAt: type: string format: date-time readOnly: true AccountType: type: string enum: - user - org ServiceStatus: type: string enum: - starting - running - stopping - stopped - removing - updating - error NewDataset: type: object properties: name: type: string example: knowledge-graph displayName: type: string example: Knowledge Graph description: type: string example: An enterprise knowledge graph. accessLevel: $ref: '#/components/schemas/AccessLevel' license: $ref: '#/components/schemas/DatasetLicenseId' autogeneratedIdType: $ref: '#/components/schemas/AutoGeneratedIdType' UpdateDataset: type: object properties: displayName: type: string description: type: string name: type: string accessLevel: $ref: '#/components/schemas/AccessLevel' license: $ref: '#/components/schemas/DatasetLicenseId' exampleResources: type: array items: type: string tags: type: array items: type: string autogeneratedIdType: $ref: '#/components/schemas/AutoGeneratedIdType' toggles: $ref: '#/components/schemas/DatasetToggles' ServiceType: type: string enum: - elasticSearch - virtuoso - jena responses: Forbidden: description: Insufficient permissions content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' Unauthorized: description: Authentication required content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' NotFound: description: Resource not found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' BadRequest: description: Bad request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' parameters: sortDirection: name: sortDirection in: query description: Sort direction schema: type: string enum: - asc - desc limit: name: limit in: query description: Maximum number of results schema: type: integer minimum: 1 account: name: account in: path required: true description: Account name (user or group) schema: type: string dataset: name: dataset in: path required: true description: Dataset name schema: type: string since: name: since in: query description: Cursor for pagination. Should be provided using the `link` header schema: type: string headers: Link: description: 'RFC 8288 pagination links. Contains `rel="first"` and `rel="next"` URIs for cursor-based pagination. ' schema: type: string example: ; rel="first", ; rel="next" securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT