Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add convenient assertion methods for revision, quotation, primary source, mention & influence records #154

Open
cdboer opened this issue Mar 13, 2022 · 0 comments

Comments

@cdboer
Copy link

cdboer commented Mar 13, 2022

In release 1.1.0 convenience methods for assertions like derivations (ProvEntity.wasDerivedFrom) where added that allow the following syntax:

graph = ProvDocument()
e1 = graph.entity("e1")
e2 = graph.entity("e2")
e1.wasDerivedFrom(e2)

For other assertions, like the ones mentioned in the title, these methods don't exist yet. If you wanted to add a revision record to the initial example you'd have to use the ProvBundle.wasRevisionOf method like this:

graph = ProvDocument()
e1 = graph.entity("e1")
e2 = graph.entity("e2")
e1.wasDerivedFrom(e2)
# e1.wasRevisionOf(e2) doesn't exist
graph.wasRevisionOf(e1, e2)

I think adding convenience methods for these assertions would improve readability.

Candidates for such convenience methods:

  • ProvEntity.wasRevisionOf
  • ProvEntity.wasQuotedFrom
  • ProvEntity.hadPrimarySource
  • ProvEntity.mentionOf
  • ProvEntity.wasInfluencedBy
  • ProvAgent.wasInfluencedBy
  • ProvActivity.wasInfluencedBy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants