Installing ProvToolbox in Windows

While there are several tools available for validating and visualizing PROV, the ProvToolbox is perhaps the most useful for validating PROV-N syntax. However, the normal releases does not run in Windows due to a operating system restriction for command line and folder path length.

We have suggested a fix, but while we wait for that below we describe a patch build that should work on Windows. You will also need Java for executing ProvToolbox, and Graphviz for visualization.

Install Java for Windows

You will need Java JRE 9 or later to run ProvToolbox 0.9.5, so below we show how to install JRE 11 LTS on Windows. Do not install from java.com as that provides the older Java 8, which unfortunately do not work with this ProvToolbox release.

Unfortunately there are quite a few alternatives for installing Java in Windows:

Oracle provide installers of JDK 11 for Windows x64, however they are distributed under a restrictive license you or your organization may have reservations against using. These are however straight forward to install if you only want to run ProvToolbox for personal or development use.

The official open source release of OpenJDK 11 for Windows do not provide an installer, and are fairly large. If you choose to install this you will need to modify your PATH system environment variable manually depending on where you extract the folder jdk-11 to.

Alternatively RedHat provide OpenJDK installers based on the open source JDK, we would recommend jre-11.0.9.1-x64 MSI or newer. The MSI packages are installable by double-click in newer versions of Windows. You will need to create a RedHat account to download.

Finally, AdoptOpenJDK is a community project for providing user-friendly open source builds of Java. We found option this to be the easiest to install in Windows, as they provide a MSI installer of the smaller JRE distribution, and do not require registration. However the website needs some help navigating as they provide many alternatives.

Installing AdoptOpenJDK

We recommend this open source option for installing Java for Windows users.

From https://adoptopenjdk.net/ select Other Platforms, giving the full list of downloads. Make sure you select:

  • Version: Open JDK 11 (LTS)
  • JVM: HotSpot
  • Operating System: Windows
  • Architecture: x64 (64-bit Windows)
    • If you use 32-bit Windows, say on an older or smaller machine, try x86 instead

Download the JRE as a MSI installer (the ZIP file does not include an installer).

Before you open the MSI you may need to change the Windows Store settings to allow installing applications. From the start menu type Add or Remove Programs to open the Settings pane for Choose where to get apps. Select Anywhere.

Now double-click the MSI file from the Download folder and walk through the Installer. Enable the “Set JAVA_HOME environment variable” option.

Now open the Command Prompt window:

Run java -version to check you now got OpenJDK 11 installed on the PATH.

Install ProvToolbox (patched)

Now we will install ProvToolbox 0.9.5 including the suggested fix so it runs in Windows. Until this fix has been accepted, for now we’ll use the ProvToolbox 0.9.5 for Windows patch release from the fork https://github.com/stain/ProvToolbox/.

Download provconvert-0.9.5-windows.zip and, after opening, click Extract All:

Shorten the path to install the folder to your home directory, e.g. C:\Users\stain

You should now have a folder ProvToolbox in your home directory:

You should now be able to run ProvToolbox\bin\provconvert from the Command Prompt open in your home directory:

Note that if you change the directory with cd you will need to modify the path to provconvert. To avoid that we’ll add it to the System Environment Variable PATH. In the Start menu, type PATH and select Settings -> Edit the system environment variables.

Click System Environment, then under User variables select PATH and click Edit. (If not found, click New and set Variable Name as PATH). Add a new line (or set Variable Value) where you can use Browse to navigate to find the full path of the ProvToolbox\bin folder:

After applying the settings with OK you will need to close and restart the Command Prompt window. This time provconvert -version should work from any path.

Install Graphviz for Windows

ProvToolbox can also generate visualization, but for this we need to install the open source tool Graphviz.

Following the link for downloading Stable Windows Install Packages we are unfortunately thrown into an undocumented directory browsing. We found that the cmake/Release/x64 installer worked well on 64-bit Windows (for older 32-bit Windows, try Win32).

You will need to allow the unsifned package to install

When running the install wizard for GraphViz, make sure you enable to add GraphViz to the system PATH for the current user:

Close and restart the Command Prompt Window. This time dot -V (notice capital) should work:

Unfortunately the installer of GraphViz does not initialize the plugins for graphical formats. To fix this we need to open another Command Prompt, but running as Administrator:

In this window, run dot -c to initialize the GraphViz plugins.

