[Python-modules-commits] [python-prov] 05/14: Import python-prov_1.5.0.orig.tar.gz
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Tue Dec 13 12:39:44 UTC 2016
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch master
in repository python-prov.
commit bec65d7ac8f7533ad839a98ec9c5b38ebc3cde93
Author: Ghislain Antony Vaillant <ghisvail at gmail.com>
Date: Mon Dec 12 21:24:36 2016 +0000
Import python-prov_1.5.0.orig.tar.gz
---
AUTHORS.rst | 4 +-
CONTRIBUTING.rst | 16 +-
HISTORY.rst | 8 +
LICENSE | 2 +-
MANIFEST.in | 2 +
PKG-INFO | 22 +-
README.rst | 7 +-
dev/__init__.py | 0
dev/debug_jsons.py | 58 ++
dev/script.py | 99 ++++
dev/test_count_JSON-LD.py | 38 ++
dev/test_count_PROV-JSON.py | 25 +
dev/test_count_Streaming.py | 82 +++
dev/test_jsonld.py | 14 +
docs/prov.serializers.rst | 8 +
prov.egg-info/PKG-INFO | 22 +-
prov.egg-info/SOURCES.txt | 413 +++++++++++++++
prov.egg-info/requires.txt | 3 +-
prov.egg-info/top_level.txt | 1 +
prov/__init__.py | 2 +-
prov/dot.py | 27 +-
prov/graph.py | 40 +-
prov/model.py | 37 +-
prov/serializers/__init__.py | 2 +
prov/serializers/jsonld_streaming.py | 209 ++++++++
prov/serializers/provjsons.py | 368 +++++++++++++
prov/serializers/provrdf.py | 588 +++++++++++++++++++++
prov/tests/json/activity5.json | 2 +-
prov/tests/json/activity6.json | 2 +-
prov/tests/json/activity7.json | 4 +-
prov/tests/json/activity8.json | 8 +-
prov/tests/json/activity9.json | 4 +-
prov/tests/json/agent6.json | 2 +-
prov/tests/json/agent7.json | 2 +-
prov/tests/json/agent8.json | 4 +-
prov/tests/json/association7.json | 2 +-
prov/tests/json/association9.json | 2 +-
prov/tests/json/attr_activity0.json | 66 +--
prov/tests/json/attr_agent0.json | 66 +--
prov/tests/json/attr_association0.json | 66 +--
.../json/attr_association_one_role_attr21.json | 2 +-
.../json/attr_association_one_role_attr22.json | 2 +-
.../json/attr_association_one_role_attr23.json | 2 +-
.../json/attr_association_one_role_attr24.json | 2 +-
.../json/attr_association_one_role_attr25.json | 2 +-
.../json/attr_association_one_role_attr26.json | 2 +-
prov/tests/json/attr_attribution0.json | 54 +-
prov/tests/json/attr_communication0.json | 54 +-
prov/tests/json/attr_delegation0.json | 54 +-
prov/tests/json/attr_derivation0.json | 54 +-
prov/tests/json/attr_end0.json | 78 +--
prov/tests/json/attr_entity0.json | 66 +--
prov/tests/json/attr_entity_one_attr21.json | 2 +-
prov/tests/json/attr_entity_one_attr22.json | 2 +-
prov/tests/json/attr_entity_one_attr23.json | 2 +-
prov/tests/json/attr_entity_one_attr24.json | 2 +-
prov/tests/json/attr_entity_one_attr25.json | 2 +-
prov/tests/json/attr_entity_one_attr26.json | 2 +-
.../json/attr_entity_one_location_attr21.json | 2 +-
.../json/attr_entity_one_location_attr22.json | 2 +-
.../json/attr_entity_one_location_attr23.json | 2 +-
.../json/attr_entity_one_location_attr24.json | 2 +-
.../json/attr_entity_one_location_attr25.json | 2 +-
.../json/attr_entity_one_location_attr26.json | 2 +-
prov/tests/json/attr_entity_one_other_attr21.json | 2 +-
prov/tests/json/attr_entity_one_other_attr22.json | 2 +-
prov/tests/json/attr_entity_one_other_attr23.json | 2 +-
prov/tests/json/attr_entity_one_other_attr24.json | 2 +-
prov/tests/json/attr_entity_one_other_attr25.json | 2 +-
prov/tests/json/attr_entity_one_other_attr26.json | 2 +-
prov/tests/json/attr_entity_one_value_attr21.json | 2 +-
prov/tests/json/attr_entity_one_value_attr22.json | 2 +-
prov/tests/json/attr_entity_one_value_attr23.json | 2 +-
prov/tests/json/attr_entity_one_value_attr24.json | 2 +-
prov/tests/json/attr_entity_one_value_attr25.json | 2 +-
prov/tests/json/attr_entity_one_value_attr26.json | 2 +-
prov/tests/json/attr_generation0.json | 78 +--
prov/tests/json/attr_influence0.json | 54 +-
prov/tests/json/attr_invalidation0.json | 78 +--
prov/tests/json/attr_start0.json | 78 +--
prov/tests/json/attr_usage0.json | 78 +--
prov/tests/json/attribution7.json | 2 +-
prov/tests/json/attribution8.json | 2 +-
prov/tests/json/bundle1.json | 4 +-
prov/tests/json/bundle2.json | 4 +-
prov/tests/json/bundle3.json | 4 +-
prov/tests/json/bundle4.json | 4 +-
prov/tests/json/communication6.json | 2 +-
prov/tests/json/communication7.json | 2 +-
prov/tests/json/delegation7.json | 2 +-
prov/tests/json/delegation8.json | 2 +-
prov/tests/json/derivation11.json | 2 +-
prov/tests/json/derivation12.json | 2 +-
prov/tests/json/derivation13.json | 2 +-
prov/tests/json/derivation8.json | 2 +-
prov/tests/json/derivation9.json | 2 +-
prov/tests/json/end10.json | 4 +-
prov/tests/json/end8.json | 4 +-
prov/tests/json/entity10.json | 4 +-
prov/tests/json/entity3.json | 2 +-
prov/tests/json/entity5.json | 2 +-
prov/tests/json/entity6.json | 2 +-
prov/tests/json/entity7.json | 4 +-
prov/tests/json/entity8.json | 8 +-
prov/tests/json/entity9.json | 4 +-
prov/tests/json/generation5.json | 4 +-
prov/tests/json/generation7.json | 4 +-
prov/tests/json/influence6.json | 2 +-
prov/tests/json/influence7.json | 2 +-
prov/tests/json/invalidation5.json | 4 +-
prov/tests/json/invalidation7.json | 4 +-
prov/tests/json/start10.json | 4 +-
prov/tests/json/start8.json | 4 +-
prov/tests/json/usage5.json | 4 +-
prov/tests/json/usage7.json | 4 +-
prov/tests/rdf/activity1.ttl | 8 +
prov/tests/rdf/activity2.ttl | 9 +
prov/tests/rdf/activity3.ttl | 10 +
prov/tests/rdf/activity4.ttl | 9 +
prov/tests/rdf/activity5.ttl | 9 +
prov/tests/rdf/activity6.ttl | 10 +
prov/tests/rdf/activity7.ttl | 10 +
prov/tests/rdf/activity8.ttl | 13 +
prov/tests/rdf/activity9.ttl | 17 +
prov/tests/rdf/agent1.ttl | 8 +
prov/tests/rdf/agent2.ttl | 9 +
prov/tests/rdf/agent3.ttl | 9 +
prov/tests/rdf/agent4.ttl | 9 +
prov/tests/rdf/agent5.ttl | 9 +
prov/tests/rdf/agent6.ttl | 9 +
prov/tests/rdf/agent7.ttl | 10 +
prov/tests/rdf/agent8.ttl | 10 +
prov/tests/rdf/alternate1.ttl | 8 +
prov/tests/rdf/association1.ttl | 10 +
prov/tests/rdf/association2.ttl | 9 +
prov/tests/rdf/association3.ttl | 11 +
prov/tests/rdf/association4.ttl | 13 +
prov/tests/rdf/association5.ttl | 8 +
prov/tests/rdf/association6.ttl | 14 +
prov/tests/rdf/association7.ttl | 15 +
prov/tests/rdf/association8.ttl | 14 +
prov/tests/rdf/association9.ttl | 22 +
prov/tests/rdf/attr_activity0.ttl | 16 +
prov/tests/rdf/attr_agent0.ttl | 16 +
prov/tests/rdf/attr_association0.ttl | 21 +
prov/tests/rdf/attr_association_one_role_attr0.ttl | 13 +
prov/tests/rdf/attr_association_one_role_attr1.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr10.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr11.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr12.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr13.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr14.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr15.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr16.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr17.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr18.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr19.ttl | 13 +
prov/tests/rdf/attr_association_one_role_attr2.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr20.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr21.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr22.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr23.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr24.ttl | 14 +
.../tests/rdf/attr_association_one_role_attr25.ttl | 14 +
.../tests/rdf/attr_association_one_role_attr26.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr27.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr28.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr29.ttl | 13 +
prov/tests/rdf/attr_association_one_role_attr3.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr30.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr31.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr32.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr33.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr34.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr35.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr36.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr37.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr38.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr39.ttl | 13 +
prov/tests/rdf/attr_association_one_role_attr4.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr40.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr41.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr42.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr43.ttl | 13 +
.../tests/rdf/attr_association_one_role_attr44.ttl | 13 +
prov/tests/rdf/attr_association_one_role_attr5.ttl | 13 +
prov/tests/rdf/attr_association_one_role_attr6.ttl | 13 +
prov/tests/rdf/attr_association_one_role_attr7.ttl | 13 +
prov/tests/rdf/attr_association_one_role_attr8.ttl | 13 +
prov/tests/rdf/attr_association_one_role_attr9.ttl | 13 +
prov/tests/rdf/attr_attribution0.ttl | 20 +
prov/tests/rdf/attr_communication0.ttl | 20 +
prov/tests/rdf/attr_delegation0.ttl | 21 +
prov/tests/rdf/attr_derivation0.ttl | 20 +
prov/tests/rdf/attr_end0.ttl | 22 +
prov/tests/rdf/attr_entity0.ttl | 17 +
prov/tests/rdf/attr_entity_one_attr0.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr1.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr10.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr11.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr12.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr13.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr14.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr15.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr16.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr17.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr18.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr19.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr2.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr20.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr21.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr22.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr23.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr24.ttl | 9 +
prov/tests/rdf/attr_entity_one_attr25.ttl | 9 +
prov/tests/rdf/attr_entity_one_attr26.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr27.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr28.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr29.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr3.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr30.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr31.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr32.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr33.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr34.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr35.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr36.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr37.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr38.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr39.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr4.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr40.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr41.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr42.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr43.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr44.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr5.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr6.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr7.ttl | 8 +
prov/tests/rdf/attr_entity_one_attr8.ttl | 8 +
prov/tests/rdf/attr_entity_one_location_attr0.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr1.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr10.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr11.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr12.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr13.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr14.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr15.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr16.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr17.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr18.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr19.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr2.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr20.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr21.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr22.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr23.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr24.ttl | 10 +
prov/tests/rdf/attr_entity_one_location_attr25.ttl | 10 +
prov/tests/rdf/attr_entity_one_location_attr26.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr27.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr28.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr29.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr3.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr30.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr31.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr32.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr33.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr34.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr35.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr36.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr37.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr38.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr39.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr4.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr40.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr41.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr42.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr43.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr44.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr5.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr6.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr7.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr8.ttl | 9 +
prov/tests/rdf/attr_entity_one_location_attr9.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr0.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr1.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr10.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr11.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr12.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr13.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr14.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr15.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr16.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr17.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr18.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr19.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr2.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr20.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr21.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr22.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr23.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr24.ttl | 10 +
prov/tests/rdf/attr_entity_one_other_attr25.ttl | 10 +
prov/tests/rdf/attr_entity_one_other_attr26.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr27.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr28.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr29.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr3.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr30.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr31.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr32.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr33.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr34.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr35.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr36.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr37.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr38.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr39.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr4.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr40.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr41.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr42.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr43.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr44.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr5.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr6.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr7.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr8.ttl | 9 +
prov/tests/rdf/attr_entity_one_other_attr9.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr0.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr1.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr10.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr11.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr12.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr13.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr14.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr15.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr16.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr17.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr18.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr19.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr2.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr20.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr21.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr22.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr23.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr24.ttl | 10 +
prov/tests/rdf/attr_entity_one_value_attr25.ttl | 10 +
prov/tests/rdf/attr_entity_one_value_attr26.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr27.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr28.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr29.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr3.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr30.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr31.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr32.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr33.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr34.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr35.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr36.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr37.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr38.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr39.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr4.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr40.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr41.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr42.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr43.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr44.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr5.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr6.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr7.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr8.ttl | 9 +
prov/tests/rdf/attr_entity_one_value_attr9.ttl | 9 +
prov/tests/rdf/attr_generation0.ttl | 22 +
prov/tests/rdf/attr_influence0.ttl | 20 +
prov/tests/rdf/attr_invalidation0.ttl | 22 +
prov/tests/rdf/attr_start0.ttl | 22 +
prov/tests/rdf/attr_usage0.ttl | 22 +
prov/tests/rdf/attribution1.ttl | 10 +
prov/tests/rdf/attribution2.ttl | 9 +
prov/tests/rdf/attribution3.ttl | 11 +
prov/tests/rdf/attribution4.ttl | 11 +
prov/tests/rdf/attribution5.ttl | 8 +
prov/tests/rdf/attribution6.ttl | 13 +
prov/tests/rdf/attribution7.ttl | 14 +
prov/tests/rdf/attribution8.ttl | 21 +
prov/tests/rdf/bundle1.trig | 32 ++
prov/tests/rdf/bundle1.ttl | 26 +
prov/tests/rdf/bundle2.trig | 32 ++
prov/tests/rdf/bundle2.ttl | 24 +
prov/tests/rdf/bundle3.trig | 32 ++
prov/tests/rdf/bundle3.ttl | 26 +
prov/tests/rdf/bundle4.trig | 33 ++
prov/tests/rdf/bundle4.ttl | 27 +
prov/tests/rdf/communication1.ttl | 10 +
prov/tests/rdf/communication2.ttl | 9 +
prov/tests/rdf/communication3.ttl | 11 +
prov/tests/rdf/communication4.ttl | 8 +
prov/tests/rdf/communication5.ttl | 13 +
prov/tests/rdf/communication6.ttl | 14 +
prov/tests/rdf/communication7.ttl | 21 +
prov/tests/rdf/delegation1.ttl | 10 +
prov/tests/rdf/delegation2.ttl | 9 +
prov/tests/rdf/delegation3.ttl | 11 +
prov/tests/rdf/delegation4.ttl | 13 +
prov/tests/rdf/delegation5.ttl | 8 +
prov/tests/rdf/delegation6.ttl | 14 +
prov/tests/rdf/delegation7.ttl | 15 +
prov/tests/rdf/delegation8.ttl | 22 +
prov/tests/rdf/derivation1.ttl | 9 +
prov/tests/rdf/derivation10.ttl | 15 +
prov/tests/rdf/derivation11.ttl | 15 +
prov/tests/rdf/derivation12.ttl | 15 +
prov/tests/rdf/derivation13.ttl | 15 +
prov/tests/rdf/derivation2.ttl | 10 +
prov/tests/rdf/derivation3.ttl | 11 +
prov/tests/rdf/derivation4.ttl | 13 +
prov/tests/rdf/derivation5.ttl | 13 +
prov/tests/rdf/derivation6.ttl | 14 +
prov/tests/rdf/derivation7.ttl | 15 +
prov/tests/rdf/derivation8.ttl | 21 +
prov/tests/rdf/derivation9.ttl | 12 +
prov/tests/rdf/end1.ttl | 9 +
prov/tests/rdf/end10.ttl | 24 +
prov/tests/rdf/end2.ttl | 11 +
prov/tests/rdf/end3.ttl | 10 +
prov/tests/rdf/end4.ttl | 10 +
prov/tests/rdf/end5.ttl | 13 +
prov/tests/rdf/end6.ttl | 12 +
prov/tests/rdf/end7.ttl | 13 +
prov/tests/rdf/end8.ttl | 24 +
prov/tests/rdf/end9.ttl | 8 +
prov/tests/rdf/entity0.ttl | 10 +
prov/tests/rdf/entity1.ttl | 8 +
prov/tests/rdf/entity10.ttl | 17 +
prov/tests/rdf/entity2.ttl | 9 +
prov/tests/rdf/entity3.ttl | 10 +
prov/tests/rdf/entity4.ttl | 9 +
prov/tests/rdf/entity5.ttl | 9 +
prov/tests/rdf/entity6.ttl | 10 +
prov/tests/rdf/entity7.ttl | 10 +
prov/tests/rdf/entity8.ttl | 10 +
prov/tests/rdf/entity9.ttl | 17 +
prov/tests/rdf/generation1.ttl | 10 +
prov/tests/rdf/generation2.ttl | 11 +
prov/tests/rdf/generation3.ttl | 13 +
prov/tests/rdf/generation4.ttl | 14 +
prov/tests/rdf/generation5.ttl | 24 +
prov/tests/rdf/generation6.ttl | 8 +
prov/tests/rdf/generation7.ttl | 24 +
prov/tests/rdf/influence1.ttl | 10 +
prov/tests/rdf/influence2.ttl | 9 +
prov/tests/rdf/influence3.ttl | 11 +
prov/tests/rdf/influence4.ttl | 8 +
prov/tests/rdf/influence5.ttl | 13 +
prov/tests/rdf/influence6.ttl | 14 +
prov/tests/rdf/influence7.ttl | 21 +
prov/tests/rdf/invalidation1.ttl | 10 +
prov/tests/rdf/invalidation2.ttl | 11 +
prov/tests/rdf/invalidation3.ttl | 13 +
prov/tests/rdf/invalidation4.ttl | 14 +
prov/tests/rdf/invalidation5.ttl | 24 +
prov/tests/rdf/invalidation6.ttl | 8 +
prov/tests/rdf/invalidation7.ttl | 24 +
prov/tests/rdf/member1.ttl | 8 +
prov/tests/rdf/member2.ttl | 8 +
prov/tests/rdf/member3.ttl | 8 +
prov/tests/rdf/mention1.ttl | 8 +
prov/tests/rdf/mention2.ttl | 9 +
prov/tests/rdf/scruffy-end1-M.ttl | 17 +
prov/tests/rdf/scruffy-end1-S.ttl | 13 +
prov/tests/rdf/scruffy-end2-M.ttl | 20 +
prov/tests/rdf/scruffy-end2-S.ttl | 16 +
prov/tests/rdf/scruffy-end3-M.ttl | 26 +
prov/tests/rdf/scruffy-end3-S.ttl | 18 +
prov/tests/rdf/scruffy-end4-M.ttl | 34 ++
prov/tests/rdf/scruffy-end4-S.ttl | 22 +
prov/tests/rdf/scruffy-generation1-M.ttl | 17 +
prov/tests/rdf/scruffy-generation1-S.ttl | 13 +
prov/tests/rdf/scruffy-generation2-M.ttl | 20 +
prov/tests/rdf/scruffy-generation2-S.ttl | 16 +
prov/tests/rdf/scruffy-invalidation1-M.ttl | 17 +
prov/tests/rdf/scruffy-invalidation1-S.ttl | 13 +
prov/tests/rdf/scruffy-invalidation2-M.ttl | 20 +
prov/tests/rdf/scruffy-invalidation2-S.ttl | 16 +
prov/tests/rdf/scruffy-start1-M.ttl | 17 +
prov/tests/rdf/scruffy-start1-S.ttl | 13 +
prov/tests/rdf/scruffy-start2-M.ttl | 20 +
prov/tests/rdf/scruffy-start2-S.ttl | 16 +
prov/tests/rdf/scruffy-start3-M.ttl | 26 +
prov/tests/rdf/scruffy-start3-S.ttl | 18 +
prov/tests/rdf/scruffy-start4-M.ttl | 34 ++
prov/tests/rdf/scruffy-start4-S.ttl | 22 +
prov/tests/rdf/scruffy-usage1-M.ttl | 17 +
prov/tests/rdf/scruffy-usage1-S.ttl | 13 +
prov/tests/rdf/scruffy-usage2-M.ttl | 20 +
prov/tests/rdf/scruffy-usage2-S.ttl | 16 +
prov/tests/rdf/specialization1.ttl | 8 +
prov/tests/rdf/start1.ttl | 9 +
prov/tests/rdf/start10.ttl | 24 +
prov/tests/rdf/start2.ttl | 11 +
prov/tests/rdf/start3.ttl | 10 +
prov/tests/rdf/start4.ttl | 10 +
prov/tests/rdf/start5.ttl | 13 +
prov/tests/rdf/start6.ttl | 12 +
prov/tests/rdf/start7.ttl | 13 +
prov/tests/rdf/start8.ttl | 24 +
prov/tests/rdf/start9.ttl | 8 +
prov/tests/rdf/usage1.ttl | 9 +
prov/tests/rdf/usage2.ttl | 11 +
prov/tests/rdf/usage3.ttl | 13 +
prov/tests/rdf/usage4.ttl | 14 +
prov/tests/rdf/usage5.ttl | 24 +
prov/tests/rdf/usage6.ttl | 8 +
prov/tests/rdf/usage7.ttl | 24 +
prov/tests/test_dot.py | 28 +-
prov/tests/test_graphs.py | 10 +-
prov/tests/test_model.py | 12 +-
prov/tests/test_rdf.py | 244 +++++++++
prov/tests/test_xml.py | 4 +-
scripts/prov-compare | 12 +-
scripts/prov-convert | 18 +-
setup.py | 14 +-
525 files changed, 7701 insertions(+), 655 deletions(-)
diff --git a/AUTHORS.rst b/AUTHORS.rst
index 36d4beb..f765bdd 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -10,6 +10,6 @@ Development Lead
Contributors
------------
-* Sam Millar
-* Satrajit Ghosh
+* Satrajit Ghosh (:py:mod:`prov.serializers.provrdf` module)
* Lion Krischer (:py:mod:`prov.serializers.provxml` module and Python 3 support)
+* Sam Millar
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index 8af6d67..59725dd 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -24,14 +24,14 @@ If you are reporting a bug, please include:
Fix Bugs
~~~~~~~~
-Look through the GitHub issues for bugs. Anything tagged with "bug"
-is open to whoever wants to implement it.
+Look through the GitHub `issues <https://github.com/trungdong/prov/issues>`_ for bugs.
+Anything tagged with "bug" is open to whoever wants to implement it.
Implement Features
~~~~~~~~~~~~~~~~~~
-Look through the GitHub issues for features. Anything tagged with "feature"
-is open to whoever wants to implement it.
+Look through the GitHub `issues <https://github.com/trungdong/prov/issues>`_
+for features. Anything tagged with "feature" is open to whoever wants to implement it.
Write Documentation
~~~~~~~~~~~~~~~~~~~
@@ -66,7 +66,7 @@ Ready to contribute? Here's how to set up `prov` for local development.
$ mkvirtualenv prov
$ cd prov/
- $ python setup.py develop
+ $ pip install -r requirements-dev.txt
4. Create a branch for local development::
@@ -80,8 +80,6 @@ Ready to contribute? Here's how to set up `prov` for local development.
$ python setup.py test
$ tox
- To get flake8 and tox, just pip install them into your virtualenv.
-
6. Commit your changes and push your branch to GitHub::
$ git add .
@@ -99,10 +97,10 @@ Before you submit a pull request, check that it meets these guidelines:
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
-3. The pull request should work for Python 2.6, 2.7, 3.3, 3.4, and for PyPy.
+3. The pull request should work for Python 2.7, 3.3, 3.4, 3.5, and for PyPy.
Check https://travis-ci.org/trungdong/prov/pull_requests
and make sure that the tests pass for all supported Python versions.
- (See [pyenv](https://github.com/yyuu/pyenv) for help on setting up
+ (See `pyenv <https://github.com/yyuu/pyenv>`_ for help on setting up
multiple versions of Python locally for testing.)
Tips
diff --git a/HISTORY.rst b/HISTORY.rst
index 17d4bf8..b9860b3 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -3,6 +3,14 @@
History
-------
+1.5.0 (2015-10-19)
+^^^^^^^^^^^^^^^^^^
+* Added: Support for `PROV-O <http://www.w3.org/TR/prov-o/>`_ (RDF) serialization and deserialization
+* Added: `direction` option for :py:meth:`prov.dot.prov_to_dot`
+* 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`
+* Testing with Python 3.5
+* Various minor bug fixes and improvements
+
1.4.0 (2015-08-13)
^^^^^^^^^^^^^^^^^^
* Changed the type of qualified names to prov:QUALIFIED_NAME (fixed #68)
diff --git a/LICENSE b/LICENSE
index df0f697..f9524ba 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2014 University of Southampton
+Copyright (c) 2014–2016 University of Southampton
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/MANIFEST.in b/MANIFEST.in
index 99074a0..ec9679f 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -6,6 +6,8 @@ include README.rst
include CHANGES.txt
include prov/tests/json/*.json
include prov/tests/unification/*.json
+include prov/tests/rdf/*.ttl
+include prov/tests/rdf/*.trig
include prov/tests/xml/*.xml
recursive-exclude * __pycache__
diff --git a/PKG-INFO b/PKG-INFO
index 57a281c..6c92fe8 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,7 +1,7 @@
Metadata-Version: 1.1
Name: prov
-Version: 1.4.0
-Summary: A library for W3C Provenance Data Model supporting PROV-JSON and PROV-XML
+Version: 1.5.0
+Summary: A library for W3C Provenance Data Model supporting PROV-JSON, PROV-XML and PROV-O (RDF)
Home-page: https://github.com/trungdong/prov
Author: Trung Dong Huynh
Author-email: trungdong at donggiang.com
@@ -34,18 +34,19 @@ Description: ============
:alt: License
- A library for W3C Provenance Data Model supporting PROV-JSON and PROV-XML import/export
+ A library for W3C Provenance Data Model supporting PROV-O (RDF), PROV-XML, PROV-JSON import/export
* Free software: MIT license
- * Documentation: http://prov.readthedocs.org.
+ * Documentation: http://prov.readthedocs.io/.
Features
--------
* An implementation of the `W3C PROV Data Model <http://www.w3.org/TR/prov-dm/>`_ in Python.
* In-memory classes for PROV assertions, which can then be output as `PROV-N <http://www.w3.org/TR/prov-n/>`_
- * Serialization and deserializtion support: `PROV-JSON <http://www.w3.org/Submission/prov-json/>`_ and `PROV-XML <http://www.w3.org/TR/prov-xml/>`_.
+ * 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/>`_.
* Exporting PROV documents into various graphical formats (e.g. PDF, PNG, SVG).
+ * Convert a PROV document to a `Networkx MultiDiGraph <http://networkx.github.io/documentation/latest/reference/classes.multidigraph.html>`_ and back.
Uses
@@ -62,6 +63,14 @@ Description: ============
History
-------
+ 1.5.0 (2015-10-19)
+ ^^^^^^^^^^^^^^^^^^
+ * Added: Support for `PROV-O <http://www.w3.org/TR/prov-o/>`_ (RDF) serialization and deserialization
+ * Added: `direction` option for :py:meth:`prov.dot.prov_to_dot`
+ * 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`
+ * Testing with Python 3.5
+ * Various minor bug fixes and improvements
+
1.4.0 (2015-08-13)
^^^^^^^^^^^^^^^^^^
* Changed the type of qualified names to prov:QUALIFIED_NAME (fixed #68)
@@ -128,7 +137,7 @@ Description: ============
* Many tests added, including round-trip PROV-JSON encoding/decoding.
* For changes pre-1.0, see CHANGES.txt.
-Keywords: provenance,graph,model,PROV,PROV-DM,PROV-JSON,JSON,PROV-XML,PROV-N
+Keywords: provenance,graph,model,PROV,PROV-DM,PROV-JSON,JSON,PROV-XML,PROV-N,PROV-O,RDF
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
@@ -141,6 +150,7 @@ Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Scientific/Engineering :: Information Analysis
diff --git a/README.rst b/README.rst
index 2872e4a..9fe0a5d 100644
--- a/README.rst
+++ b/README.rst
@@ -26,18 +26,19 @@ Introduction
:alt: License
-A library for W3C Provenance Data Model supporting PROV-JSON and PROV-XML import/export
+A library for W3C Provenance Data Model supporting PROV-O (RDF), PROV-XML, PROV-JSON import/export
* Free software: MIT license
-* Documentation: http://prov.readthedocs.org.
+* Documentation: http://prov.readthedocs.io/.
Features
--------
* An implementation of the `W3C PROV Data Model <http://www.w3.org/TR/prov-dm/>`_ in Python.
* In-memory classes for PROV assertions, which can then be output as `PROV-N <http://www.w3.org/TR/prov-n/>`_
-* Serialization and deserializtion support: `PROV-JSON <http://www.w3.org/Submission/prov-json/>`_ and `PROV-XML <http://www.w3.org/TR/prov-xml/>`_.
+* 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/>`_.
* Exporting PROV documents into various graphical formats (e.g. PDF, PNG, SVG).
+* Convert a PROV document to a `Networkx MultiDiGraph <http://networkx.github.io/documentation/latest/reference/classes.multidigraph.html>`_ and back.
Uses
diff --git a/dev/__init__.py b/dev/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/dev/debug_jsons.py b/dev/debug_jsons.py
new file mode 100644
index 0000000..f0260d0
--- /dev/null
+++ b/dev/debug_jsons.py
@@ -0,0 +1,58 @@
+import subprocess
+from rdflib import Graph, ConjunctiveGraph
+from prov.tests.examples import primer_example, bundles1
+from prov.model import ProvDocument, PROV_AGENT
+
+doc = ProvDocument.deserialize('/Users/tdh/Downloads/history.json')
+# doc.serialize('bindings20_v2.json-ld.json', format='jsonld', indent=2)
+
+
+class ProvConvertException(Exception):
+ def __init__(self, msg=None):
+ self.msg = msg
+
+
+def provconvert(content, toextension, fromextension='json'):
+ stderr = None
+ try:
+ p = subprocess.Popen(
+ [
+ '/usr/local/bin/provconvert',
+ '-infile', '-', '-informat', fromextension,
+ '-outfile', '-', '-outformat', toextension
+ ],
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE
+ )
+ p.stdin.write(content.encode('utf8'))
+ stdout, stderr = p.communicate()
+ return stdout
+ except IOError as e:
+ # The output file cannot be read, reporting any error
+ raise ProvConvertException(stderr)
+
+doc1 = primer_example()
+doc1.serialize('primer.json', format='jsonld', indent=2)
+json_str = doc1.serialize(format='jsonld')
+g = Graph().parse(data=json_str, format='json-ld')
+g2 = ConjunctiveGraph(store=g.store)
+ttl_content = g2.serialize(format='turtle')
+converted_provjson = provconvert(ttl_content, 'json', 'ttl')
+doc2 = ProvDocument.deserialize(content=converted_provjson)
+
+assert(doc1 == doc2)
+
+primer_example().serialize(format='jsonlds', beautify=True)
+
+bundles1().serialize('bundles1.json', format='jsonld', indent=2)
+json_str = bundles1().serialize(format='jsonld')
+g = Graph().parse(data=json_str, format='json-ld')
+g2 = ConjunctiveGraph(store=g.store)
+g2.serialize('bundles1.trig', format='trig')
+
+
+doc1 = ProvDocument(namespaces={'ex': 'http://www.example.com/'})
+doc1.entity('ex:e1', {'prov:type': PROV_AGENT})
+doc1.wasGeneratedBy('ex:e1', 'ex:a1')
+print(doc1.serialize(format='jsonld', indent=2))
diff --git a/dev/script.py b/dev/script.py
new file mode 100644
index 0000000..4bd6af9
--- /dev/null
+++ b/dev/script.py
@@ -0,0 +1,99 @@
+from __future__ import absolute_import
+from __future__ import print_function
+from __future__ import unicode_literals
+from prov.model import ProvDocument, Namespace
+from prov.dot import prov_to_dot
+import requests
+
+# Configure ProvStore API Wrapper with your API Key
+from provstore.api import Api
+# see your API key at https://provenance.ecs.soton.ac.uk/store/account/developer/
+api = Api(username='tdh', api_key='64d26d6e74a3303976cb967429a12ec0c0e35a80')
+
+retrieved_document = api.document.get(34494)
+
+# json_content = u'{"wasDerivedFrom": {"_:id1": {"prov:usedEntity": "template:10", "prov:generatedEntity": "b:6153", "prov:type": {"type": "prov:QualifiedName", "$": "pic:Expansion"}}, "_:id3": {"prov:usedEntity": "bindings:5695", "prov:generatedEntity": "b:6153", "prov:type": {"type": "prov:QualifiedName", "$": "pic:BindingsDerivation"}}}, "prefix": {"b": "https://provenance.ecs.soton.ac.uk/picaso/bundles/", "pic": "http://www.ipaw.info/ns/picaso#", "u": "https://provenance.ecs.soton.ac [...]
+json_content = '''
+{
+ "prefix": {
+ "ex": "http://example.org/"
+ },
+ "activity": {
+ "ex:a6": {
+ "prov:location": [
+ {
+ "$": "London",
+ "type": "xsd:string"
+ },
+ {
+ "$": "1",
+ "type": "xsd:int"
+ },
+ {
+ "$": "1.0",
+ "type": "xsd:float"
+ },
+ {
+ "$": "true",
+ "type": "xsd:boolean"
+ },
+ {
+ "$": "ex:london",
+ "type": "xsd:QName"
+ },
+ {
+ "$": "2014-06-23T12:28:53.858+01:00",
+ "type": "xsd:dateTime"
+ },
+ {
+ "$": "http://example.org/london",
+ "type": "xsd:anyURI"
+ },
+ {
+ "$": "2002",
+ "type": "xsd:gYear"
+ }
+ ],
+ "prov:label": "activity6"
+ }
+ }
+}
+'''
+
+# r = requests.get('https://provenance.ecs.soton.ac.uk/store/documents/29316.json')
+# json_content = r.text
+# doc = ProvDocument.deserialize(content=json_content)
+# e = doc.flattened().get_record('crowdreport/166')
+# doc = ProvDocument(e)
+# json_content = doc.serialize(encoding='utf8')
+# print json_content
+
+# json_content = '{"prefix": {"default": "https://provenance.ecs.soton.ac.uk/atomicorchid/data/12/", "ao": "https://provenance.ecs.soton.ac.uk/atomicorchid/ns#"}, "entity": {"crowdreport/166": {"ao:report": "please help a mom rescue her children who are still alive\u001a??", "ao:name": "crowdreporter_4", "ao:latitude": "221.0", "ao:longitude": "283.0"}}}'
+
+# doc = ProvDocument.deserialize(content=json_content)
+doc = ProvDocument.deserialize('prov/tests/json/attr_association_one_role_attr44.json')
+print(doc.get_provn())
+
+# dot = prov_to_dot(doc)
+#
+# dot.write_raw('test.dot')
+
+# prov_doc = ProvDocument()
+# ex = Namespace('ex', 'http://www.example.org/')
+# prov_doc.add_namespace(ex)
+# ex1 = Namespace('ex1', 'http://www.example1.org/') # ex1 is not added to the document
+#
+# an_xsd_qname = XSDQName(ex['a_value'])
+# another_xsd_qname = XSDQName(ex1['another_value'])
+#
+# e1 = prov_doc.entity('ex:e1', {'prov:value': an_xsd_qname, 'prov:type': another_xsd_qname})
+# for _, attr_value in e1.attributes:
+# print isinstance(attr_value, XSDQName)
+#
+# xml_content = prov_doc.serialize(format='xml')
+# new_doc = ProvDocument.deserialize(content=xml_content, format='xml')
+# print new_doc.get_provn()
+# print new_doc == prov_doc
+
+# entity(ex:e1, [prov:type="ex1:another_value" %% xsd:QName, prov:value="ex:a_value" %% xsd:QName])
+# entity(ex:e1, [prov:type='ex1:another_value', prov:value='ex:a_value'])
\ No newline at end of file
diff --git a/dev/test_count_JSON-LD.py b/dev/test_count_JSON-LD.py
new file mode 100644
index 0000000..5090f91
--- /dev/null
+++ b/dev/test_count_JSON-LD.py
@@ -0,0 +1,38 @@
+from __future__ import unicode_literals
+from collections import Counter
+import json
+import os
+
+
+ at profile
+def count_records(filename):
+ n_recs = 0
+ counter = Counter()
+ with open(filename) as f:
+ content = json.load(f)
+ if "@graph" in content:
+ records = content["@graph"]
+ n_recs = len(records)
+ for record in records:
+ try:
+ types = record["@type"]
+ t = types[0] if isinstance(types, list) else types
+ except KeyError:
+ # if "prov:alternateOf" in record:
+ # t = "prov:Alternate"
+ # elif "prov:specializationOf" in record:
+ # t = "prov:Specialization"
+ # elif "prov:hadMember" in record:
+ # t = "prov:Membership"
+ # else:
+ t = "unknown"
+ counter[t] += 1
+ return n_recs, counter
+
+dataset = os.getenv("DATASET")
+filename = "%s.jsonld" % dataset
+print("Opening %s..." % filename)
+n_recs, counter = count_records(filename)
+print("Seen %d records." % n_recs)
+print("\n".join(map(lambda t: "- %s: %d" % t, counter.items())))
+assert(sum(counter.values()) == n_recs)
diff --git a/dev/test_count_PROV-JSON.py b/dev/test_count_PROV-JSON.py
new file mode 100644
index 0000000..12d7f72
--- /dev/null
+++ b/dev/test_count_PROV-JSON.py
@@ -0,0 +1,25 @@
+from __future__ import unicode_literals
+from collections import Counter
+import json
+import os
+
+
+ at profile
+def count_records(filename):
+ n_recs = 0
+ counter = Counter()
+ with open(filename) as f:
+ content = json.load(f)
+ for term, records in content.items():
+ if term != "prefix":
+ n_recs += len(records)
+ counter[term] += len(records)
+ return n_recs, counter
+
+dataset = os.getenv("DATASET")
+filename = "%s.json" % dataset
+print("Opening %s..." % filename)
+n_recs, counter = count_records(filename)
+print("Seen %d records." % n_recs)
+print("\n".join(map(lambda t: "- %s: %d" % t, counter.items())))
+assert(sum(counter.values()) == n_recs)
diff --git a/dev/test_count_Streaming.py b/dev/test_count_Streaming.py
new file mode 100644
index 0000000..c6c747e
--- /dev/null
+++ b/dev/test_count_Streaming.py
@@ -0,0 +1,82 @@
+from __future__ import unicode_literals
+from collections import Counter
+import os
+from yajl import YajlParser, YajlContentHandler
+
+
... 13688 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-prov.git
More information about the Python-modules-commits
mailing list