Skip to content

PID-TESTING@ufz

Kotyba Alhaj Taha requested to merge PID_at_ufz into develop

What is done in This MR:

We have now flowing endpoint:

  • /pids: list and post
  • /pids/<pid_without_handler> get, search, update and delete

Create a PID

A PID will be created and saved automatically to the corresponding entity in the database.

First method

Send a request to the pids with instrument data

Instrument Data is a list of dictionaries, which should have all flowing attributes:

  • type: required: The data type defines the syntax and semantics of the data in its data field.
  • source_object_url: required: A landing page that the identifier resolves to.
  • id: required: Unique string that identifies the instrument instance.
  • identifier_type: required: Type of the identifier.
  • schema_version: required: Version number of the PIDINST schema used in this record
  • contact_email: required: contact_email name of the owner.
  • given_name: required: given_name name of the owner.
  • family_name: required: family_name name of the owner.
  • manufacturer_uri: The instrument's manufacturer(s) or developer. This may also be the owner for custom build instruments.
  • manufacturer: required: Full name of the manufacturer.
            {
            "instrument_data": {
                "source_object_url":"https://localhost.localdomain/devices/1",
                "type": "device",
                "id": "1",
                "identifier_type": "Handel",
                "schema_version":"0.1",
                "short_name":"TID1",
                "contact_email":"alhajtah@ufz.de",
                "given_name":"Kotyba",
                "family_name":"Alhaj Taha",
                "manufacturer_uri":"https://localhost.localdomain/cv/manufacturers/10000",
                "manufacturer_name":"DIY"}
            }

Second method

Send a request with the id of the entity and the backend will fill the attributes.

instrument_instance is a dictionary which hast exactly three attributes to choose the right entity from database.

  • type: required: The type od the entity ∈ = {"device", "platform"}
  • id: required: The id of the entity.
  • source_uri: required: landing page of the entity.
           {
                "instrument_instance":{
                    "type":"device",
                    "id": "1",
                    "source_object_uri": "https://localhost/devices/1"
                }
            }
Edited by Kotyba Alhaj Taha

Merge request reports

Loading