Skip to content

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.

EndpointDescriptionExample(s)
/{sbjType}Info on a subject namespace./cgAllele
/{sbjType}/namespace/{aliasType}Info on an alias namespace./cgAllele/namespace/imgtAcc
/namespaceAdditional info on all namespaces.

B.1 Fields in API response ​

FieldDescription
iriIRI of the data type in the service.
sbjTypeSubject type.
sbjCountNumber of subject records in the namespace.
avg.aliasPerEntAverage number of aliases per subject in the namespace.
alias.aliasCountNumber of alias records in an alias namespace.
alias.avg.sbjPerEntAverage number of subjects per alias 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 /{sbjType} (e.g., /cgAllele)
json5
{
  "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)
json5
{
  "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.

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

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 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"

BIOINFORMATICS RESEARCH LABORATORY