DLR-SC / prov2neo

⬆️ Import W3C PROV documents to Neo4j.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Welcome to prov2neo! 👋

License: MIT Badge: Made with Python Badge: PyPi Version Badge: PyPi Downloads Monthly Twitter: DLR Software Badge: Open in VSCode Badge: DOI Badge: W3C PROV Badge: Citation File Format Inside

prov2neo is a Python library and command line tool that imports W3C PROV documents into Neo4j.


prov2neo enables faster imports than comparable libs such as prov-db-connector with the limitation of being specialized for neo4j.

🏗️ Installation

Clone the project and use pip to install prov2neo locally:

pip install .

Or install the latest release from PyPi:

pip install prov2neo

To install prov2neo with all dependencies for development, use:

pip install .[dev]         # when cloned from GitHub
pip install prov2neo[dev]  # when installing from PyPi

🚀 Usage

prov2neo can be used as a command line script or as a Python lib.

As a Command Line Script

Usage: prov2neo [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...

  Connect to a neo4j instance and import/export provenance documents.

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  connect  Connect to a neo4j instance.
  export   (Deprecated) Export a provenance document from neo4j.
  import   Import a provenance document into neo4j.

As a Python Lib

from prov2neo import Client, read_doc

doc = read_doc(filepath="examples/horsemeat.json")

# create a client
client = Client()
# connect to your neo4j instance
client.connect(
    username="neo4j",
    password="neo4j",
    dbname="neo4j",
    address="localhost:7687",
    scheme="bolt"
)
# import the document
client.import_doc(doc)

Supported Formats

prov2neo supports all deserialization formats supported by the prov library. Deserialization and with it the import of documents through the command line tool is limited to the following formats:

🤝 Contributing

Contributions and pull requests are welcome!
For major changes, please open an issue first to discuss what you would like to change.

✨ Citable Software

This project is citable and contains a CITATION.cff file!
Please cite the project using the metadata contained in the CITATION.cff if you use prov2neo in your research.

CITATION.cff files are plain text files with human- and machine-readable citation information for software (and datasets).
To find out more about GitHub's support for citation metadata visit here

📝 License

This project is MIT licensed.
Copyright © 2020-2022 German Aerospace Center (DLR) and individual contributors.

About

⬆️ Import W3C PROV documents to Neo4j.

License:MIT License


Languages

Language:Python 100.0%