Installing Visual Studio Code

VSCode is a free and lightweight text editor which is useful for writing *.provn files. The User Installer for 64-bit Windows should work for most users.

Note: After installing VSCode you will need to Restart Windows to pick up the updated PATH for ProvToolbox.

Running provconvert from VSCode

Remember to save PROV-N files (example) with the extension .provn so that ProvToolbox can recognize the file type. The first time you may need to select No Extension and add .provn yourself to the filename.

In VSCode’s menu, select Terminal -> New Terminal, an embedded command prompt should open in the correct directory. Check with dir *.provn that the file is present with the correct name.

You should now be able to convert the provn file to a PNG image, in our example using the command:

provconvert -infile alice.provn -outfile alice.png

You will be able to navigate and open the PNG image within VSCode. See validating and visualisation for details.

If you have made a syntactical error in the PROV-N file, then provconvert report errors by line numbers, which you can recognize within the VSCode editor. Note that VSCode has no native PROVN support and so its Problems tab is currently unable to detect these errors.

Remember an error early in the file, such as a broken prefix, or a missing ), may cause phantom errors to be reported later in the file.

Attribution vs association

A valid question when writing provenance in responsibility view and process view is:

Should we attribute contributors from entities, isn’t that what the activities are showing?

Specially when roles it may seem unnecessary to also declare wasAttributedTo statements.

It is true that you can conclude from:

wasAttributed(ex:entity, ex:agent)

then there was some activity X such that:

wasGeneratedBy(ex:entity, X)
wasAssociatedWith(X, ex:entity)

This conclusion follows from the constraint on agents and the definition of wasAttributedTo.

However you can’t conclude the opposite directions – someone might be associated with an activity but not be responsible for a particular entity generated by that activity.

Imagine three family members writing Christmas cards:

activity(ex:WritingCards)

wasAssociatedWith(ex:Alice, ex:WritingCards, prov:role=['ex:Writing'])
wasAssociatedWith(ex:Bob, ex:WritingCards, prov:role=['ex:Writing'])
wasAssociatedWith(ex:Charlie, ex:WritingCards, prov:role=['ex:Addressing'])

entity(ex:cardToEve)
entity(ex:cardToFrank)
entity(ex:cardToMalory)

wasGeneratedBy(ex:cardToEve, ex:WritingCards)
wasGeneratedBy(ex:cardToFrank, ex:WritingCards)
wasGeneratedBy(ex:cardToMalory, ex:WritingCards)

Now from this we may want to give the cards attribution to the individual agents, and while we can perhaps assume Charlie has written the address on all the cards, we don’t know if it was Alice or Bob who
wrote the particular card going to Frank.

We therefore can add more specifically:

wasAttributedTo(ex:cardToEve, ex:Alice)
wasAttributedTo(ex:cardToFrank, ex:Alice)
wasAttributedTo(ex:cardToMalory, ex:Bob)

.. and for completeness:

wasAttributedTo(ex:cardToEve, ex:Charlie)
wasAttributedTo(ex:cardToFrank, ex:Charlie)
wasAttributedTo(ex:cardToMalory, ex:Charlie)

This highlights that responsibility view and process view can complement each other.

It is part of our modelling to decide what is considered “work height” in terms of attributions. Perhaps we should not consider Charlie putting on addresses as part of writing the cards, if what mattered was the personalized message, not how the cards were posted.

It is possible to also assign prov:type to wasAttributedTo relations, e.g. ex:authorship, but this can easily become overlapping with the roles in associations with the corresponding activity. This is perhaps more useful when the activity is not explicitly declared, or we want to declare explicit contributor roles using metadata models like CRediT.

Multiple agents sharing roles

Assuming the task of writing provenance for a student group exercise, consider the question:

Do we need to assign everyone in the group a specific role since in our group we found that for many of the tasks, everyone worked together to complete it?

If you all worked together without distinguishing roles, then you can either assign the same role to each agent (showing you shared that role) or not have any roles.

prefix ex http://example.com/
prefix terms http://example.com/terms#
agent(ex:Alice)
agent(ex:Bob)
activity(ex:writingCards, [prov:type='terms:CardWriting'])
wasAssociatedWith(ex:Alice, ex:writingCards,
                  [prov:role='terms:Writing'])
wasAssociatedWith(ex:Bob, ex:writingCards,
                  [prov:role='terms:Writing'])

While the role terms:Writing above does not really tell us much as the activity is already of type terms:CardWriting, the distinction is somewhat that not saying the role is “We don’t know / didn’t say what work they did” while explicit role is saying “They did the same work, but we have not broken it down further“.

In a way a role is a short-circuiting device to avoid having infinite recursion into very tiny activities – it allows multiple things to happen in the same activity.

Let’s say Charlie helped with putting addresses on the envelopes, in our simple one-activity modelling we can associate them with a separate role:

wasAssociatedWith(ex:Charlie, ex:writingCards, 
    prov:role=['terms:Addressing'])

Now we know who to blame if the cards end up on the North pole!

It is a modelling question to use a single activity with multiple agents associated, potentially with different roles; or to use multiple activities with simpler associations, perhaps not needing roles. One thing to keep in mind is that more activities will also need more entities to represent the different states, e.g. ex:unwrittenCard1, ex:writtenCard1, ex:addressedCard1.

Groups

Rather than associating multiple agents to a single activity it is possible to make a new agent that represent the whole group, in which case it is a choice to not break down to individual engagement.

For instance this would be correct if recording a board room decision, where the group of Alice, Bob and Charlie together decided/stated something they may agreed with or be responsible for individually.

PROV does not itself define how to specify the make-up of groups – but
it has agent types prov:Person, prov:Organization and
prov:SoftwareAgent that you can assign using prov:type.

A student group might not sound like an organization, but it is the
closest match of the three. We also see that there is an equivalent type Organization in the schema.org vocabulary, with looser sub-types including PerformingGroup (a band or orchestra), Project (someone working towards a shared goal) or even CollegeOrUniversity (the University as a whole).

While PROV literature does not cover well how to use external vocabularies like schema.org, we can take advantage of such types and attributes in PROV-N and express group membership using schema.org/member, adding a parentOrganization relation to the University for good measure.

prefix s <http://schema.org/>
prefix ex <http://example.com/>

agent(ex:UoM, [prov:label="University of Manchester",
               prov:type='prov:Organization',
               prov:type='s:CollegeOrUniversity'])

agent(ex:RedGroup, [prov:label="Red Group",
                    prov:type='prov:Organization',
                    prov:type='s:Project',
                    s:member='ex:Alice',
                    s:member='ex:Bob',
                    s:parentOrganization='ex:UoM'])

The keen reader will notice that the above example repeats some attribute names to express multiple relations of prov:type and s:member – both of these are unordered.

Collections

As an alternative, PROV has the concept of Collections.

Although collections are mainly used for describing compound entities, such as a dataset containing samples, as agents can concurrently be entities
they could also be used for showing group members.

Tip: Treating a agent as an entity can be of interest if your provenance need to show its evolution over time, for instance changes to group membership. In this case, note that you will need multiple agent identifiers depending on which “version” of the group was associated with particular activities across time, or use specialization to make a “timeless” entity.

Using prov:Collection would perhaps feel more PROV native than schema.org use above, but without any additional attributes like parentOrganization:

prefix ex <http://example.com/>

agent(ex:Red, [prov:type='prov:Organization'])
entity(ex:Red, [prov:type='prov:Collection'])

hadMember(ex:Red, group:Alice)
hadMember(ex:Red, group:Bob)

This choice between vocabularies is I’m afraid part of data modelling — there will never be a single perfect metadata model, and so we have to either pick the one that is most useful, or find a way to combine both approaches. (Although verbose, the above should work both ways)

Sometimes two metadata models can be in conflict in terms of granularity, in which case you should use different identifiers, in some cases even different documents.

What are good PROV-N prefixes?

Most examples of PROV-N use example prefixes like:

prefix ex <http://example.com/>
prefix exg <http://example.org/government>

These example domains are explicitly reserved globally for all kinds of examples and training material, and deliberately do not have any content, advertisement or affiliations.

Assume you are writing the provenance of a student group exercise, should you be using the prefix/namespace ex and example.org to define agents/entities/relationship and your own attribute types?

You can keep using example.org, but ideally you should define your
own namespace based on a Web URL you “control” or “own”. This would make your Linked Data identifiers globally unique.

Students at The University of Manchester can publish their own home pages, and luckily most universities still provide a similar facility. Our students can search up themselves on https://personalpages.manchester.ac.uk/ and find for instance that they are http://personalpages.manchester.ac.uk/postgrad/alice.davidson/ which means they could make any sub-page under that directory.

