Namespaces
A. Overview
A "namespace" is analogous to an entity type. Any value, whether a subject or object value, belongs to a particular namespace. Using an entity's identifier requires both its namespace and the identifier itself.
For example, a value of 1234 alone may be ambivalent in meaning. Namespace A may have a value 1234 that refers to one entity, while namespace B may also have a value 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) |
|---|---|---|
/{sbjValType} | Info about a subject value namespace. | /sandbox |
/{sbjValType}/objValType/{objValType} | Info about an object value namespace. | /sandbox/objValType/ns1 |
/namespace | Additional info on all namespaces. |
B.1 Fields in API response
| Field | Description |
|---|---|
iri | IRI of the data type in the service. |
sbjValType | Subject value type. |
sbjValCount | Number of subject values in the namespace. |
avg.objValPerEnt | Average number of object values per subject value in the namespace. |
objValType.objValCount | Number of object values in a namespace. |
objValType.avg.sbjValPerEnt | Average number of subject values per object value 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 /{sbjValType} (e.g., /sandbox)
{
"avg": {
"objValPerEnt": 1000
},
"info": {
"desc": "Sample subject value namespace"
},
"iri": "https://ldh.clinicalgenome.org/ldh/val-map/demo/sandbox",
"objValType": {
"ns1": {
"avg": {
"sbjValPerEnt": 1
},
"info": {
"desc": "Sample object value namespace",
"uriTemplates": {
"api": [
"https://somehost/id/{id}"
]
}
},
"iri": "https://ldh.clinicalgenome.org/ldh/val-map/demo/sandbox/objValType/ns1",
"objValCount": 10000
}
},
"sbjValCount": 10,
"sbjValType": "sandbox"
}GET /{sbjValType}/objValType/{objValType} (e.g., /sandbox/objValType/ns1)
{
"objValType": {
"ns1": {
"avg": {
"sbjValPerEnt": 1
},
"info": {
"desc": "Sample object value namespace",
"uriTemplates": {
"api": [
"https://somehost/id/{id}"
]
}
},
"iri": "https://ldh.clinicalgenome.org/ldh/val-map/demo/sandbox/objValType/ns1",
"objValCount": 10000
}
}
}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) |
|---|---|---|
/{sbjValType} | Modify the additional info for a subject value namespace. | /sandbox |
/{sbjValType}/objValType/{namespace} | Modify the additional info for an object value namespace. | /sandbox/objValType/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 some dataset\", \"uriTemplates\": { \"ui\": [ \"https://somesite.org/variant/{id}?dataset=v4\" ] } }" \
"https://${HOST}/ldh/val-map/sandbox/objValType/ns1"