Skip to content

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

@cdboer

Description

@cdboer

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions