Cloud HTTP API
api/{handle}/create-dataset
POST /api/{handle}/create-dataset
Creates a new dataset owned by the authenticated user.
Path Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| handle | yes | string | The username/handle of the authenticated user |
Request Object
| Key | Required | Value |
|---|---|---|
datasetName | yes | string • Name of the dataset to create |
storageType | yes | string • Storage type for the dataset (ipfs, default) |
description | yes | string • Description of the dataset |
visibility | yes | string • Visibility (public, private) |
tags | no | array • Optional tags for the dataset |
Example Request Object
{ "datasetName": "my-dataset", "storageType": "default", "description": "Sample dataset", "visibility": "private", "tags": ["tag1", "tag2"]}
Curl Example
curl --location 'https://data.flur.ee/api/jdoe/create-dataset' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_TOKEN' \ --header 'x-user-handle: jdoe' \ --data '{ "datasetName": "my-dataset", "storageType": "default", "description": "Sample dataset", "visibility": "private", "tags": ["tag1", "tag2"] }'
Example Response
{ "message": "Dataset created successfully", "data": { "datasetName": "my-dataset", "storageType": "default", "description": "Sample dataset", "visibility": "private", "tags": ["tag1", "tag2"] }}
api/{handle}/generate-sparql
POST /api/{handle}/generate-sparql
Generate SPARQL query from natural language.
Path Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| handle | yes | string | The username/handle of the authenticated user |
Request Object
| Key | Required | Value |
|---|---|---|
datasets | yes | string or array • Dataset(s) to query against |
prompt | yes | string • Natural language prompt/question to process |
Example Request Object
{ "datasets": ["my-dataset"], "prompt": "List all triples in the dataset"}
Curl Example
curl --location 'https://data.flur.ee/api/jdoe/generate-sparql' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_TOKEN' \ --header 'x-user-handle: jdoe' \ --data '{ "datasets": ["my-dataset"], "prompt": "List all triples in the dataset" }'
Example Response
{ "sparql": "SELECT * WHERE { ?s ?p ?o . }"}
api/{handle}/generate-prompt
POST /api/{handle}/generate-prompt
Generate a prompt for SPARQL query generation.
Path Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| handle | yes | string | The username/handle of the authenticated user |
Request Object
| Key | Required | Value |
|---|---|---|
datasets | yes | string or array • Dataset(s) to query against |
prompt | no | string • Natural language prompt/question to process |
Example Request Object
{ "datasets": ["my-dataset"], "prompt": "List all triples in the dataset"}
Curl Example
curl --location 'https://data.flur.ee/api/jdoe/generate-prompt' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_TOKEN' \ --header 'x-user-handle: jdoe' \ --data '{ "datasets": ["my-dataset"], "prompt": "List all triples in the dataset" }'
Example Response
{ "prompt": "Write a SPARQL query to list all triples in the dataset 'my-dataset'."}
api/{handle}/generate-answer
POST /api/{handle}/generate-answer
Generate answer from natural language query.
Path Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| handle | yes | string | The username/handle of the authenticated user |
Request Object
| Key | Required | Value |
|---|---|---|
datasets | yes | string or array • Dataset(s) to query against |
prompt | yes | string • Natural language prompt/question to process |
Example Request Object
{ "datasets": ["my-dataset"], "prompt": "How many triples are in the dataset?"}
Curl Example
curl --location 'https://data.flur.ee/api/jdoe/generate-answer' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_TOKEN' \ --header 'x-user-handle: jdoe' \ --data '{ "datasets": ["my-dataset"], "prompt": "How many triples are in the dataset?" }'
Example Response
{ "answer": "There are 42 triples in the dataset."}
fluree/transact
POST /fluree/transact
Commit a transaction to a ledger.
Request Object
| Key | Required | Value |
|---|---|---|
@context | no | object • a map of terms for the transaction (See our Guide on Using Context) |
ledger | yes | string • the name of the existing ledger |
insert | no | object or array • data to be asserted |
where | no | object or array • a subquery to bind logic variables for use in your delete and/or insert clauses |
delete | no | object or array • data to be retracted |
NOTE: While
insert,delete, andwhereare not required, either/bothinsert&deletemust be used to qualify a valid transaction. You could only insert data, you could only delete data, or you could use bothinsert+deleteto qualify a sort of update to data state.
Example Request Object
{ "@context": { "schema": "http://schema.org/" }, "ledger": "cookbook/base", "where": { "@id": "?s", "schema:description": "We ❤️ All Blood" }, "delete": { "@id": "?s", "schema:description": "We ❤️ All Blood" }, "insert": { "@id": "?s", "schema:description": ["We ❤️ Human Blood", "We ❤️ Animal Blood"] }}
Curl Example
curl --location 'https://data.flur.ee/api/fluree/transact' \ --header 'Content-Type: application/json' \ --data '{ "@context": { "schema": "http://schema.org/" }, "ledger": "cookbook/base", "where": { "@id": "?s", "schema:description": "We ❤️ All Blood" }, "delete": { "@id": "?s", "schema:description": "We ❤️ All Blood" }, "insert": { "@id": "?s", "schema:description": ["We ❤️ Human Blood", "We ❤️ Animal Blood"] } }'
Example Response
{ "address": "fluree:file://cookbook/base/main/head", "alias": "cookbook/base", "t": 2}