Function definitions of the map, taken from the functionDefinition elements of the SBML file it
was created from.
They are referenced by the kinetic laws of the reactions of the map.
The endpoints are served from /new_api/projects/{projectId}/maps/{mapId}/functions.
1. List functions
Returns all functions of the map.
|
Note
|
The result is paged - use the page and size query parameters to
walk through it.
|
1.1. HTTP request
GET /minerva/new_api/projects/test_project/maps/144/functions/ HTTP/1.1
1.2. Path Parameters
| Parameter | Description |
|---|---|
|
project identifier |
|
map identifier |
1.3. Query Parameters
| Parameter | Description |
|---|---|
|
index of the page to fetch, counted from 0; 0 by default |
|
number of entries on a page; 20 by default, 10000 at most |
1.4. CURL sample
$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/144/functions/' -X GET \
-H 'Authorization: Bearer xxxxxxxx'
1.5. HTTP response
HTTP/1.1 200 OK
1.6. Sample Response
{
"content" : [ {
"id" : 115,
"functionId" : "f1",
"name" : "name",
"definition" : "<math xmlns=\"http://www.w3.org/1998/Math/MathML\"><lambda>\n<bvar>\n<ci> x </ci>\n</bvar>\n<bvar>\n<ci> y </ci>\n</bvar>\n<apply>\n<plus/>\n<ci> x </ci>\n<ci> y </ci>\n</apply>\n</lambda></math>",
"arguments" : [ "x", "y" ],
"mathMlPresentation" : "\n<math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n <mrow>\n <mi> x </mi>\n <mo>+</mo>\n <mi> y </mi>\n </mrow>\n</math>\n"
} ],
"totalPages" : 1,
"totalElements" : 1,
"numberOfElements" : 1,
"size" : 20,
"number" : 0
}
2. Get function
Returns a single function of the map.
2.1. HTTP request
GET /minerva/new_api/projects/test_project/maps/142/functions/113 HTTP/1.1
2.2. Path Parameters
| Parameter | Description |
|---|---|
|
project identifier |
|
map identifier |
|
function identifier |
2.3. CURL sample
$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/142/functions/113' -X GET \
-H 'Authorization: Bearer xxxxxxxx'
2.4. HTTP response
HTTP/1.1 200 OK
2.5. Sample Response
{
"id" : 113,
"functionId" : "f1",
"name" : "name",
"definition" : "<math xmlns=\"http://www.w3.org/1998/Math/MathML\"><lambda>\n<bvar>\n<ci> x </ci>\n</bvar>\n<bvar>\n<ci> y </ci>\n</bvar>\n<apply>\n<plus/>\n<ci> x </ci>\n<ci> y </ci>\n</apply>\n</lambda></math>",
"arguments" : [ "x", "y" ],
"mathMlPresentation" : "\n<math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n <mrow>\n <mi> x </mi>\n <mo>+</mo>\n <mi> y </mi>\n </mrow>\n</math>\n"
}
3. Add function
Creates a new function in the map. The definition must be a valid MathML lambda expression, otherwise the call is rejected.
3.1. HTTP request
POST /minerva/new_api/projects/test_project/maps/148/functions/ HTTP/1.1
3.2. Path Parameters
| Parameter | Description |
|---|---|
|
project identifier |
|
map identifier |
3.3. Request Fields
| Path | Type | Description |
|---|---|---|
|
|
identifier of the function used in the SBML file |
|
|
name of the function |
|
|
MathML definition of the function |
3.4. CURL sample
$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/148/functions/' -X POST \
-H 'Authorization: Bearer xxxxxxxx' \
-d '{"functionId":"function_id_12","name":"function_name_11","definition":"<lambda><bvar><ci> x </ci></bvar></lambda>"}' \
-H 'Content-Type: application/json'
3.5. HTTP response
HTTP/1.1 201 Created
3.6. Sample Response
{
"id" : 121,
"functionId" : "function_id_12",
"name" : "function_name_11",
"definition" : "<lambda><bvar><ci> x </ci></bvar></lambda>",
"arguments" : [ "x" ],
"mathMlPresentation" : null
}
4. Update function
Replaces the identifier, name and definition of an existing function.
|
Note
|
Supports optimistic locking via the If-Match header.
|
4.1. HTTP request
PUT /minerva/new_api/projects/test_project/maps/146/functions/117 HTTP/1.1
4.2. Path Parameters
| Parameter | Description |
|---|---|
|
project identifier |
|
map identifier |
|
function identifier |
4.3. Request Fields
| Path | Type | Description |
|---|---|---|
|
|
identifier of the function used in the SBML file |
|
|
name of the function |
|
|
MathML definition of the function |
4.4. CURL sample
$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/146/functions/117' -X PUT \
-H 'Authorization: Bearer xxxxxxxx' \
-d '{"functionId":"function_id_12","name":"function_name_11","definition":"<lambda><bvar><ci> x </ci></bvar></lambda>"}' \
-H 'Content-Type: application/json'
4.5. HTTP response
HTTP/1.1 200 OK
4.6. Sample Response
{
"id" : 117,
"functionId" : "function_id_12",
"name" : "function_name_11",
"definition" : "<lambda><bvar><ci> x </ci></bvar></lambda>",
"arguments" : [ "x" ],
"mathMlPresentation" : null
}
5. Delete function
Removes a function from the map.
|
Note
|
Supports optimistic locking via the If-Match header.
|
5.1. HTTP request
DELETE /minerva/new_api/projects/test_project/maps/140/functions/111 HTTP/1.1
5.2. Path Parameters
| Parameter | Description |
|---|---|
|
project identifier |
|
map identifier |
|
function identifier |
5.3. CURL sample
$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/140/functions/111' -X DELETE \
-H 'Authorization: Bearer xxxxxxxx'
5.4. HTTP response
HTTP/1.1 200 OK