Skip to content

Commit bab9ba3

Browse files
committed
Release 1.5.0
* Added: Support for PROV-O (RDF) serialization and deserialization * Added: `direction` option for `prov.dot.prov_to_dot` * Added: `prov.graph.graph_to_prov` to convert a Networkx graph back to a `ProvDocument` * Testing with Python 3.5 * Various minor bug fixes and improvements
1 parent 34cdfce commit bab9ba3

14 files changed

+66
-40
lines changed

AUTHORS.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ Development Lead
1010
Contributors
1111
------------
1212

13-
* Sam Millar
14-
* Satrajit Ghosh
13+
* Satrajit Ghosh (:py:mod:`prov.serializers.provrdf` module)
1514
* Lion Krischer (:py:mod:`prov.serializers.provxml` module and Python 3 support)
15+
* Sam Millar

CONTRIBUTING.rst

+7-9
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ If you are reporting a bug, please include:
2424
Fix Bugs
2525
~~~~~~~~
2626

27-
Look through the GitHub issues for bugs. Anything tagged with "bug"
28-
is open to whoever wants to implement it.
27+
Look through the GitHub `issues <https://github.com/trungdong/prov/issues>`_ for bugs.
28+
Anything tagged with "bug" is open to whoever wants to implement it.
2929

3030
Implement Features
3131
~~~~~~~~~~~~~~~~~~
3232

33-
Look through the GitHub issues for features. Anything tagged with "feature"
34-
is open to whoever wants to implement it.
33+
Look through the GitHub `issues <https://github.com/trungdong/prov/issues>`_
34+
for features. Anything tagged with "feature" is open to whoever wants to implement it.
3535

3636
Write Documentation
3737
~~~~~~~~~~~~~~~~~~~
@@ -66,7 +66,7 @@ Ready to contribute? Here's how to set up `prov` for local development.
6666

6767
$ mkvirtualenv prov
6868
$ cd prov/
69-
$ python setup.py develop
69+
$ pip install -r requirements-dev.txt
7070

7171
4. Create a branch for local development::
7272

@@ -80,8 +80,6 @@ Ready to contribute? Here's how to set up `prov` for local development.
8080
$ python setup.py test
8181
$ tox
8282

83-
To get flake8 and tox, just pip install them into your virtualenv.
84-
8583
6. Commit your changes and push your branch to GitHub::
8684

