kit-data-manager / pit-service

Typed PID Maker – Create, resolve and modify PIDs with typed constraints, e.g. for FAIR DOs.
https://kit-data-manager.github.io/webpage/typed-pid-maker/index.html
Apache License 2.0
3 stars 4 forks source link

Add DOIP interface #148

Open Pfeil opened 1 year ago

Pfeil commented 1 year ago

Is your feature request related to a problem? Please describe.

DOIP could be one way to increase compatibility with clients.

Describe the solution you'd like

In order to synchronize the security layer of the Typed PID Maker REST interface with DOIP, DOIP over REST would be a good start.

Describe alternatives you've considered

Additional context

Pfeil commented 1 year ago

LIST_OPERATIONS

with FAIR DO context / endpoint:

implementation detail, needed for DOIP->FAIRDO->LIST_OPERATIONS

ThomasJejkal commented 1 year ago

This operation is implicitly part of DOIP. There is a standard operation performed on a given PID to list all supported operations. Thus, any kind of complexity to determine these operations can be hidden.

Pfeil commented 1 year ago

I am confused about the structure of the FAIR DOs. If I do this operation on the DTR like this:

curl --request GET \
  --url 'https://dtr-test.pidconsortium.net/doip?operationId=0.DOIP%2FOp.Retrieve&targetId=21.T11148%2Fb9b76f887845e32d29f7'

I get the following response:

{
    "id": "21.T11148/b9b76f887845e32d29f7",
    "type": "KernelInformationProfile",
    "attributes": {
        "content": {
            "identifier": "21.T11148/b9b76f887845e32d29f7",
            "name": "HelmholtzKIP",
            "description": "Draft Kernel Information Profile used within the Helmholtz Metadata Incubator Platform (HMC).",
            "provenance": ...
            "expectedUses": ...
            "representationsAndSemantics": ...
            "properties": ...
        },
        "acl": {
            "writers": [
                "21.T11148/dc132326d510091661c0",
                "21.T11148/97a37cc7ae18266fd8e3"
            ]
        },
        "metadata": {
            "createdOn": 1583416068915,
            "createdBy": "21.T11148/fc3224b0abc8b35bd3cb",
            "modifiedOn": 1690904854192,
            "modifiedBy": "21.T11148/dc132326d510091661c0",
            "txnId": 1690904854190390
        }
    }
}

As you can see, the data (the actual profile definition in the DTR) is in attributes.content. Reading the specification, I thought the object should be one of the elements or so, because the specification says about the attributes: "attributes (optional): one or more fields (key-value pairs) serialized as a JSON (sub) object." (Appendix A). Now I am confused what to put where.


What do you think how we should handle this? My proposal:

But: This is kind of different of how cordra does it, it seems.

ThomasJejkal commented 1 year ago

I think the response fully fits the spec. It consists of key-value pairs which have complex values. This is also how I did it for base-repo. The keys are not further specified. If it comes to the data, the TCP-based implementation has payload streams attached. Not sure how this is covered via the Rest adapter.

Pfeil commented 1 year ago

But assuming my DO would be an image, wouldn't it be an element instead of an attribute? What do you think how I should do it? Is it even specification conform to re-use create (or other CRUD operations)? Because we do not input the digital objects in every sense, but only make them such by registering a PID record. Should I handle the record as if it would be the digital object itself?