CRISalid-esr / crisalid-ikg

CRISalid institutional knowledge graph
Other
0 stars 0 forks source link

Submission of an unauthorized structure identifier type in model #60

Closed s-marcq closed 1 week ago

s-marcq commented 2 weeks ago

Scenario

An identifier is added to a structure node, but it is not an authorized identifier type according to the IKG model.

Data sent

Creation of structure

{
  "structures_event": {
    "type": "created",
    "data": {
      "names": [
        {
          "value": "Laboratoire toto",
          "language": "fr"
        },
        {
          "value": "Foobar Laboratory",
          "language": "en"
        }
      ],
      "acronym": "FL",
      "descriptions": [
        {
          "value": "Un laboratoire de recherche fictif",
          "language": "fr"
        },
        {
          "value": "An imaginary laboratory",
          "language": "en"
        }
      ],
      "contacts": [
        {
          "type": "postal_address",
          "format": "structured_physical_address",
          "value": {
            "country": "France",
            "zip_code": "75005",
            "city": "PARIS",
            "street": "Sorbonne, 1 rue de la Sorbonne"
          }
        }
      ],
      "identifiers": [
        {
          "type": "local",
          "value": "U123"
        },
        {
          "type": "RNSR",
          "value": "200012123S"
        },
        {
          "type": "ROR",
          "value": "123456"
        }
      ]
    }
  }
}

Update

{
  "structures_event": {
    "type": "updated",
    "data": {
      "names": [
        {
          "value": "Laboratoire toto",
          "language": "fr"
        },
        {
          "value": "Foobar Laboratory",
          "language": "en"
        }
      ],
      "acronym": "FL",
      "descriptions": [
        {
          "value": "Un laboratoire de recherche fictif",
          "language": "fr"
        },
        {
          "value": "An imaginary laboratory",
          "language": "en"
        }
      ],
      "contacts": [
        {
          "type": "postal_address",
          "format": "structured_physical_address",
          "value": {
            "country": "France",
            "zip_code": "75005",
            "city": "PARIS",
            "street": "Sorbonne, 1 rue de la Sorbonne"
          }
        }
      ],
      "identifiers": [
        {
          "type": "local",
          "value": "U123"
        },
        {
          "type": "RNSR",
          "value": "200012123S"
        },
        {
          "type": "Invalide",
          "value": "blabla"
        },
        {
          "type": "ROR",
          "value": "123456"
        }
      ]
    }
  }
}

Expected result

Error

Observed result

Error in the terminal : "Input should be 'IdRef', 'ROR', 'RNSR' or 'local' [type=enum, input_value='invalide', input_type=str]"