ATTX-project / provenance-service

ATTX Provenance service for exposing provenance related information.
1 stars 1 forks source link

ProvenanceMessage: Document provenance message structure #5

Closed jkesanie closed 7 years ago

jkesanie commented 7 years ago

Description

We have at least two use cases: message based protocol that creates little bit of provenance and the REST api case that can be used to create more complex documents. This means that we might need to have minimum structure and full structure.

DoD

JSON schema.

Testing

jkesanie commented 7 years ago

First version:

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "definitions": {},
    "id": "http://example.com/example.json",
    "properties": {
        "payload": {
            "properties": {},
            "type": "object"
        },
        "provenance": {
            "properties": {
                "activity": {
                    "properties": {
                        "communication": {
                            "items": {
                                "properties": {
                                    "input": {
                                        "type": "object"
                                    },
                                    "role": {
                                        "type": "string"
                                    }
                                },
                                "required": [                                    
                                    "role"
                                ],
                                "type": "object"
                            },
                            "type": "array"
                        },
                        "description": {
                            "type": "string"
                        },
                        "endTime": {
                            "type": "string"
                        },
                        "startTime": {
                            "type": "string"
                        },
                        "status": {
                            "type": "string"
                        },
                        "title": {
                            "type": "string"
                        },
                        "type": {
                            "type": "string"
                        }
                    },
                    "type": "object"
                },
                "agent": {
                    "properties": {
                        "ID": {
                            "type": "string"
                        },
                        "role": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "role",
                        "ID"
                    ],
                    "type": "object"
                },
                "context": {
                    "properties": {
                        "activityID": {
                            "type": "integer"
                        },
                        "stepID": {
                            "type": "integer"
                        },
                        "workflowID": {
                            "type": "integer"
                        }
                    },
                    "required": [
                        "workflowID",
                        "stepID",
                        "activityID"
                    ],
                    "type": "object"
                },
                "input": {
                    "type": "object"
                },
                "output": {

                    "type": "object"
                }
            },
            "type": "object"
        }
    },
    "required": [
        "provenance",
        "payload"
    ],
    "type": "object"
}
jkesanie commented 7 years ago

Example where the schema was generated from:

{
  "provenance" : {
    "context": {
      "workflowID": 1,
      "activityID": 1,
      "stepID": 1
    },
    "agent": {
      "ID": "agentID",
      "role": "agentRole"      
    },
    "activity": {
      "title": "activity title",      
      "type": "step",
      "description": "description",
      "status": "SUCCESS",
      "startTime": "2017-08-02T13:52:29+02:00",
      "endTime": "2017-08-02T13:52:29+02:00",
      "communication": [
        {          
          "role": "transformer",
          "input": {
            "frame": {
              "role": "Configuration"
            },
            "inputGraphs": {
              "role": "inputGraphs"
            }
          }
        }
      ]
    },
    "input": {
      "inputGraphs": {
        "role": "inputGraphs"
      }    
    },
    "output": {
      "outputGraphs": {
        "role": "outputGraphs"
      }
    }
  },  
  "payload": {
    "inputgraphs": "attx:dataset1",    
    "outputGraphs": "http://platform/public/rest/documents"

  }
}
blankdots commented 7 years ago

Added the message structure to https://github.com/ATTX-project/ATTX-project.github.io/blob/dev/attx_project/Provenance-Service.md - the schema will be used in the implementation.

jkesanie commented 7 years ago

Example of generated IDs:

attx:workflow1_activity1_step1
    a prov:Activity, attxonto:Step ; // from stepID
    dcterms:title "Transform RDF" ;
    prov:startedAtTime  "X"^^xsd:dateTime ;
    prov:qualifiedAssociation [
        a prov:Association ;
        prov:agent attx:UV ;
        prov:hadRole attx:ETL ;
    ] ;
    prov:used attx:dataset1 ;
    prov:generated <file://file.with/json-result.json> .

attx:workflow1_activity1_step1
    prov:qualifiedCommunication [
      a prov:prov:Communication ;
      prov:activity attx:workflow1_activity1_step1_Framer 
    ] ;

// receiver used something
attx:workflow1_activity1_step1_Framer
  a prov:Activity ;
  prov:used
    attx:workflow1_activity1_step1_Framer_used_frame ;
    attx:workflow1_activity1_step1_Framer_used_inputgraphs ;

  prov:qualifiedCommunication [
    a prov:prov:Communication ;
    prov:activity attx:workflow1_activity1_step1_GMAPI ;
  ] ;

  prov:generated
    attx:workflow1_activity1_step1_Framer_gen_graph_content_URI ;

// receiver used something
attx:workflow1_activity1_step1_GMAPI
  a prov:Activity ;
  prov:used
    attx:workflow1_activity1_step1_GMAPI_used_inputgraphs ;

  prov:generated
    attx:workflow1_activity1_step1_GMAPI_gen_graph_content_URI ;