A simple python implementation of the W3C PROV data model
Project description
Kleio
=====
`|Build Status| <https://travis-ci.org/tetherless-world/kleio>`_
`|License| <https://github.com/tetherless-world/kleio/blob/master/LICENSE>`_
`|Latest Release| <http://badge.fury.io/py/kleio>`_
`|Downloads| <https://pypi.python.org/pypi/kleio/>`_
A python library for W3C Provenance Data Model supporting PROV-O.
Kleio is free software released under the MIT license.
Features
--------
- An implementation of the W3C PROV Data Model in Python
- Supports serialization and deserialization as PROV-O in RDF/XML,
Turtle, TriG, N3, NTriples, and JSON-LD formats
- Supports provenance-of-provenance (PROV bundles) via named graphs
- Built using `RDFlib <https://github.com/RDFLib/rdflib>`_
Getting Started
---------------
Kleio can be installed from PyPI using the pip installer:
::
$ pip install kleio
From kleio use the prov module to generate PROV records and output
PROV-O.
\`\`\`python from kleio import prov
prov.ns("test", "http://tw.rpi.edu/ns/test#")
entity = prov.Entity("test:entity") entity.set\_label("example entity")
activity = prov.Activity("test:activity") activity.set\_label("example
activity")
entity.set\_was\_generated\_by(activity)
print(prov.serialize(format="turtle")) \`\`\` output:
::
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix test: <http://tw.rpi.edu/ns/test#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<test:activity> a prov:Activity ;
rdfs:label "example activity" ;
prov:generated <test:entity> ;
prov:influenced <test:entity> .
<test:entity> a prov:Entity ;
rdfs:label "example entity" ;
prov:wasGeneratedBy <test:activity> ;
prov:wasInfluencedBy <test:activity> .
Kleio can also be used to load and update existing PROV-O records.
::
from kleio import prov
# load the existing PROV-O graph
prov.graph.load("load-example.ttl", format="turtle")
# get a reference to the existing entity with id="test:entity"
entity = prov.Entity("test:entity")
# ... update entity ...
Support
-------
More information is available on the project webpage:
https://github.com/tetherless-world/kleio
Continuous integration status details available from Travis CI:
https://travis-ci.org/tetherless-world/kleio
The documentation can be built by doing:
::
$ python setup.py build_sphinx
And is also available from ReadTheDocs:
http://kleio.readthedocs.org/en/latest
.. |Build
Status| image:: https://travis-ci.org/tetherless-world/kleio.svg?branch=master
.. |License| image:: http://img.shields.io/badge/license-MIT-brightgreen.svg
.. |Latest Release| image:: https://badge.fury.io/py/kleio.svg
.. |Downloads| image:: https://pypip.in/download/kleio/badge.svg
=====
`|Build Status| <https://travis-ci.org/tetherless-world/kleio>`_
`|License| <https://github.com/tetherless-world/kleio/blob/master/LICENSE>`_
`|Latest Release| <http://badge.fury.io/py/kleio>`_
`|Downloads| <https://pypi.python.org/pypi/kleio/>`_
A python library for W3C Provenance Data Model supporting PROV-O.
Kleio is free software released under the MIT license.
Features
--------
- An implementation of the W3C PROV Data Model in Python
- Supports serialization and deserialization as PROV-O in RDF/XML,
Turtle, TriG, N3, NTriples, and JSON-LD formats
- Supports provenance-of-provenance (PROV bundles) via named graphs
- Built using `RDFlib <https://github.com/RDFLib/rdflib>`_
Getting Started
---------------
Kleio can be installed from PyPI using the pip installer:
::
$ pip install kleio
From kleio use the prov module to generate PROV records and output
PROV-O.
\`\`\`python from kleio import prov
prov.ns("test", "http://tw.rpi.edu/ns/test#")
entity = prov.Entity("test:entity") entity.set\_label("example entity")
activity = prov.Activity("test:activity") activity.set\_label("example
activity")
entity.set\_was\_generated\_by(activity)
print(prov.serialize(format="turtle")) \`\`\` output:
::
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix test: <http://tw.rpi.edu/ns/test#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<test:activity> a prov:Activity ;
rdfs:label "example activity" ;
prov:generated <test:entity> ;
prov:influenced <test:entity> .
<test:entity> a prov:Entity ;
rdfs:label "example entity" ;
prov:wasGeneratedBy <test:activity> ;
prov:wasInfluencedBy <test:activity> .
Kleio can also be used to load and update existing PROV-O records.
::
from kleio import prov
# load the existing PROV-O graph
prov.graph.load("load-example.ttl", format="turtle")
# get a reference to the existing entity with id="test:entity"
entity = prov.Entity("test:entity")
# ... update entity ...
Support
-------
More information is available on the project webpage:
https://github.com/tetherless-world/kleio
Continuous integration status details available from Travis CI:
https://travis-ci.org/tetherless-world/kleio
The documentation can be built by doing:
::
$ python setup.py build_sphinx
And is also available from ReadTheDocs:
http://kleio.readthedocs.org/en/latest
.. |Build
Status| image:: https://travis-ci.org/tetherless-world/kleio.svg?branch=master
.. |License| image:: http://img.shields.io/badge/license-MIT-brightgreen.svg
.. |Latest Release| image:: https://badge.fury.io/py/kleio.svg
.. |Downloads| image:: https://pypip.in/download/kleio/badge.svg
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
kleio-0.2.3.tar.gz
(12.4 kB
view details)
Built Distributions
kleio-0.2.3-py3.5.egg
(25.3 kB
view details)
kleio-0.2.3-py3.4.egg
(25.4 kB
view details)
kleio-0.2.3-py3.3.egg
(25.9 kB
view details)
File details
Details for the file kleio-0.2.3.tar.gz
.
File metadata
- Download URL: kleio-0.2.3.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f7448d27ec1b236e82add50b294b7bcb978287222960935b4555d634a5bee41 |
|
MD5 | d7d4542ccf927c3db00acf75d7b6efc7 |
|
BLAKE2b-256 | b34ff3afadc37dd1313ea1ac7e107d2bdbd6ad9a7d34cab0ccea5cac055cffc9 |
File details
Details for the file kleio-0.2.3-py3.5.egg
.
File metadata
- Download URL: kleio-0.2.3-py3.5.egg
- Upload date:
- Size: 25.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e15da368a15d0dce2f4e218bd4bb52a88a0ec47d587f58d96706f704cc61ef94 |
|
MD5 | 35ffa87ff14a48e7446a08910cb013d9 |
|
BLAKE2b-256 | fe63355d254f8a480ce0880e5f8c7ea00adc71fb3fdc203cdee9ec6c1531524e |
File details
Details for the file kleio-0.2.3-py3.4.egg
.
File metadata
- Download URL: kleio-0.2.3-py3.4.egg
- Upload date:
- Size: 25.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6a96a79b2c5763ec4bf6c10706e13e6b8007f1662e805263227814c7da6a476 |
|
MD5 | 4c040f55c094cfcf7d27a91dc19ce433 |
|
BLAKE2b-256 | 2b90af3918d72e141cfe0e565a1a52405b5ddf876271052f731d4fff8d9b3ce4 |
File details
Details for the file kleio-0.2.3-py3.3.egg
.
File metadata
- Download URL: kleio-0.2.3-py3.3.egg
- Upload date:
- Size: 25.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 291330fc8aa0ddfad312812b8e9f8d346ae93f3eb0adee0e8d41015c4362fc27 |
|
MD5 | 3354751d39fea68f732d0ee25da532c1 |
|
BLAKE2b-256 | bec9dae3e3f794ea0248c50920d53537e8611eb0a449543fe2a1074bef8fc5ee |