Published

Fri 14 August 2015

←Home

PROV Python 1.4.0

Last night, I released a new version of PROV Python library, version 1.4.0. It fixes the prov:QUALIFIED_NAME bug that I had inadvertently introduced since the inception of the library. ProvToolbox recently fixed the same bug (since version 0.7.0), and with this release, the two libraries are again compatible with each other.

This release is somewhat significant as existing provenance documents generated by previous versions of the library may no longer work with this version (and future versions). Before I discuss the details, the main changes in this release are:

  • Changed the type of qualified names to prov:QUALIFIED_NAME
  • Removed XSDQName class and stopped supporting parsing xsd:QName as qualified names
  • Replaced pydot dependency with pydotplus
  • Removed support for Python 2.6

prov:QUALIFIED_NAME, prov:QualifiedName, and xsd:QName

W3C's PROV-DM defined the abstract concept of Qualified Name but not a concrete type for it. Previously, I wrongly assumed the type for qualified names is prov:QualifiedName, which turned out to be not even a defined concept in any of the PROV documents. The type was then used mainly in PROV-JSON serialisations produced by the prov library and, sometimes, also seeped into its PROV-N outputs.

PROV-N, as it happened, did define the type for PROV's qualified names as prov:QUALIFIED_NAME — a fact somehow escaped me. This release replaced prov:QualifiedName with prov:QUALIFIED_NAME. Hence, literals of prov:QualifiedName type in existing PROV-JSON documents will no longer be recognised as qualified names by prov 1.4.0 and later. However, such documents should still be readable by the library, albeit with different semantics.

Regarding xsd:QName, the type had been treated as a sub-type of prov:QualifiedName, and hence, had been recognised as qualified names in the prov library. This means that the library would try to resolve the prefix provided in a xsd:QName value to one of the defined namespaces in the containing document. Such behaviour is not expected; in fact, xsd:QName and prov:QUALIFIED_NAME are incompatible types (see Luc's page on Qualified Names for more information). Hence, I decided to removed XSDQName class from the prov library, effectively removing support for resolving xsd:QName values into qualified names.

Python 2.6 no longer supported

The 2.6 branch of Python had been at its end of life since Oct 2013 with the 2.6.9 release. The prov library's support for Python 2.6 had been requiring extra effort in writing codes for it and testing them, in addition to those to support Python 3. With more and more libraries dropping support for Python 2.6 (including networkx and pydotplus, which are used by prov), I think it is time for prov to move on. From version 1.4.0, prov no longer works with Python 2.6. It remains working with, and being tested for, Python 2.7, 3.3, 3.4, and PyPy.

pydot and pydotplus

pydot had been used to represent PROV documents in the DOT format, allowing for the conversion of such documents into SVG, PNG, PDF, and other graphical formats supported by the excellent Graphviz package. The pydot, however, have not been updated for over 4 years. The official package does not work with Python 3 and, as a result, we had to use an unofficial fork. In this release, we decided to use pydotplus, a drop-in replace for pydot that works with Python 3.

At the same time, I took the opportunity to create a test for the DOT generation feature of prov. Although I still cannot find a way to verify the graphical outputs programmatically, the test at least exercises the code for this feature over the library's extensive test suite.

Endnote

As this release introduces some significant changes, I would love to hear about any issue or feedback you might have. Please report them to the library's issue tracker. Many thanks!

Go Top
comments powered by Disqus