-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprov-python-short-tutorial.html
More file actions
105 lines (98 loc) · 6.34 KB
/
Copy pathprov-python-short-tutorial.html
File metadata and controls
105 lines (98 loc) · 6.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Dong Huynh">
<link rel="alternate" href="https://trungdong.github.io/feeds/all.atom.xml" type="application/atom+xml" title="Dong Huynh Full Atom Feed"/>
<title>A Short Tutorial for Prov Python // Dong Huynh</title>
<link rel="stylesheet" href="https://trungdong.github.io/theme/css/style.css">
<link rel="stylesheet" href="https://trungdong.github.io/theme/css/pygments.css">
</head>
<body>
<div id="layout">
<div class="sidebar sidebar-article">
<header class="header-article">
<h2 class="article-info"><a href="https://trungdong.github.io/author/dong-huynh.html" title="See posts by Dong Huynh">Dong Huynh</a></h2>
<h3 class="published-label">Published</h3>
<p><time datetime="2014-08-07T23:42:26+01:00">Thu 07 August 2014</time></p>
<a href="/">←Home</a>
</header>
</div>
<div class="main">
<div class="content">
<section class="post">
<header class="post-header">
<h1>A Short Tutorial for Prov Python</h1>
<p class="post-meta">
// under <a class="post-category" href="https://trungdong.github.io/tag/prov-json.html">PROV-JSON</a>
<a class="post-category" href="https://trungdong.github.io/tag/prov-n.html">PROV-N</a>
<a class="post-category" href="https://trungdong.github.io/tag/provpy.html">ProvPy</a>
<a class="post-category" href="https://trungdong.github.io/tag/provstore.html">ProvStore</a>
<a class="post-category" href="https://trungdong.github.io/tag/python.html">Python</a>
<a class="post-category" href="https://trungdong.github.io/tag/tutorial.html">tutorial</a>
</p>
</header>
</section>
<p>Documentation is hard work! I started the work on the <a href="https://pypi.python.org/pypi/prov/">PROV Python package</a> nearly <a href="https://github.com/trungdong/prov/graphs/contributors">three years ago</a> and yet its <a href="https://prov.readthedocs.io/">documentation</a> is still quite lacking. As a small effort to make up for it, I thought a simple tutorial might help a bit. </p>
<p>So here it is: <a href="https://nbviewer.org/github/trungdong/notebooks/blob/master/PROV%20Tutorial.ipynb">the first tutorial for PROV Python</a>! </p>
<p>It will guide you through:</p>
<ul>
<li>Installing the Prov package</li>
<li>Creating a PROV document in Python</li>
<li>Exporting the document into <a href="https://www.w3.org/TR/prov-n/">PROV-N</a> and <a href="https://www.w3.org/Submission/2013/SUBM-prov-json-20130424/">PROV-JSON</a></li>
<li>Displaying the document in a graphical format like the one on the right</li>
<li>Saving a provenance document in the cloud at <a href="https://openprovenance.org/store/">ProvStore</a> and retrieve it back</li>
</ul>
<p>All the above can be done in 10-15 minutes! </p>
<p>I hope you find <a href="https://nbviewer.org/github/trungdong/notebooks/blob/master/PROV%20Tutorial.ipynb">the tutorial</a> useful. Any suggestion or request, please do <a href="https://github.com/trungdong/notebooks/issues">let me know here</a>. </p>
<p><img alt="PROV-N JavaScript Editor Screenshot" src="https://trungdong.github.io/images/provbook-example.png"></p>
<p>PNG export of a simple example from the book <a href="https://www.provbook.org/">Provenance: An Introduction to PROV</a></p>
<p><em>Updated 27-Feb-2015</em>: I added a simple instruction in the tutorial showing how to read (i.e. deserialise) a PROV-JSON file into a ProvDocument instance. In addition, I simplified the section on interacting with <a href="https://openprovenance.org/store/">ProvStore</a> by using <a href="https://millar.io/">Sam Millar</a>'s <a href="https://github.com/millar/provstore-api">provstore-api</a> package.</p>
<div class="hr"></div>
<a href="#" class="go-top">Go Top</a>
<div class="comments">
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = "trungdong-github-io"; // required: replace example with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
</div><footer class="footer">
<p>© Dong Huynh –
Built for <a href="https://getpelican.com/">Pelican</a>
</p>
</footer> </div>
</div>
</div>
<script>
// Replaces jQuery 2.0.3, which the theme loaded from a CDN to do only this.
(function () {
var top = document.querySelector('.go-top');
if (top) {
var sync = function () {
top.classList.toggle('is-visible', window.scrollY > 200);
};
sync();
window.addEventListener('scroll', sync, { passive: true });
top.addEventListener('click', function (event) {
event.preventDefault();
window.scrollTo({ top: 0, behavior: 'smooth' });
});
}
// Anchors that exist only to be styled should not jump to the top.
document.addEventListener('click', function (event) {
var anchor = event.target.closest('a[href="#"]');
if (anchor) { event.preventDefault(); }
});
}());
</script>
<script data-goatcounter="https://trungdong.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script></body>
</html>