Now the page does not need to exist – this blog is not about making Web pages – it is just important that it could exist at that address – that means it is that person’s identifier space.

So we could imagine that Alice made two files under her directory:

  • http://personalpages.manchester.ac.uk/postgrad/alice.davidson/terms
    Imagine this was a page defining new terms to be used in PROV
  • http://personalpages.manchester.ac.uk/postgrad/alice.davidson/groupExercise
    Imagine this page was the group exercise as text (which provenance is described by PROV), or the PROV-N file itself (self-describing)

In real life you would also have to deal with file extensions like .html or server configuration for content types, see Tim Berners-Lee’s Cool URIs don’t change for further considerations.

As above it is considered good practice to separate the prefix/namespace for new roles/attributes that you define vs specific agents/entities in one particular provenance trace. The idea being that the general terms could be reused in multiple provenance documents with the same meaning.

So let’s map in the above documents as namespaces in PROV-N:

prefix terms <http://personalpages.manchester.ac.uk/postgrad/alice.davidson/terms#>
prefix group <http://personalpages.manchester.ac.uk/postgrad/alice.davidson/groupExercise#>

The prefix string usually is a short name somewhat matching the address, it just needs be unique and consistent within the same PROV document. Other documents can freely map the same namespace to a different prefix.

A diligent reader might notice the # at the end of the namespace – this “fragment” is in Web documents used to indicate a subsection or heading within the same file.

This is so that terms:student expands to
<http://personalpages.manchester.ac.uk/postgrad/alice.davidson/terms#student>
rather than end with alice.davidson/termsstudent – even if we have not made the pages now we would not want to make a separate page for each word.

In some cases separate pages are desirable, in which case the namespace
ends in / to mark a directory – for instance s:Person becomes
http://schema.org/Person as schema.org have decided their term list is too big to keep in a single page.

Now we can use these prefixes for identifying
agents/entities/activities, as well as using our own attributes, roles
and types.

agent(group:Alice, [prov:type='prov:Person',
                    terms:favouriteDay="Monday"])

wasAssociatedWith(group:Alice, group:studying,
                  [prov:role='terms:Reader']) 

It is customary that attributes start with lower case after :, while
types/roles start with Capital – but this is just stylistic.

As for entity identifiers, your terms and roles should not have spaces or special characters in them as they must be combineable with the namespace to a valid URI, e.g. camel case favouriteDay or underscore favourite_day

It is possible in PROV-N (but not easily in other PROV syntaxes) to use freehand roles/types strings like prov:role="Writing carefully" – these are kind of anonymous and cannot be assumed to mean the same thing across multiple PROV documents.

In many cases there is no suitable URI yet, in which case using a temporary namespace like http://example.com/yourthing is perfectly valid as a working example, just be aware of the risk of other people having the same namespace idea!

Validating and visualising PROV

