Namespaces
A. Overview
A "namespace" is analogous to an entity type. Any identifier, whether for a primary subject or linked alias, belongs to a particular namespace. Using an entity's identifier requires both its namespace and the identifier itself.
For example, a label of 1234 alone may be ambivalent in meaning. Namespace A may have an ID 1234 that refers to one entity, while namespace B may also have an ID of 1234 which may or may not refer to the same entity.
B. GET endpoints
The service stores general information about each namespace. Retrieving this information can be done through one of the endpoints below.
| Endpoint | Description | Example(s) |
|---|---|---|
/{sbjType} | Info on a subject namespace. | /cgAllele |
/{sbjType}/namespace/{aliasType} | Info on an alias namespace. | /cgAllele/namespace/imgtAcc |
/namespace | Additional info on all namespaces. |
B.1 Fields in API response
| Field | Description |
|---|---|
iri | IRI of the data type in the service. |
sbjType | Subject type. |
sbjCount | Number of subject records in the namespace. |
avg.aliasPerEnt | Average number of aliases per subject in the namespace. |
alias.aliasCount | Number of alias records in an alias namespace. |
alias.avg.sbjPerEnt | Average number of subjects per alias in the namespace. |
info | Additional namespace info, if any. |
info.desc | Description of the namespace. |
info.uriTemplates | Object of api and/or ui array of URI templates, if any. |
B.2 Sample responses
GET /{sbjType} (e.g., /cgAllele)
{
"alias": {
"alleleGgroup": {
"aliasCount": 300,
"avg": {
"sbjPerEnt": 10
},
"iri": "https://10.15.55.128/ldh-alias/cgAllele/namespace/alleleGgroup"
},
"imgtAcc": {
"aliasCount": 15000,
"avg": {
"sbjPerEnt": 1
},
"iri": "https://ldh.clinicalgenome.org/ldh-alias/cgAllele/namespace/imgtAcc"
}
},
"avg": {
"aliasPerEnt": 3
},
"info": {
"uriTemplates": {
"api": [
"https://reg.clinicalgenome.org/allele/{id}"
]
}
},
"iri": "https://ldh.clinicalgenome.org/ldh-alias/cgAllele",
"sbjCount": 15000,
"sbjType": "cgAllele"
}GET /{sbjType}/namespace/{aliasType} (e.g., /cgAllele/namespace/imgtAcc)
{
"alias": {
"imgtAcc": {
"aliasCount": 15000,
"avg": {
"sbjPerEnt": 1
},
"info": {
"desc": "EBI IPD-IMGT/HLA accession numbers",
"uriTemplates": {
"api": [
"https://www.ebi.ac.uk/cgi-bin/ipd/api/allele/{id}"
],
"ui": [
"https://www.ebi.ac.uk/ipd/imgt/hla/alleles/allele/?accession={id}"
]
}
},
"iri": "https://10.15.55.128/ldh-alias/cgAllele/namespace/imgtAcc"
}
}
}C. PUT/DELETE endpoints
Restricted usage
The endpoints documented below are for illustrative purposes only. A user must have the appropriate permission(s) in the correct context(s), etc.
| Endpoint | Description | Example(s) |
|---|---|---|
/{sbjType} | Modify the additional info for a subject namespace. | /cgAllele |
/{sbjType}/namespace/{namespace} | Modify the additional info for an alias namespace. | /cgAllele/namespace/alleleGgroup |
C.1 PUT payloads
A JSON object with the following field(s) are accepted. Explicitly setting a value to null will remove that value from the namespace's record.
| Field | Description |
|---|---|
desc | Description of the namespace, if any. |
uriTemplates | Object of api and/or ui arrays of URI templates, if any. Each template contains an {id} that indicates where to substitute an entity ID in the URI. |
Sample PUT command
curl -H "Authorization: Bearer $jwt" -X PUT \
-H "Content-Type: application/json" \
--data "{ \"desc\": \"Alleles from the gnomAD SVs v2.1 dataset \", \"uriTemplates\": { \"ui\": [ \"https://gnomad.broadinstitute.org/variant/{id}?dataset=gnomad_sv_r2_1\" ] } }" \
"https://${HOST}/ldh-alias/cgAllele/namespace/gnomadSv2"