Skip to content

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.

EndpointDescriptionExample(s)
/{sbjValType}Info about a subject value namespace./sandbox
/{sbjValType}/objValType/{objValType}Info about an object value namespace./sandbox/objValType/ns1
/namespaceAdditional info on all namespaces.

B.1 Fields in API response ​

FieldDescription
iriIRI of the data type in the service.
sbjValTypeSubject value type.
sbjValCountNumber of subject values in the namespace.
avg.objValPerEntAverage number of object values per subject value in the namespace.
objValType.objValCountNumber of object values in a namespace.
objValType.avg.sbjValPerEntAverage number of subject values per object value in the namespace.
infoAdditional namespace info, if any.
info.descDescription of the namespace.
info.uriTemplatesObject of api and/or ui array of URI templates, if any.

B.2 Sample responses ​

GET /{sbjValType} (e.g., /sandbox)
json5
{
  "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)
json5
{
  "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.

EndpointDescriptionExample(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.

FieldDescription
descDescription of the namespace, if any.
uriTemplatesObject 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
bash
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"

BIOINFORMATICS RESEARCH LABORATORY