esmero / strawberryfield

A Field of strawberries
GNU Lesser General Public License v3.0
10 stars 5 forks source link

Keep track of the User generating a Metadata change inside strawberryfield #18

Closed DiegoPino closed 3 weeks ago

DiegoPino commented 5 years ago

USE CASE

we right now do a good initial attempt on keeping track of provenance (not sure if the right word) of data inside a strawberryfield by adding this

"as:generator": {
        "type": "Update",
        "actor": {
            "url": "http:\/\/localhost:8001\/form\/descriptive-metadata",
            "name": "descriptive_metadata",
            "type": "Service"
        },
        "endTime": "2019-04-15T15:30:33-04:00",
        "summary": "Generator",
        "@context": "https:\/\/www.w3.org\/ns\/activitystreams"
    },

But we are depending on the Drupal's node data (uid) to keep track of who did (human?, machine?) the actual action of updating. We need to make sure we allow a new structure that fits https://www.w3.org/TR/activitystreams-vocabulary/#actor-typesto keep track of the user and bring significant data into that structure so the info becomes a bit more independent of the current Drupal instance (e.g don't use uid:1, makes little sense out of this D8 context)

QUESTION

What data about an user or API or machine interaction is good enough to make the JSON self sustainable?

Tagging here @kllhwang since she came with this very very needed use case. Thanks!

alliomeria commented 3 years ago

Hi @DiegoPino, following up on our discussion the other day about activity streams. Not sure if this is in line with what you are thinking for user tracking ("good enough" interaction imho are any CRUD interactions), but perhaps something like the following:

"as:generator": {
        "type": "Update",
        "actor": [
    {
            "url": "http:\/\/localhost:8001\/form\/descriptive-metadata",
            "name": "descriptive_metadata",
            "type": "Service"
        }
    {
            "url": "http:\/\/localhost:8001\/user\/1",
        "name": "myCoolArchipelagoUsername",
            "type": "Person"
        }
    ],
        "endTime": "2019-04-15T15:30:33-04:00",
        "summary": "Generator",
        "@context": "https:\/\/www.w3.org\/ns\/activitystreams"
    },

For AMI sets (as you are thinking for future AMI "actor" pattern) too...

"as:generator": {
        "type": "Create",
        "actor": [
    {
            "url": "http:\/\/localhost:8001\/amiset\/4",
            "name": "amiset4",
            "type": "Service"
        },
    {
            "url": "http:\/\/localhost:8001\/user\/1",
        "name": "myCoolArchipelagoUsername",
            "type": "Person"
        }
    ],
        "endTime": "2021-03-23T11:08:46-04:00",
        "summary": "Generator",
        "@context": "https:\/\/www.w3.org\/ns\/activitystreams"
    },

(Feel the user "url" info is not quite right/as it ought to be in these tentative examples, meant to be illustrative only)

DiegoPino commented 3 weeks ago

Implemented. But we want to revisit this to allow multiple ones (array) in the future