All Projects → DLR-SC → prov-db-connector

DLR-SC / prov-db-connector

Licence: Apache-2.0 license
PROV Database Connector

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to prov-db-connector

Neo4j 3d Force Graph
Experiments with Neo4j & 3d-force-graph https://github.com/vasturiano/3d-force-graph
Stars: ✭ 159 (+960%)
Mutual labels:  neo4j, graph-database
Helicalinsight
Helical Insight software is world’s first Open Source Business Intelligence framework which helps you to make sense out of your data and make well informed decisions.
Stars: ✭ 214 (+1326.67%)
Mutual labels:  neo4j, graph-database
Neo4j Etl
Data import from relational databases to Neo4j.
Stars: ✭ 165 (+1000%)
Mutual labels:  neo4j, graph-database
Neo4j Streams
Neo4j Kafka Integrations, Docs =>
Stars: ✭ 126 (+740%)
Mutual labels:  neo4j, graph-database
CyFHIR
A Neo4j Plugin for Handling HL7 FHIR Data
Stars: ✭ 39 (+160%)
Mutual labels:  neo4j, graph-database
Reddit Detective
Play detective on Reddit: Discover political disinformation campaigns, secret influencers and more
Stars: ✭ 129 (+760%)
Mutual labels:  neo4j, graph-database
Bolt sips
Neo4j driver for Elixir
Stars: ✭ 204 (+1260%)
Mutual labels:  neo4j, graph-database
Activegraph
An active model wrapper for the Neo4j Graph Database for Ruby.
Stars: ✭ 1,329 (+8760%)
Mutual labels:  neo4j, graph-database
angular-neo4j
Neo4j Bolt driver wrapper for Angular
Stars: ✭ 18 (+20%)
Mutual labels:  neo4j, graph-database
database-journal
Databases: Concepts, commands, codes, interview questions and more...
Stars: ✭ 50 (+233.33%)
Mutual labels:  neo4j, graph-database
Movies Javascript Bolt
Neo4j Movies Example with webpack-in-browser app using the neo4j-javascript-driver
Stars: ✭ 123 (+720%)
Mutual labels:  neo4j, graph-database
neo4j.cr
Pure-Crystal implementation of Neo4j's Bolt protocol
Stars: ✭ 29 (+93.33%)
Mutual labels:  neo4j, graph-database
Libneo4j Client
neo4j-client -- Neo4j Command Line Interface (CLI)
Stars: ✭ 121 (+706.67%)
Mutual labels:  neo4j, graph-database
Neo4j Php Ogm
Neo4j Object Graph Mapper for PHP
Stars: ✭ 151 (+906.67%)
Mutual labels:  neo4j, graph-database
Neo4j Core
A simple unified API that can access both the server and embedded Neo4j database. Used by the neo4j gem
Stars: ✭ 99 (+560%)
Mutual labels:  neo4j, graph-database
Movies Python Bolt
Neo4j Movies Example application with Flask backend using the neo4j-python-driver
Stars: ✭ 197 (+1213.33%)
Mutual labels:  neo4j, graph-database
Neo4j
Graphs for Everyone
Stars: ✭ 9,582 (+63780%)
Mutual labels:  neo4j, graph-database
Neo4j Apoc Procedures
Awesome Procedures On Cypher for Neo4j - codenamed "apoc"                     If you like it, please ★ above ⇧            
Stars: ✭ 1,291 (+8506.67%)
Mutual labels:  neo4j, graph-database
neo4j-faker
Use faker cypher functions to generate demo and test data with cypher
Stars: ✭ 30 (+100%)
Mutual labels:  neo4j, graph-database
Public-Transport-SP-Graph-Database
Metropolitan Transport Network from São Paulo mapped in a NoSQL graph database.
Stars: ✭ 25 (+66.67%)
Mutual labels:  neo4j, graph-database

PROV Database Connector

Introduction

Latest release PyPI version Build Status Coverage Status Updates

This python module provides a general interface to save W3C-PROV documents into databases. Currently we support the Neo4j graph database.

We transform a PROV document into a graph structure and the result looks like this:

Complex example in Neo4j

Complex example in Neo4j

See full documentation at: prov-db-connector.readthedocs.io

Installation

PyPi

Install it by running:

pip install prov-db-connector

You can view prov-db-connector on PyPi's package index

Source

# Clone project
git clone [email protected]:DLR-SC/prov-db-connector.git
cd prov-db-connector

