Provenance

Provenance library for MATLAB

Provenance library for MATLAB

Provenance provides an implementation of the PROV Data Model in MATLAB. It provides serialization in PROV-N, PROV-JSON and RDF (Turtle and PROV-JSONLD), as well as export in graphical formats (PDF, SVG, PNG) through Graphviz.

See also:

Download

This library is also part of SPM.

Installation

Simply unzip the archive and add the provenance directory to the MATLAB path.

Example

Using this example from PROV-DM: a document is edited by some editor, using contributions from various contributors.

>> p = provenance;
>> p.add_namespace('ex', 'http:/example/');
>> p.add_namespace('tr', 'http://www.w3.org/TR/2011/');
>> p.entity('tr:WD-prov-dm-20111215',{'prov:type','document','ex:version','2'})
>> p.activity('ex:edit1',{'prov:type','editing'});
>> p.wasGeneratedBy('tr:WD-prov-dm-20111215','ex:edit1');
>> p.agent('ex:Paolo',{'prov:type','prov:Person'});
>> p.agent('ex:Simon',{'prov:type','prov:Person'});
>> p.wasAssociatedWith('ex:edit1','ex:Paolo',{'prov:role','editor'});
>> p.wasAssociatedWith('ex:edit1','ex:Simon',{'prov:role','contributor'});

>> serialize(p,'provn')
ans =

document
  prefix ex <http:/example/>
  prefix tr <http://www.w3.org/TR/2011/>

  entity(tr:WD-prov-dm-20111215,
    [prov:type = "document",
    ex:version = "2"])
  activity(ex:edit1,
    [prov:type = "editing"])
  wasGeneratedBy(tr:WD-prov-dm-20111215, ex:edit1, -)
  agent(ex:Paolo,
    [prov:type = 'prov:Person'])
  agent(ex:Simon,
    [prov:type = 'prov:Person'])
  wasAssociatedWith(ex:edit1, ex:Paolo, -,
    [prov:role = "editor"])
  wasAssociatedWith(ex:edit1, ex:Simon, -,
    [prov:role = "contributor"])
endDocument

>> serialize(p,'example.provn');
>> serialize(p,'example.json');
>> serialize(p,'example.ttl');
>> serialize(p,'example.jsonld');
>> serialize(p,'example.pdf');
>> serialize(p,'example.png');
Provenance of a Document in MATLAB