Skip to main content

Cloud HTTP API

api/{handle}/create-dataset


POST /api/{handle}/create-dataset

Creates a new dataset owned by the authenticated user.

Path Parameters

ParameterRequiredTypeDescription
handleyesstringThe username/handle of the authenticated user

Request Object

KeyRequiredValue
datasetNameyesstring • Name of the dataset to create
storageTypeyesstring • Storage type for the dataset (ipfs, default)
descriptionyesstring • Description of the dataset
visibilityyesstring • Visibility (public, private)
tagsnoarray • 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

ParameterRequiredTypeDescription
handleyesstringThe username/handle of the authenticated user

Request Object

KeyRequiredValue
datasetsyesstring or array • Dataset(s) to query against
promptyesstring • 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

ParameterRequiredTypeDescription
handleyesstringThe username/handle of the authenticated user

Request Object

KeyRequiredValue
datasetsyesstring or array • Dataset(s) to query against
promptyesstring • 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

ParameterRequiredTypeDescription
handleyesstringThe username/handle of the authenticated user

Request Object

KeyRequiredValue
datasetsyesstring or array • Dataset(s) to query against
promptyesstring • 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

KeyRequiredValue
@contextnoobject • a map of terms for the transaction (See our Guide on Using Context)
ledgeryesstring • the name of the existing ledger
insertnoobject or array • data to be asserted
wherenoobject or array • a subquery to bind logic variables for use in your delete and/or insert clauses
deletenoobject or array • data to be retracted

NOTE: While insert, delete, and where are not required, either/both insert & delete must be used to qualify a valid transaction. You could only insert data, you could only delete data, or you could use both insert + delete to 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
}

fluree/query


POST /fluree/query

Request Object

KeyRequiredValue
@contextnoobject • a map of terms for the query and the result set (See our Guide on Using Context)
fromyesstring • the name of the existing ledger
wherenoobject or array • a subquery to set query constraints and bind logic variables for use in your select clause See our Reference Doc on FlureeQL Query Syntax
selectyesobject or array • a clause used to format the projected result set of your query See our Reference Doc on FlureeQL Query Syntax
groupBynostring • an optional clause used to group the projected result set of your query See our Reference Doc on FlureeQL Query Syntax
havingnostring or array • an optional clause used to filter the projected result set of your query (requires the use of groupBy)
orderBynostring • an optional clause used to order the projected result set of your query See our Reference Doc on FlureeQL Query Syntax
optsnoobject • an optional object used to set query options, such as the role or did identity of the querying entity

Example Request Object


{
"@context": {
"ex": "http://example.org/",
"schema": "http://schema.org/"
},
"from": "cookbook/base",
"where": {
"@id": "?s",
"schema:name": "?name"
},
"select": { "?s": ["*"] }
}

Curl Example


curl --location 'https://data.flur.ee/api/fluree/query' \
--header 'Content-Type: application/json' \
--data '{
"@context": {
"ex": "http://example.org/",
"schema": "http://schema.org/"
},
"from": "cookbook/base",
"where": {
"@id": "?s",
"schema:name": "?name"
},
"select": {"?s": ["*"]}
}'

Example Response


[
{
"@id": "ex:andrew",
"@type": "schema:Person",
"schema:name": "Andrew Johnson",
"schema:age": 35,
"schema:follows": [
{ "@id": "ex:freddy" },
{ "@id": "ex:letty" },
{ "@id": "ex:betty" }
]
},
{
"@id": "ex:betty",
"@type": "ex:Yeti",
"schema:name": "Betty",
"schema:age": 82,
"schema:follows": { "@id": "ex:freddy" }
},
{
"@id": "ex:freddy",
"@type": "ex:Yeti",
"schema:name": "Freddy",
"schema:age": 4,
"ex:verified": true
},
{
"@id": "ex:letty",
"@type": "ex:Yeti",
"schema:name": "Leticia",
"schema:age": 2,
"schema:follows": { "@id": "ex:freddy" },
"ex:nickname": "Letty"
}
]

fluree/history


POST /fluree/history

Request Object

KeyRequiredValue
@contextnoobject • a map of terms for the history query and the result set (See our Guide on Using Context)
fromyesstring • the name of the existing ledger
historyyesstring or array • used to express the entity or entity patterns for which you are auditing history (See the Reference section for Constraining Nodes)
tyesobject • used to express individual commit/time values or ranges of commit/time values (See the Reference section for Constraining by Time)
commit-detailsnoboolean • A flag for whether to include full commit details (See the Reference section for Including Commit Details)

Example Request Object


{
"@context": { "schema": "http://schema.org/" },
"from": "cookbook/base",
"history": [null, "schema:name"],
"t": { "from": 1 }
}

Curl Example


curl --location 'https://data.flur.ee/api/fluree/history' \
--header 'Content-Type: application/json' \
--data '{
"@context": { "schema": "http://schema.org/" },
"from": "cookbook/base",
"history": [null, "schema:name"],
"t": { "from": 1 }
}'

Example Response


[
{
"f:t": 1,
"f:assert": [
{ "schema:name": "Andrew Johnson", "id": "ex:andrew" },
{ "schema:name": "Betty", "id": "ex:betty" },
{ "schema:name": "Freddy", "id": "ex:freddy" },
{ "schema:name": "Leticia", "id": "ex:letty" }
],
"f:retract": []
},
{
"f:t": 2,
"f:assert": [{ "schema:name": "Andy the Yeti", "id": "ex:andrew" }],
"f:retract": []
}
]