Skip to content

Reporting provenance using a JSON file

Hasanat Kazmi edited this page Feb 11, 2016 · 16 revisions

A user can deploy JSON reporter shipped along with SPADE to report already collected provenance information. In order to use JSON reporter, a user has to specify a valid JSON file whereas provenance information in a JSON file shall follow following format:

JSON content shall contain exactly one list of dictionaries. Each dictionary represents either a vertex or edge. Keys and expected values of these dictionaries are following.

key for vertex for edge expecting value
"type" required required Value must be defined as a type in W3C PROV-N or W3C PROV-O. Dictionary is ignored otherwise
"annotations" not required not required dictionary of annotations to put on vertex or edge. Repeated keys in dictionary are ignored. Each value must be either string or numeric - otherwise that annotation is ignored
"id" required ignored unique id that is later used to identify the vertex when reporting an edge. A vertex with repeated "id" is ignored
"from" ignored required "id" of vertex from where edge is originating
"to" ignored required "id" of vertex from where edge is terminating

All other keys will be ignored.

Following is an example of valid JSON file for JSON reporter:

[
    {
        "annotations": {
            "day": 21, 
            "month": 1, 
            "site": "another annotation", 
            "title": "My Title", 
            "year": 2015
        }, 
        "id": 1, 
        "type": "Agent"
    }, 
    {
        "annotations": {
            "email": "wow@email.com"
        }, 
        "id": 2, 
        "type": "Agent"
    }, 
    {
        "annotations": {}, 
        "from": 1, 
        "to": 2, 
        "type": "ActedOnBehalfOf"
    }
]

The JSON reporter is compiled along with SPADE. This reporter takes a single argument, which is the location in the filesystem where the JSON file is to be saved. Note that this must be done in the SPADE controller (after the SPADE server has been started):

-> add reporter JSON /tmp/provenance.json
Adding reporter JSON... done

Similarly, after JSON data has been processed, a user can remove JSON reporter:

-> remove reporter JSON
Shutting down reporter JSON... done
Clone this wiki locally