# Setup virtual environment
virtualenv -p /usr/bin/python3.4 env
source env/bin/activate

# Install dependencies and package into virtual enviroment
make setup

Usage

Save and get prov document example

from prov.model import ProvDocument
from provdbconnector import ProvDb
from provdbconnector.db_adapters.in_memory import SimpleInMemoryAdapter

prov_api = ProvDb(adapter=SimpleInMemoryAdapter, auth_info=None)

# create the prov document
prov_document = ProvDocument()
prov_document.add_namespace("ex", "http://example.com")

prov_document.agent("ex:Bob")
prov_document.activity("ex:Alice")

prov_document.association("ex:Alice", "ex:Bob")

document_id = prov_api.save_document(prov_document)

print(prov_api.get_document_as_provn(document_id))

# Output:
#
# document
# prefix
# ex < http: // example.com >
#
# agent(ex:Bob)
# activity(ex:Alice, -, -)
# wasAssociatedWith(ex:Alice, ex:Bob, -)
# endDocument

File Buffer example

from provdbconnector import ProvDb
from provdbconnector.db_adapters.in_memory import SimpleInMemoryAdapter
import pkg_resources

# create the api
prov_api = ProvDb(adapter=SimpleInMemoryAdapter, auth_info=None)

# create the prov document from examples
prov_document_buffer = pkg_resources.resource_stream("examples", "file_buffer_example_primer.json")

# Save document
document_id = prov_api.save_document(prov_document_buffer)
# This is similar to:
# prov_api.create_document_from_json(prov_document_buffer)

# get document
print(prov_api.get_document_as_provn(document_id))

# Output:

# document
# prefix
# foaf < http: // xmlns.com / foaf / 0.1 / >
# prefix
# dcterms < http: // purl.org / dc / terms / >
# prefix
# ex < http: // example / >
#
# specializationOf(ex:articleV2, ex:article)
# specializationOf(ex:articleV1, ex:article)
# wasDerivedFrom(ex:blogEntry, ex:article, -, -, -, [prov:type = 'prov:Quotation'])
# alternateOf(ex:articleV2, ex:articleV1)
# wasDerivedFrom(ex:articleV1, ex:dataSet1, -, -, -)
# wasDerivedFrom(ex:articleV2, ex:dataSet2, -, -, -)
# wasDerivedFrom(ex:dataSet2, ex:dataSet1, -, -, -, [prov:type = 'prov:Revision'])
# used(ex:correct, ex:dataSet1, -)
# used(ex:compose, ex:dataSet1, -, [prov:role = "ex:dataToCompose"])
# wasDerivedFrom(ex:chart2, ex:dataSet2, -, -, -)
# wasGeneratedBy(ex:dataSet2, ex:correct, -)
# used(ex:compose, ex:regionList, -, [prov:role = "ex:regionsToAggregateBy"])
# used(ex:illustrate, ex:composition, -)
# wasGeneratedBy(ex:composition, ex:compose, -)
# wasAttributedTo(ex:chart1, ex:derek)
# wasGeneratedBy(ex:chart1, ex:compile, 2012 - 03 - 02
# T10:30:00)
# wasGeneratedBy(ex:chart1, ex:illustrate, -)
# wasAssociatedWith(ex:compose, ex:derek, -)
# wasAssociatedWith(ex:illustrate, ex:derek, -)
# actedOnBehalfOf(ex:derek, ex:chartgen, ex:compose)
# entity(ex:article, [dcterms:title = "Crime rises in cities"])
# entity(ex:articleV1)
# entity(ex:articleV2)
# entity(ex:dataSet1)
# entity(ex:dataSet2)
# entity(ex:regionList)
# entity(ex:composition)
# entity(ex:chart1)
# entity(ex:chart2)
# entity(ex:blogEntry)
# activity(ex:compile, -, -)
# activity(ex:compile2, -, -)
# activity(ex:compose, -, -)
# activity(ex:correct, 2012 - 03 - 31
# T09:21:00, 2012 - 04 - 01
# T15:21:00)
# activity(ex:illustrate, -, -)
# agent(ex:derek, [foaf:mbox = "<mailto:[email protected]>", foaf:givenName = "Derek", prov:type = 'prov:Person'])
# agent(ex:chartgen, [foaf:name = "Chart Generators Inc", prov:type = 'prov:Organization'])
# endDocument

You find all examples in the examples folder

Release

Create a new release on github, please use the semver standard for the version number

License

See LICENSE file

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].