Import W3C PROV documents into Neo4j using py2neo's OGM.
Project description
prov2neo — Import W3C PROV Documents to Neo4j
prov2neo
is a Python library for importing W3C PROV documents into Neo4j.
prov2neo
enables faster imports than comparable libs such as prov-db-connector
.
Installation
Clone the project and use the provided setup.py
to install prov2neo
locally
python setup.py install --user
Or install releases from PyPI:
pip install prov2neo
Usage
prov2neo can be used both as a command line script and as a Python lib.
As a Command Line Script
usage: prov2neo [-h] [-f {provn,json,rdf,xml}] [-i INPUT [INPUT ...]] [-a ADDRESS]
[-u USERNAME] [-p PASSWORD] [-n NAME]
[-s {bolt,bolt+s,bolt+ssc,http,https,http+s,http+ssc}]
Import W3C PROV documents to Neo4j.
optional arguments:
-h, --help show this help message and exit
-f {provn,json,rdf,xml}, --format {provn,json,rdf,xml}
input PROV format
-i INPUT [INPUT ...], --input INPUT [INPUT ...]
input files, use '.' for stdin
-a ADDRESS, --address ADDRESS
Neo4j address
-u USERNAME, --username USERNAME
Neo4j username
-p PASSWORD, --password PASSWORD
Neo4j password
-n NAME, --name NAME Neo4j target database name
-s {bolt,bolt+s,bolt+ssc,http,https,http+s,http+ssc}, --scheme {bolt,bolt+s,bolt+ssc,http,https,http+s,http+ssc}
connection scheme to use when connecting to Neo4j
As a Python Lib
from prov.model import ProvDocument
from prov2neo.client import Client
# read graph from JSON serialization
graph = ProvDocument.deserialize(source="examples/horsemeat.json", format="json")
# create a prov2neo client
client = Client()
# connect to the neo4j instance
client.connect(
address="localhost:7687",
user="jane doe",
password="**redacted**",
name="database name",
scheme="bolt"
)
# import the PROV graph
client.import_graph(graph)
prov2neo supports formats that the prov
library provides:
Contributing
Merge and Pull requests are welcome!
For major changes, please open an issue first to discuss what you would like to change.
License
MIT
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
Built Distribution
File details
Details for the file prov2neo-1.2.tar.gz
.
File metadata
- Download URL: prov2neo-1.2.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b661ba4db3e3672a27a5b4a046591f58b02d95e4b7af9e1fa2a26cdf8f5ecbb8 |
|
MD5 | de56a63637935bfc8066075d94a4de0a |
|
BLAKE2b-256 | 9e13e3eed2d79c208edb1f36c4e9dd1812f545700862c00ce69cba479085b4d2 |
File details
Details for the file prov2neo-1.2-py3-none-any.whl
.
File metadata
- Download URL: prov2neo-1.2-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec6a077d9d754f52a92c47548cb57047df0d3a93f7525490a4b5921af31b8f00 |
|
MD5 | 398a1b454fc78eeb4d652ec7ce01832c |
|
BLAKE2b-256 | e4c87c43a66e50c1460160661383c20671ee0cbd8dd4a8524390ebe326626a00 |