One of the advantages of W3C PROV having a common data model is that it can be serialized, or written out, in multiple file formats. The PROV family of W3C specifications describe mappings PROV-XML and PROV-O (which, being based on OWL2 itself has multiple serializations, for Linked Data including RDF formats Turtle and JSON-LD.

In addition to these standard approaches we also have PROV-JSON and PROV-JSONLD which could be well-suited for Web applications. All of these can in theory be mapped to each-other through the common PROV Data Model and the use of URIs as Linked Data global identifiers.

PROV-N

PROV also specifies its own language, PROV-N, a text-based file format that most closely represent the PROV Data Model. This representation is used by the PROV Primer to explain the PROV types (entity/agent/activity) and their relationships (e.g. wasAttributedTo). For example:

document
  prefix ex <http://example.com/>
  prefix s <http://schema.org/>
  
  entity(ex:regionList)
  entity(ex:dataset, [ prov:type='s:Dataset' ])
  entity(ex:composition)
  
  activity(ex:composing, [ prov:type='ex:Composing', 
     prov:label="Composing region and data" ])

  agent(ex:derek,
       [ prov:type='prov:Person', s:givenName="Derek", 
         s:email="derek@example.org" ])

  used(ex:composing, ex:dataset, 2011-11-16T16:00:00)
  used(ex:composing, ex:regionList, -)
  
  wasGeneratedBy(ex:composition, ex:composing,
                 2011-11-16T16:45:00)
  
  wasAssociatedWith(ex:composing, ex:derek, -)
  wasAttributedTo(ex:composition, ex:derek)

endDocument

The above PROV-N can be rendered as a diagram:

Let’s go through the PROV-N line by line:

  • prefix maps ex to the URI namespace starting with http://example.com/
    • PROV identifiers like ex:dataset1 can be expanded to a Linked Data global identifier http://example.com/dataset1 (which in an ideal world would describe or perhaps let you download the dataset)
    • External vocabularies like schema.org can be reused, e.g. the property 's:givenName' expands with the prefix s: to form the URI http://schema.org/givenName
    • prefix prov <http://www.w3.org/ns/prov#> is implicit, and is the internal namespace for PROV types and attributes.
    • Tip: It is possible to declare default <http://example.com/> after which ex:regionList can be shortened to regionList, however it is recommended to always use explicit prefixes to ease reuse and combination of PROV-N files.
  • entity(ex:regionList) declares the existence of an entity with that identifier. It can thereafter be used in relationships expecting an entity.
  • The entity ex:dataset is similarly declared, but also assigning a more specific type, using http://schema.org/Dataset from the external vocabulary.
  • The activity ex:composition is typed using an ad-hoc type ex:Composing from our own namespace, but also adds a string attribute to give a more descriptive label.
  • The agent identified as ex:derek is described with attributes from schema.org/Person
  • Relationships like used goes backwards in time
    • The activity ex:composing used the pre-exsting entity ex:dataset.
    • The usage happened on 16 Nov 2011 at 16:00 (given in ISO8601 date-time format)
  • The second use, this time of ex:regionList, has a placeholder - indicating that the required PROV-N argument for date-time is unknown.
  • The relationship wasGeneratedBy also points backwards in time, the new entity ex:composition was generated by the activity ex:composing some time later, at 16:45.
  • wasAssociatedWith indicates that our agent Derek took part in the ex:composing activity, with placeholder – as we don’t know when.
  • wasAttributedTo says Derek was (at least partially) invovled in generating the composition.

Some subtleties about PROV-N worth mentioning:

  • Like other Linked Data representations, PROV has an open world assumption, meaning that statements given may be a partial description of the actual provenance.
    • Additional statements carrying new knowledge can always be added, as long as they don’t break semantic constraints.
  • Statements can be listed in any order
    • It is convention to use a chronological partial order old…new so that the last lines in PROV represent the newest events.
  • Entities, Agents and Activities should be explicitly declared as such.
    • By convention declarations can be grouped together towards the top (as in above example)
    • Alternatively, a declaration can be listed just before the first reference to its identifier in other statements.
    • If a relationship is not showing up in PROV visualization, ensure it has the correct declaration.
  • Identifiers are globally unique according to the prefix mapping to URI namespaces.
    • Use of http://example.com/ namespaces is legal for examples/prototypes/training, but is at danger of collision if PROV graphs are combined.
    • To encourage Linked Data, as a minimum use a namespace leading to a human readable page, appending #
    • For instance PROV entities described within this blog post could use:
      prefix pp <https://practicalprovenance.wordpress.com/2020/11/13/validating-and-visualising-prov/#>
  • An entity can’t concurrently be an activity.
    • However an agent could concurrently be an entity or an activity

Two immediate questions arise when faced with this “new” syntax and language for provenance:

  1. How can we validate its syntax and the correct use of PROV types and arguments to PROV relations?
  2. How can we convert from/to PROV-N and file formats that are more accessible programmatically, such as PROV-JSONLD or PROV-O in Turtle?

PROV tooling

KCL’s openprovenance.org lists PROV supporting tools and libraries, including: ProvToolbox (Java), Prov Python, ProvJS. These libraries can be used by developers for generating or consuming PROV from within a programmatic environment like Jupyter Notebook or a data management application.

In addition there are graphical tools for PROV editing, validation, conversion and visualization described below:

PROV-N editor

The PROV-N Editor is an online text editor that provides syntax highlighting and autocomplete for PROV-N, and is useful for beginners new to PROV-N.

Screenshot of https://openprovenance.org/tools/editor/ as of 2020-11-13

Note that the starting example PROV-N aims to be somewhat complete, including the advanced use of nested bundle .…. endBundle block, //comments and deliberate invalid statements (shown in red).

We recommend using the PROV-N Editor starting with a simpler example, and to use copy-paste to save the PROV-N locally to a file, using a text editor like Visual Studio Code (which unfortunately do not have syntax highlighting for PROV-N):

PROV-N example from above edited in VSCodium

Note: The file extension for PROVN is .provn, but you may use .provn.txt to ensure it opens in a text editor. Do not edit PROV-N in a text processor like Microsoft Word, as its binary format .docx (actually a structured ZIP archive of XML files) is not parseable by PROV tools; in addition text processors may provide unhelpful assistance such as changing “quotes” to “curly quotes” which are not part of PROV-N syntax.

Validating PROV

Although the PROV-N editor does syntax highlighting and can detect glaring mistakes such as invalid file comments, it does not do deeper inspection to detect mistakes such as missing commas, mismatches parentheses, wrong or missing argument to PROV relations. You may also accidentally have added logically inconsistent statements, such as:

document
  prefix ex <http://example.com/back-to-the-future/>
  
  entity(ex:results)
  entity(ex:data)
  entity(ex:interviews)

  wasDerivedFrom(ex:results, ex:data)
  wasDerivedFrom(ex:data, ex:interviews)
  wasDerivedFrom(ex:interviews, ex:results)
endDocument

While the above “scruffy” PROV-N file is syntactically valid, and each of the statements are OK semantically, as a whole we seem to have added a semantic violation of causality; an entity can’t be generated from entities not yet existing. An attempt to draw the above as a diagram will show an endless loop of derivations:

To ensure your PROV-N is both syntactically valid and semantically consistent, it is best to use a PROV validator.

PROV Validator

The openprovenance.org PROV validator can support PROV-N; remember to tick the correct syntax, specially when pasting rather than uploading a file with the correct extension.

The checks performed by the PROV Validator mainly focus on semantic constraints such as correct typing and ensuring provenance goes backwards in time without any causality loops (e.g. you can’t be your own grandparent).

Unfortunately we have found that the PROV Validator service occasionally does not detect syntactic PROV-N errors, for instance if we delete the placeholder argument ,- from the wasGeneratedBy statement above it is silently accepted by this validator, even though the timestamp is required by PROV-N definition of used. If there are syntactic errors the user is not provided with line-numbers of where the error might be.

Therefore we also recommend using the PROV Toolbox command line tool to validate the PROV-N syntax before using the PROV Validator.

PROV Toolbox

The PROV Toolbox is a Java library for consuming and generating PROV, but it also includes a versatile command line tool that can do:

  • Validation
  • Conversion
  • Merging
  • Visualization
  • Generate PROV from templates

See PROV Toolbox tutorials for further information.

Installing PROV Toolbox

To use the command line tool, the PROV Toolbox must be installed locally on a desktop/laptop computer.

Installation requirements lists what is needed for compiling and development. For the command line tool we’ve found it is sufficient to have:

Binary packages of PROV Toolbox are included for Linux (RedHat/Centos, Debian/Ubuntu) and macOS although they are not always updated.

Note: Installing Java and PROV Toolbox in Windows users requires a series of steps that are detailed separately.

After installing or unzipping to a subdirectory you should be able to run its provconvert or bin/provconvert command:

(base) stain@biggie:~/software/ProvToolbox$ bin/provconvert -help
usage: provconvert [-allexpanded] [-bindformat <string>] [-bindings
       <file>] [-bindver <int>] [-builder] [-compare <file>] [-config]
       [-debug] [-flatten] [-formats] [-generator <string>] [-genorder]
       [-help] [-index] [-infile <file>] [-informat <string>] [-layout
       <string>] [-location <location>] [-log2prov <file>] [-merge <file>]
       [-namespaces <file>] [-outcompare <file>] [-outfile <file>]
       [-outformat <string>] [-package <package>] [-template <string>]
       [-templatebuilder <file>] [-title <string>] [-verbose] [-version]
 -allexpanded,--allexpanded                  In template expansion,
                                             generate term if all
                                             variables are bound.
 -bindformat,--bindformat <string>           specify the format of the
                                             bindings
 -bindings,--bindings <file>                 use given file as bindings
                                             for template expansion
                                             (template is provided as
                                             infile)
 -bindver,--bindver <int>                    bindings version
 -builder,--builder                          template builder
 -compare,--compare <file>                   compare with given file
 -config,--config                            get configuration
 -debug,--debug                              print debugging information
 -flatten,--flatten                          flatten all bundles in a
                                             single document (to used with
                                             -index option or -merge
                                             option)
 -formats,--formats                          list supported formats
 -generator,--generator <string>             graph generator
                                             N:n:first:seed:e1
 -genorder,--genorder                        In template expansion,
                                             generate order attribute. By
                                             default does not.
 -help,--help                                print this message
 -index,--index                              index all elements and edges
                                             of a document, merging them
                                             where appropriate
 -infile,--infile <file>                     use given file as input
 -informat,--informat <string>               specify the format of the
                                             input
 -layout,--layout <string>                   dot layout: circo, dot
                                             (default), fdp, neato, osage,
                                             sfdp, twopi
 -location,--location <location>             location of where the
                                             template resource is to be
                                             found at runtime
 -log2prov,--log2prov <file>                 fully qualified ClassName of
                                             initialiser in jar file
 -merge,--merge <file>                       merge all documents (listed
                                             in file argument) into a
                                             single document
 -namespaces,--namespaces <file>             use given file as declaration
                                             of prefix namespaces
 -outcompare,--outcompare <file>             output file for log of
                                             comparison
 -outfile,--outfile <file>                   use given file as output
 -outformat,--outformat <string>             specify the format of the
                                             output
 -package,--package <package>                package in which bindings
                                             bean class is generated
 -template,--template <string>               template name, used to create
                                             bindings bean class name
 -templatebuilder,--templatebuilder <file>   template builder
                                             configuration
 -title,--title <string>                     document title
 -verbose,--verbose                          be verbose
 -version,--version                          print the version information
                                             and exit

Here is an example of converting from provn to RDF Turtle.

(base) stain@biggie:~/software/ProvToolbox$ bin/provconvert -infile test.provn -outfile test.ttl

The example output is valid RDF and uses the same prefixes in a different notation. (This kind of output can be loaded in Triple stores like Jena Fuseki for further queries).

Note that as a UNIX-like tool, no output from provconvert means the conversion was successful. We can use provconvert for validation, even if we do not need the translated file. If the provn has syntax errors, this will be reported as:

(base) stain@biggie:~/software/ProvToolbox$ bin/provconvert -infile test.provn -outfile test.ttl
13:46:42,100  WARN Utility:35 - test.provn line 12:34 mismatched input ')' expecting ','

This tells us that in line 12, position 34, PROV-N expected an additional argument (the – placeholder) instead of the closing character ).