8785
$ git add .
@@ -99,10 +97,10 @@ Before you submit a pull request, check that it meets these guidelines:
9997
2. If the pull request adds functionality, the docs should be updated. Put
10098
your new functionality into a function with a docstring, and add the
10199
feature to the list in README.rst.
102-
3. The pull request should work for Python 2.6, 2.7, 3.3, 3.4, and for PyPy.
100+
3. The pull request should work for Python 2.7, 3.3, 3.4, 3.5, and for PyPy.
103101
Check https://travis-ci.org/trungdong/prov/pull_requests
104102
and make sure that the tests pass for all supported Python versions.
105-
(See [pyenv](https://github.com/yyuu/pyenv) for help on setting up
103+
(See `pyenv <https://github.com/yyuu/pyenv>`_ for help on setting up
106104
multiple versions of Python locally for testing.)
107105

108106
Tips

HISTORY.rst

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
History
44
-------
55

6+
1.5.0 (2015-10-19)
7+
^^^^^^^^^^^^^^^^^^
8+
* Added: Support for `PROV-O <http://www.w3.org/TR/prov-o/>`_ (RDF) serialization and deserialization
9+
* Added: `direction` option for :py:meth:`prov.dot.prov_to_dot`
10+
* Added: :py:meth:`prov.graph.graph_to_prov` to convert a `MultiDiGraph <http://networkx.github.io/documentation/latest/reference/classes.multidigraph.html>`_ back to a :py:class:`~prov.model.ProvDocument`
11+
* Testing with Python 3.5
12+
* Various minor bug fixes and improvements
13+
614
1.4.0 (2015-08-13)
715
^^^^^^^^^^^^^^^^^^
816
* Changed the type of qualified names to prov:QUALIFIED_NAME (fixed #68)

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2014 University of Southampton
3+
Copyright (c) 2014–2016 University of Southampton
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

MANIFEST.in

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ include README.rst
66
include CHANGES.txt
77
include prov/tests/json/*.json
88
include prov/tests/unification/*.json
9+
include prov/tests/rdf/*.ttl
10+
include prov/tests/rdf/*.trig
911
include prov/tests/xml/*.xml
1012

1113
recursive-exclude * __pycache__

README.rst

+4-3
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,19 @@ Introduction
2626
:alt: License
2727

2828

29-
A library for W3C Provenance Data Model supporting PROV-JSON and PROV-XML import/export
29+
A library for W3C Provenance Data Model supporting PROV-O (RDF), PROV-XML, PROV-JSON import/export
3030

3131
* Free software: MIT license
32-
* Documentation: http://prov.readthedocs.org.
32+
* Documentation: http://prov.readthedocs.io/.
3333

3434
Features
3535
--------
3636

3737
* An implementation of the `W3C PROV Data Model <http://www.w3.org/TR/prov-dm/>`_ in Python.
3838
* In-memory classes for PROV assertions, which can then be output as `PROV-N <http://www.w3.org/TR/prov-n/>`_
39-
* Serialization and deserializtion support: `PROV-JSON <http://www.w3.org/Submission/prov-json/>`_ and `PROV-XML <http://www.w3.org/TR/prov-xml/>`_.
39+
* Serialization and deserializtion support: `PROV-O <http://www.w3.org/TR/prov-o/>`_ (RDF), `PROV-XML <http://www.w3.org/TR/prov-xml/>`_ and `PROV-JSON <http://www.w3.org/Submission/prov-json/>`_.
4040
* Exporting PROV documents into various graphical formats (e.g. PDF, PNG, SVG).
41+
* Convert a PROV document to a `Networkx MultiDiGraph <http://networkx.github.io/documentation/latest/reference/classes.multidigraph.html>`_ and back.
4142

4243

4344
Uses

docs/prov.serializers.rst

+8
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ prov.serializers.provn module
2525
:show-inheritance:
2626

2727

28+
prov.serializers.provrdf module
29+
-------------------------------
30+
31+
.. automodule:: prov.serializers.provrdf
32+
:members:
33+
:show-inheritance:
34+
35+
2836
prov.serializers.provxml module
2937
-------------------------------
3038

prov/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
__author__ = 'Trung Dong Huynh'
55
__email__ = '[email protected]'
6-
__version__ = '1.4.1.dev1'
6+
__version__ = '1.5.0'
77

88
__all__ = ["Error", "model", "read"]
99

prov/dot.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""Graphical visualisation support for prov.model.
22
33
This module produces graphical visualisation for provenanve graphs.
4-
Requires pydot module and Graphviz.
4+
Requires pydotplus module and Graphviz.
55
66
References:
77
8-
* pydot Homepage: http://code.google.com/p/pydot/
8+
* pydotplus homepage: http://pydotplus.readthedocs.io/
99
* Graphviz: http://www.graphviz.org/
1010
* DOT Language: http://www.graphviz.org/doc/info/lang.html
1111
@@ -148,11 +148,9 @@ def prov_to_dot(bundle, show_nary=True, use_labels=False,
148148
:type name: :class:`ProvBundle`
149149
:param show_nary: shows all elements in n-ary relations.
150150
:type show_nary: bool
151-
:param use_labels: uses the prov:label property of an element as its name
152-
(instead of its identifier).
151+
:param use_labels: uses the prov:label property of an element as its name (instead of its identifier).
153152
:type use_labels: bool
154-
:param direction: specifies the direction of the graph. Valid values are
155-
"BT" (default), "TB", "LR", "RL".
153+
:param direction: specifies the direction of the graph. Valid values are "BT" (default), "TB", "LR", "RL".
156154
:param show_element_attributes: shows attributes of elements.
157155
:type show_element_attributes: bool
158156
:param show_relation_attributes: shows attributes of relations.

prov/graph.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ def prov_to_graph(prov_document):
3232
<http://networkx.github.io/documentation/latest/reference/classes.multidigraph.html>`_
3333
instance of the `NetworkX <https://networkx.github.io/>`_ library.
3434
35-
:param prov_document: The :class:`~prov.model.ProvDocument` instance to
36-
convert.
35+
:param prov_document: The :class:`~prov.model.ProvDocument` instance to convert.
3736
"""
3837
g = nx.MultiDiGraph()
3938
unified = prov_document.unified()
@@ -63,6 +62,11 @@ def prov_to_graph(prov_document):
6362

6463

6564
def graph_to_prov(g):
65+
""" Convert a `MultiDiGraph <http://networkx.github.io/documentation/latest/reference/classes.multidigraph.html>`_
66+
back to a :class:`~prov.model.ProvDocument`.
67+
68+
:param g: The graph instance to convert.
69+
"""
6670
prov_doc = ProvDocument()
6771
for n in g.nodes_iter():
6872
if isinstance(n, ProvRecord) and n.bundle is not None:

requirements-dev.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-r requirements.txt
2+
coverage
3+
flake8
4+
sphinx
5+
tox
6+
wheel

scripts/prov-compare

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#!/usr/bin/env python
22
# encoding: utf-8
33
"""
4-
prov-compare -- Compare two PROV-JSON or PROV-XML files for equivalence
4+
prov-compare -- Compare two PROV-JSON, PROV-XML, or RDF (PROV-O) files for equivalence
55
66
@author: Trung Dong Huynh
77
8-
@copyright: 2015 University of Southampton, United Kingdom. All rights reserved.
8+
@copyright: 2016 University of Southampton, United Kingdom. All rights reserved.
99
10-
@license: TBD
10+
@license: MIT Licence
1111
1212
13-
@deffield updated: 2015-06-16
13+
@deffield updated: 2016-10-19
1414
"""
1515

1616
from argparse import ArgumentParser, RawDescriptionHelpFormatter, FileType
@@ -28,7 +28,7 @@ logger = logging.getLogger(__name__)
2828
__all__ = []
2929
__version__ = 0.1
3030
__date__ = '2015-06-16'
31-
__updated__ = '2015-06-16'
31+
__updated__ = '2016-10-19'
3232

3333
DEBUG = 0
3434
TESTRUN = 0
@@ -62,7 +62,7 @@ def main(argv=None): # IGNORE:C0111
6262
program_license = '''%s
6363
6464
Created by Trung Dong Huynh on %s.
65-
Copyright 2015 University of Southampton. All rights reserved.
65+
Copyright 2016 University of Southampton. All rights reserved.
6666
6767
Licensed under the MIT License
6868
https://github.com/trungdong/prov/blob/master/LICENSE

scripts/prov-convert

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#!/usr/bin/env python
22
# encoding: utf-8
33
"""
4-
convert -- Convert PROV-JSON to PROV-N, PROV-XML, or graphical formats (SVG, PDF, PNG)
4+
convert -- Convert PROV-JSON to RDF, PROV-N, PROV-XML, or graphical formats (SVG, PDF, PNG)
55
66
@author: Trung Dong Huynh
77
8-
@copyright: 2015 University of Southampton, United Kingdom. All rights reserved.
8+
@copyright: 2016 University of Southampton, United Kingdom. All rights reserved.
99
10-
@license: TBD
10+
@license: MIT License
1111
1212
13-
@deffield updated: 2014-03-14
13+
@deffield updated: 2016-10-19
1414
"""
1515

1616
from argparse import ArgumentParser, RawDescriptionHelpFormatter, FileType
@@ -29,17 +29,17 @@ logger = logging.getLogger(__name__)
2929
__all__ = []
3030
__version__ = 0.1
3131
__date__ = '2014-03-14'
32-
__updated__ = '2015-02-03'
32+
__updated__ = '2016-10-19'
3333

3434
DEBUG = 0
3535
TESTRUN = 0
3636
PROFILE = 0
3737

38-
GRAPHVIZ_SUPPORTED_FORMATS = set([
38+
GRAPHVIZ_SUPPORTED_FORMATS = {
3939
'bmp', 'canon', 'cmap', 'cmapx', 'cmapx_np', 'dot', 'eps', 'fig', 'gtk', 'gv', 'ico', 'imap', 'imap_np', 'ismap',
4040
'jpe', 'jpeg', 'jpg', 'pdf', 'plain', 'plain-ext', 'png', 'ps', 'ps2', 'svg', 'svgz', 'tif', 'tiff', 'tk',
4141
'vml', 'vmlz', 'x11', 'xdot', 'xlib'
42-
])
42+
}
4343

4444

4545
@six.python_2_unicode_compatible
@@ -88,7 +88,7 @@ def main(argv=None): # IGNORE:C0111
8888
program_license = '''%s
8989
9090
Created by Trung Dong Huynh on %s.
91-
Copyright 2015 University of Southampton. All rights reserved.
91+
Copyright 2016 University of Southampton. All rights reserved.
9292
9393
Licensed under the MIT License
9494
https://github.com/trungdong/prov/blob/master/LICENSE

setup.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424

2525
setup(
2626
name='prov',
27-
version='1.4.1.dev1',
27+
version='1.5.0',
2828
description='A library for W3C Provenance Data Model supporting PROV-JSON, '
29-
'PROV-XML and PROV-O',
29+
'PROV-XML and PROV-O (RDF)',
3030
long_description=readme + '\n\n' + history,
3131
author='Trung Dong Huynh',
3232
author_email='[email protected]',
@@ -59,6 +59,7 @@
5959
"Programming Language :: Python :: 3",
6060
'Programming Language :: Python :: 3.3',
6161
'Programming Language :: Python :: 3.4',
62+
'Programming Language :: Python :: 3.5',
6263
"Programming Language :: Python :: Implementation :: CPython",
6364
"Programming Language :: Python :: Implementation :: PyPy",
6465
'Topic :: Scientific/Engineering :: Information Analysis',

0 commit comments

Comments
 (0)