Units of quantity defined at the map level, taken from the unitDefinition elements of the SBML file the map was created from. A unit is composed of factors, each of them a base SBML unit with an exponent, a scale and a multiplier. The parameters of the map (see SBML Parameters) and the elements of the map (see Element unit) refer to these units. The endpoints are served from /new_api/projects/{projectId}/maps/{mapId}/units.

1. List units

Returns all units defined in 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/176/units/ HTTP/1.1

1.2. Path Parameters

Table 1. /minerva/new_api/projects/{projectId}/maps/{mapId}/units/
Parameter Description

projectId

project identifier

mapId

map identifier

1.3. Query Parameters

Parameter Description

page

index of the page to fetch, counted from 0; 0 by default

size

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/176/units/' -X GET \
    -H 'Authorization: Bearer xxxxxxxx'

1.5. HTTP response

HTTP/1.1 200 OK

1.6. Sample Response

{
  "content" : [ {
    "id" : 150,
    "unitId" : "u1",
    "name" : "Weight",
    "unitTypeFactors" : [ ]
  }, {
    "id" : 151,
    "unitId" : "unused",
    "name" : null,
    "unitTypeFactors" : [ ]
  } ],
  "totalPages" : 1,
  "totalElements" : 2,
  "numberOfElements" : 2,
  "size" : 20,
  "number" : 0
}

2. Get unit

Returns a single unit of the map.

2.1. HTTP request

GET /minerva/new_api/projects/test_project/maps/174/units/148 HTTP/1.1

2.2. Path Parameters

Table 2. /minerva/new_api/projects/{projectId}/maps/{mapId}/units/{unitId}
Parameter Description

projectId

project identifier

mapId

map identifier

unitId

unit identifier

2.3. CURL sample

$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/174/units/148' -X GET \
    -H 'Authorization: Bearer xxxxxxxx'

2.4. HTTP response

HTTP/1.1 200 OK

2.5. Sample Response

{
  "id" : 148,
  "unitId" : "u1",
  "name" : "Weight",
  "unitTypeFactors" : [ ]
}

3. Add unit

Creates a new unit in the map together with its factors.

3.1. HTTP request

POST /minerva/new_api/projects/test_project/maps/170/units/ HTTP/1.1

3.2. Path Parameters

Table 3. /minerva/new_api/projects/{projectId}/maps/{mapId}/units/
Parameter Description

projectId

project identifier

mapId

map identifier

3.3. Request Fields

Path Type Description

unitId

String

identifier of the unit used in the SBML file

name

String

name of the unit

unitTypeFactors

Array

factors the unit is composed of

unitTypeFactors[].unitType

String

SBML base unit of the factor, for instance AMPERE

unitTypeFactors[].exponent

Number

exponent applied to the base unit

unitTypeFactors[].scale

Number

power of ten the base unit is multiplied by

unitTypeFactors[].multiplier

Number

factor the base unit is multiplied by

3.4. CURL sample

$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/170/units/' -X POST \
    -H 'Authorization: Bearer xxxxxxxx' \
    -d '{"name":"unit_name_11","unitId":"unit_id_12","unitTypeFactors":[{"unitType":"AMPERE","exponent":13,"scale":15,"multiplier":14.0}]}' \
    -H 'Content-Type: application/json'

3.5. HTTP response

HTTP/1.1 201 Created

3.6. Sample Response

{
  "id" : 145,
  "unitId" : "unit_id_12",
  "name" : "unit_name_11",
  "unitTypeFactors" : [ {
    "id" : 8,
    "unitType" : "AMPERE",
    "exponent" : 13,
    "scale" : 15,
    "multiplier" : 14.0
  } ]
}

4. Update unit

Replaces the identifier, name and factors of an existing unit.

Note
Supports optimistic locking via the If-Match header.

4.1. HTTP request

PUT /minerva/new_api/projects/test_project/maps/168/units/141 HTTP/1.1

4.2. Path Parameters

Table 4. /minerva/new_api/projects/{projectId}/maps/{mapId}/units/{unitId}
Parameter Description

projectId

project identifier

mapId

map identifier

unitId

unit identifier

4.3. Request Fields

Path Type Description

unitId

String

identifier of the unit used in the SBML file

name

String

name of the unit

unitTypeFactors

Array

factors the unit is composed of

unitTypeFactors[].unitType

String

SBML base unit of the factor, for instance AMPERE

unitTypeFactors[].exponent

Number

exponent applied to the base unit

unitTypeFactors[].scale

Number

power of ten the base unit is multiplied by

unitTypeFactors[].multiplier

Number

factor the base unit is multiplied by

4.4. CURL sample

$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/168/units/141' -X PUT \
    -H 'Authorization: Bearer xxxxxxxx' \
    -d '{"name":"unit_name_11","unitId":"unit_id_12","unitTypeFactors":[{"unitType":"AMPERE","exponent":13,"scale":15,"multiplier":14.0}]}' \
    -H 'Content-Type: application/json'

4.5. HTTP response

HTTP/1.1 200 OK

4.6. Sample Response

{
  "id" : 141,
  "unitId" : "unit_id_12",
  "name" : "unit_name_11",
  "unitTypeFactors" : [ {
    "id" : 7,
    "unitType" : "AMPERE",
    "exponent" : 13,
    "scale" : 15,
    "multiplier" : 14.0
  } ]
}

5. Delete unit

Removes a unit from the map. A unit that is still used - by a parameter or by an element of the map - cannot be removed and the call is rejected with 400.

Note
Supports optimistic locking via the If-Match header.

5.1. HTTP request

DELETE /minerva/new_api/projects/test_project/maps/172/units/146 HTTP/1.1

5.2. Path Parameters

Table 5. /minerva/new_api/projects/{projectId}/maps/{mapId}/units/{unitId}
Parameter Description

projectId

project identifier

mapId

map identifier

unitId

unit identifier

5.3. CURL sample

$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/172/units/146' -X DELETE \
    -H 'Authorization: Bearer xxxxxxxx'

5.4. HTTP response

HTTP/1.1 200 OK