If you have installed Graphviz dot you can also make SVG or PNG images:

bin/provconvert -infile test.provn -outfile test.svg

Note that on Windows you would need to modify the PATH system variable for GraphViz to work, see installing PROV Toolbox for Windows.

PROV Store

PROV Store allows uploading of PROV documents, conversion and visualization. It is recommended to edit and validate PROV-N files with the methods listed above before uploading, as the PROV Store can be more picky on compliance with the PROV standards.

There seems to be a bug in email notifications not being sent when registering, so use the big “Register for free account” on https://openprovenance.org/store/account/signup/ which lets you straight in. Hack: For a second registration if email link has not been received, make a username like fred14 and add +14 to your email address: fred+14@example.org

PROV released as W3C Recommendations

The Provenance Working Group was chartered to develop a framework for interchanging provenance on the Web. The Working Group has now published the PROV Family of Documents as W3C Recommendations, along with corresponding supporting notes. You can find a complete list of the documents in the PROV Overview Note. PROV enables one to represent and interchange provenance information using widely available formats such as RDF and XML. In addition, it provides definitions for accessing provenance information, validating it, and mapping to Dublin Core. Learn more about the Semantic Web.

@prefix prov: <http://www.w3.org/ns/prov#> .
<#quote> prov:wasQuotedFrom <http://www.w3.org/News/2013#entry-9805> .

This means the PROV data model and specifications are released and official recommendations, and can be used as a stable platform for expressing and exploring provenance data across the web.

Practically speaking, this blog would recommend you start with the the PROV primer, followed by the tutorial and then PROV-O for LinkedData/RDF/OWL (alternatively PROV-XML for XML or alternatively PROV-JSON for JSON). For deeper understanding and definition of the PROV concepts, see the PROV datamodel.