Skip to content

Releases: DLR-SC/prov-db-connector

v0.5.1

05 Jan 14:21
26d0e45
Compare
Choose a tag to compare

Changelog

Version v0.5.1

Dependency Upgrades

  • Upgrade neo4j to version 4.4.1

v0.5.0

06 Dec 15:32
Compare
Choose a tag to compare

Changelog

Version v0.5.0

Python Versions

  • Add Python 3.8 support
  • Add Python 3.9 support
  • Remove Python 3.5 support

Dependency Upgrades

  • Upgrade neo4j to version 4.2.0
  • Upgrade prov to version 2.0.0

v0.4.0

29 Mar 19:16
62f2110
Compare
Choose a tag to compare

Changelog

Version v0.4.0

  • Support namespaces for identifier properties (#87)

Important change
The identifier now will be saved as a fully qualified URL instead of the short notation to support e.g. default namespaces.

document
prefix ex <http://www.example.com/>
entity(ex:entityA)
endDocument

Before:

{
  "meta:identifier": "ex:entityA"
}

Now:
At the database level, you will find a new metadata field: meta: identifier_original which contains the original input of the document. In this example ex:entityA.

{
  "meta:identifier": "http://example.com/entityA",
  "meta:identifier_original": "ex:entityA",
}

v0.3.2

28 Dec 19:04
a2925a3
Compare
Choose a tag to compare

Changelog

Version v0.3.2

  • Upgrade neo4j-driver - #82
  • Fix bug with unknown ProvTypes - (#79, #83)

v0.3.1

17 Sep 17:11
e2abbda
Compare
Choose a tag to compare

Changelog

Version v0.3.1

  • Upgraded neo4j-driver to 1.6.2 (#67)
  • Enhanced error handling neo4j-adapter
  • Automatic pipi release on git tag

Version 0.3

20 Nov 15:13
bcc3164
Compare
Choose a tag to compare

Changelog

Version 0.3

  • Changed provdb.create_* to provdb.save_* because we can't guarantee that the db-adapter actual create a new node, document, relation. Maybe the adapter merges your properties into existing data, behavior is still the same.
  • Renamed files provDb.py into prov_db.py
  • Enhanced the prov:Mention support. If you create a bundle link (prov:Mention) the destination bundle entity will be automatically created. For example:
from prov.tests.examples import bundles2

doc = bundles2()
bundle = list(doc.get_records()).pop() #I know, the get_record function return a set, so it can happen that you get the wrong bundle here (alice:bundle5 is correct) 
prov_api.save_bundle(bundle)
  • Add ability to save relations between elements that doesn't exist. For example, on a empty database:
doc = ProvDocument()
relation = doc.wasGeneratedBy("ex:Entity", "ex:Activity")

#Works now fine. The ex:entity and ex:Activity elements will be created automatically 
provapi.save_relation(relation)
  • Removed node type "Unknown" for relations with unknown nodes. (The prov-db-adapter now detects which type the relation implicitly mean.
doc = ProvDocument()
relation = doc.wasGeneratedBy("ex:Entity", -)

# Creates a Activity with a random identifier as destions for the relation  
provapi.save_relation(relation)
  • Introduced new methods

prov_db.save_relation(prov_relation)

doc = ProvDocument()

activity    = doc.activity("ex:yourActivity")
entity      = doc.entity("ex:yourEntity")
wasGeneratedBy = entity.wasGeneratedBy("ex:yourAgent")

# Save the elements
rel_id = prov_db.save_relation(wasGeneratedBy)

prov_db.save_element(prov_element, [bundle_id])

doc = ProvDocument()

agent       = doc.agent("ex:yourAgent")
activity    = doc.activity("ex:yourActivity")
entity      = doc.entity("ex:yourEntity")

# Save the elements
agent_id = prov_db.save_element(agent)
activity_id = prov_db.save_element(activity)
entity_id = prov_db.save_element(entity)

prov_db.get_element(identifier)

doc = ProvDocument()

identifier = QualifiedName(doc, "ex:yourAgent")

prov_element = prov_db.get_element(identifier)

prov_db.save_record(prov_record, [bundle_id])

doc = ProvDocument()

agent       = doc.agent("ex:Alice")
ass_rel     = doc.association("ex:Alice", "ex:Bob")

# Save the elements
agent_id = prov_db.save_record(agent)
relation_id = prov_db.save_record(ass_rel)

prov_api.save_bundle(prov_bundle)

doc = ProvDocument()

bundle = doc.bundle("ex:bundle1") 
# Save the bundle
prov_db.save_bundle(bundle)

prov_db.get_elements([ProvCLS])

from prov.model import ProvEntity, ProvAgent, ProvActivity

document_with_all_entities = prov_db.get_elements(ProvEntity)
document_with_all_agents = prov_db.get_elements(ProvAgent)
document_with_all_activities = prov_db.get_elements(ProvActivity)

print(document_with_all_entities)
print(document_with_all_agents)
print(document_with_all_activities)

prov_api.get_bundle(identifier)

doc = ProvDocument()
bundle_name = doc.valid_qualified_name("ex:YourBundleName") 
# get the bundle
prov_bundle = prov_db.get_bundle(bundle_name)
doc.add_bundle(prov_bundle)