{"id":18888675,"url":"https://github.com/dlr-sc/prov-db-connector","last_synced_at":"2025-07-24T11:15:25.336Z","repository":{"id":11168738,"uuid":"68604048","full_name":"DLR-SC/prov-db-connector","owner":"DLR-SC","description":"PROV Database Connector","archived":false,"fork":false,"pushed_at":"2023-06-30T04:13:44.000Z","size":1225,"stargazers_count":17,"open_issues_count":7,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-13T21:38:39.379Z","etag":null,"topics":["graph-database","neo4j","provenance","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DLR-SC.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-19T12:34:34.000Z","updated_at":"2024-08-21T12:00:07.000Z","dependencies_parsed_at":"2024-11-08T07:45:45.453Z","dependency_job_id":"1e2aea6c-430f-4f61-a539-3d96b171df00","html_url":"https://github.com/DLR-SC/prov-db-connector","commit_stats":{"total_commits":504,"total_committers":13,"mean_commits":38.76923076923077,"dds":"0.27380952380952384","last_synced_commit":"26d0e45fbad8dd23ddab44a7070d794dde3723a6"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DLR-SC%2Fprov-db-connector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DLR-SC%2Fprov-db-connector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DLR-SC%2Fprov-db-connector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DLR-SC%2Fprov-db-connector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DLR-SC","download_url":"https://codeload.github.com/DLR-SC/prov-db-connector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975716,"owners_count":21192275,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graph-database","neo4j","provenance","python"],"created_at":"2024-11-08T07:45:32.298Z","updated_at":"2025-04-14T23:21:49.269Z","avatar_url":"https://github.com/DLR-SC.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"PROV Database Connector\n=======================\n\nIntroduction\n------------\n\n.. image:: https://zenodo.org/badge/68604048.svg\n    :target: https://zenodo.org/badge/latestdoi/68604048\n    :alt: Latest release\n.. image:: https://badge.fury.io/py/prov-db-connector.svg\n    :target: https://pypi.python.org/pypi/prov-db-connector\n    :alt: PyPI version\n.. image:: https://travis-ci.org/DLR-SC/prov-db-connector.svg?branch=master\n    :target: https://travis-ci.org/DLR-SC/prov-db-connector\n    :alt: Build Status\n.. image:: https://coveralls.io/repos/github/DLR-SC/prov-db-connector/badge.svg?branch=master\n    :target: https://coveralls.io/github/DLR-SC/prov-db-connector?branch=master\n    :alt: Coverage Status\n.. image:: https://pyup.io/repos/github/dlr-sc/prov-db-connector/shield.svg\n    :target: https://pyup.io/repos/github/dlr-sc/prov-db-connector/\n    :alt: Updates\n\n\n\nThis python module provides a general interface to save `W3C-PROV \u003chttps://www.w3.org/TR/prov-overview/\u003e`_ documents into databases.\nCurrently we support the `Neo4j \u003chttps://neo4j.com/\u003e`_ graph database.\n\nWe transform a PROV document into a graph structure and the result looks like this:\n\n.. figure:: https://cdn.rawgit.com/dlr-sc/prov-db-connector/master/docs/_images/test_cases/test_prov_primer_example.svg\n   :align: center\n   :scale: 50 %\n   :alt: Complex example in Neo4j\n\n   Complex example in Neo4j\n\nSee full documentation at: `prov-db-connector.readthedocs.io \u003chttp://prov-db-connector.readthedocs.io\u003e`_\n\nInstallation\n------------\n\nPyPi\n~~~~\n\nInstall it by running::\n\n    pip install prov-db-connector\n\nYou can view `prov-db-connector on PyPi's package index \u003chttps://pypi.python.org/pypi/prov-db-connector/\u003e`_\n\nSource\n~~~~~~\n\n.. code:: sh\n\n    # Clone project\n    git clone git@github.com:DLR-SC/prov-db-connector.git\n    cd prov-db-connector\n\n    # Setup virtual environment\n    virtualenv -p /usr/bin/python3.4 env\n    source env/bin/activate\n\n    # Install dependencies and package into virtual enviroment\n    make setup\n\nUsage\n-----\n\nSave and get prov document example\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\n.. code-block:: python\n\n    from prov.model import ProvDocument\n    from provdbconnector import ProvDb\n    from provdbconnector.db_adapters.in_memory import SimpleInMemoryAdapter\n\n    prov_api = ProvDb(adapter=SimpleInMemoryAdapter, auth_info=None)\n\n    # create the prov document\n    prov_document = ProvDocument()\n    prov_document.add_namespace(\"ex\", \"http://example.com\")\n\n    prov_document.agent(\"ex:Bob\")\n    prov_document.activity(\"ex:Alice\")\n\n    prov_document.association(\"ex:Alice\", \"ex:Bob\")\n\n    document_id = prov_api.save_document(prov_document)\n\n    print(prov_api.get_document_as_provn(document_id))\n\n    # Output:\n    #\n    # document\n    # prefix\n    # ex \u003c http: // example.com \u003e\n    #\n    # agent(ex:Bob)\n    # activity(ex:Alice, -, -)\n    # wasAssociatedWith(ex:Alice, ex:Bob, -)\n    # endDocument\n\n\nFile Buffer example\n~~~~~~~~~~~~~~~~~~~\n\n\n.. code-block:: python\n\n    from provdbconnector import ProvDb\n    from provdbconnector.db_adapters.in_memory import SimpleInMemoryAdapter\n    import pkg_resources\n\n    # create the api\n    prov_api = ProvDb(adapter=SimpleInMemoryAdapter, auth_info=None)\n\n    # create the prov document from examples\n    prov_document_buffer = pkg_resources.resource_stream(\"examples\", \"file_buffer_example_primer.json\")\n\n    # Save document\n    document_id = prov_api.save_document(prov_document_buffer)\n    # This is similar to:\n    # prov_api.create_document_from_json(prov_document_buffer)\n\n    # get document\n    print(prov_api.get_document_as_provn(document_id))\n\n    # Output:\n\n    # document\n    # prefix\n    # foaf \u003c http: // xmlns.com / foaf / 0.1 / \u003e\n    # prefix\n    # dcterms \u003c http: // purl.org / dc / terms / \u003e\n    # prefix\n    # ex \u003c http: // example / \u003e\n    #\n    # specializationOf(ex:articleV2, ex:article)\n    # specializationOf(ex:articleV1, ex:article)\n    # wasDerivedFrom(ex:blogEntry, ex:article, -, -, -, [prov:type = 'prov:Quotation'])\n    # alternateOf(ex:articleV2, ex:articleV1)\n    # wasDerivedFrom(ex:articleV1, ex:dataSet1, -, -, -)\n    # wasDerivedFrom(ex:articleV2, ex:dataSet2, -, -, -)\n    # wasDerivedFrom(ex:dataSet2, ex:dataSet1, -, -, -, [prov:type = 'prov:Revision'])\n    # used(ex:correct, ex:dataSet1, -)\n    # used(ex:compose, ex:dataSet1, -, [prov:role = \"ex:dataToCompose\"])\n    # wasDerivedFrom(ex:chart2, ex:dataSet2, -, -, -)\n    # wasGeneratedBy(ex:dataSet2, ex:correct, -)\n    # used(ex:compose, ex:regionList, -, [prov:role = \"ex:regionsToAggregateBy\"])\n    # used(ex:illustrate, ex:composition, -)\n    # wasGeneratedBy(ex:composition, ex:compose, -)\n    # wasAttributedTo(ex:chart1, ex:derek)\n    # wasGeneratedBy(ex:chart1, ex:compile, 2012 - 03 - 02\n    # T10:30:00)\n    # wasGeneratedBy(ex:chart1, ex:illustrate, -)\n    # wasAssociatedWith(ex:compose, ex:derek, -)\n    # wasAssociatedWith(ex:illustrate, ex:derek, -)\n    # actedOnBehalfOf(ex:derek, ex:chartgen, ex:compose)\n    # entity(ex:article, [dcterms:title = \"Crime rises in cities\"])\n    # entity(ex:articleV1)\n    # entity(ex:articleV2)\n    # entity(ex:dataSet1)\n    # entity(ex:dataSet2)\n    # entity(ex:regionList)\n    # entity(ex:composition)\n    # entity(ex:chart1)\n    # entity(ex:chart2)\n    # entity(ex:blogEntry)\n    # activity(ex:compile, -, -)\n    # activity(ex:compile2, -, -)\n    # activity(ex:compose, -, -)\n    # activity(ex:correct, 2012 - 03 - 31\n    # T09:21:00, 2012 - 04 - 01\n    # T15:21:00)\n    # activity(ex:illustrate, -, -)\n    # agent(ex:derek, [foaf:mbox = \"\u003cmailto:derek@example.org\u003e\", foaf:givenName = \"Derek\", prov:type = 'prov:Person'])\n    # agent(ex:chartgen, [foaf:name = \"Chart Generators Inc\", prov:type = 'prov:Organization'])\n    # endDocument\n\n\nYou find all examples in the `examples \u003chttps://github.com/DLR-SC/prov-db-connector/tree/master/examples\u003e`_ folder\n\n\nRelease\n-------\nCreate a new release on github, please use the semver standard for the version number\n\n\nLicense\n-------\n\nSee `LICENSE \u003chttps://github.com/DLR-SC/prov-db-connector/blob/master/LICENSE\u003e`_ file\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlr-sc%2Fprov-db-connector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdlr-sc%2Fprov-db-connector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlr-sc%2Fprov-db-connector/lists"}