Additional Endpoints
Restricted usage
The endpoints documented below are for illustrative purposes only. An admin must set up the appropriate namespace(s), context(s), etc.
If you have data you would like to upsert into the service, contact us at ldh-admin@bcm.edu.
A. PUT endpoints
The following endpoints exist for convenience. Their existence is mainly due the minimal size of a document in this service - i.e., a document typically contains only an ID and metadata. In contrast, other LDH services may see other documents that are orders of magnitude larger.
| # | Endpoint | Description | Required fields (columns, in order for TSV payload) |
|---|---|---|---|
| 1 | /{sbjType}/subjects | Upsert multiple subject-alias records, with the aliases in possibly different namespaces. | sbjId, aliasType, aliasId |
| 2 | /{sbjType}/subjects/{aliasType} | Upsert multiple subject-alias records, with the aliases in one namespace. | sbjId, aliasId |
| 3 | /{sbjType}/id/{sbjId}/alias | Upsert one subject with multiple aliases in possibly different namespaces. | aliasType, aliasId |
| 4 | /{sbjType}/id/{sbjId}/alias/{aliasType} | Upsert one subject with multiple aliases, all of which belong in a single namespace. | aliasId |
| 5 | /{sbjType}/id/{sbjId}/alias/{aliasType}/{aliasId} | Upsert one subject and one alias pair. | N/A |
- The last endpoint (#5) uses the IDs in the URL. This is not a batch upsert, so no payload is needed. However, a content length header (
-H "Content-Length: 0") or blank payload (-H "Content-Type: text/plain" --data "") may be needed to indicate an empty payload.
A.1 Input file formats
Batch upsert endpoints (#1-4) take either JSON (Content-Type: application/json) or TSV (Content-Type: text/tab-separated-values or Content-Type: text/tsv) input payloads.
A.1.1 JSON
As a convenience, the values in an alias.{aliasType} array do not have to be structured. An element can either be (1) a string, or (2) an object of them form { "aliasId": "{aliasId}" }. Either format (or a mix of them) will be accepted, as shown in the examples below.
As another convenience, the endpoints where the subject ID is set in the URL (endpoints #3 and #4) do not expect the sbjId key. However, note that providing a sbjId value that conflicts with the request URL will result in an error response.
Examples of JSON input for each endpoint are provided below.
/{sbjType}/subjects (e.g., /cgAllele/subjects)
[
{
"sbjId": "CASV4220344313",
"alias": {
"gnomadSv2": [
"INS_10_73724",
{
"aliasId": "INS_10_73725"
}
],
"nist": [
"HG3_Ill_Krunchall_15451"
]
}
},
{
"sbjId": "CASV4216852855",
"alias": {
"nist": [
"HG2_10X_allpass_107"
]
}
}
]/{sbjType}/subjects/{aliasType} (e.g., /cgAllele/subjects/gnomadSv2)
[
{
"sbjId": "CASV4220344313",
"alias": {
"gnomadSv2": [
"INS_10_73724",
"INS_10_73725"
]
}
},
{
"sbjId": "CASV4081448226",
"alias": {
"gnomadSv2": [
"DEL_1_11"
]
}
}
]/{sbjType}/id/{sbjId}/subjects (e.g., /cgAllele/id/CASV4220344313/subjects)
{
"alias": {
"gnomadSv2": [
"INS_10_73724",
"INS_10_73725"
],
"nist": [
"HG3_Ill_Krunchall_15451"
]
}
}/{sbjType}/id/{sbjId}/subjects/{aliasType} (e.g., /cgAllele/id/CASV4220344313/subjects/gnomadSv2)
{
"alias": {
"gnomadSv2": [
"INS_10_73724",
"INS_10_73725"
]
}
}A.1.2 TSV
Tab-delimited files must have, at a minimum, the columns required for the endpoint. As a convenience, the complete set (all three columns) can be included in the order sbjId, aliasType, and aliasId. However, note that optional values (depending on the endpoint) that conflict with the request URL will result in an error response.
Example payloads for each batch endpoint are provided below.
/{sbjType}/subjects (e.g., /cgAllele/subjects)
CASV4220344313 gnomadSv2 INS_10_73724
CASV4220344313 gnomadSv2 INS_10_73725
CASV4216852855 nist HG2_10X_allpass_107/{sbjType}/subjects/{aliasType} (e.g., /cgAllele/subjects/gnomadSv2)
CASV4220344313 INS_10_73724
CASV4220344313 INS_10_73725/{sbjType}/id/{sbjId}/alias (e.g., /cgAllele/id/CASV4220344313/alias)
gnomadSv2 INS_10_73724
gnomadSv2 INS_10_73725
nist HG3_Ill_Krunchall_15451/{sbjType}/id/{sbjId}/alias/{aliasType} (e.g., /cgAllele/id/CASV4220344313/alias/gnomadSv2)
INS_10_73724
INS_10_73725A.2 Example batch upsert request
curl -H "Authorization: Bearer $jwt" -X PUT \
-H "Content-Type: text/tab-separated-values" --data-binary @test.tsv \
"https://${HOST}/ldh-alias/genomicLocation/subjects/ENCODEGeneRegulatoryElement"GL4233433099 EH38E1795881
GL4233433155 EH38E3900574
GL4233433216 EH38E3334376
GL4233433265 EH38E3334393
GL4233433322 EH38E3900581{
"data": {
"edgeLdChangeType": {
"insert": 5,
"update": 0
},
"edgeLdForChangeType": {
"insert": 5,
"update": 0
},
"ldChangeType": {
"insert": 5,
"update": 0
},
"sbjChangeType": {
"insert": 3,
"update": 2
}
}
}A.3 Input restrictions
Payloads used in the batch endpoints are subject to size restrictions. Both (a) the number of bytes and (b) the number of records will be checked. For example, a file must be <= 20 MB in size and have <= 50k subject-aliases to upsert.
These limits are configurable in the case that separate instances of the service are launched.
B. DELETE endpoints
| Endpoint | Description |
|---|---|
/{sbjType}/id/{sbjId}/alias/{aliasType}/{aliasId} | Delete the mapping between one subject and one alias. Delete the alias itself if orphaned (if linked to no other subjects). |
/{sbjType}/id/{sbjId}/alias/{aliasType} | Delete the mappings between one subject and all of its aliases within an alias namespace. Delete any aliases that are orphaned. |
/{sbjType}/id/{sbjId} | Delete one subject and all its alias mappings. |
