Skip to content

Add top level method: get_relation(....) ?  #45

Open
@B-Stefan

Description

@B-Stefan

Currently the ProvDb class expose methods like get_element(identifier) this method returns 3 possible types:

  • ProvAgent
  • ProvEntity
  • ProvActivity

In order to provide a consistent we should discuss the advantage of a method like get_relation()
For example:

matching_attributes = dict()
matching_attributes.update({'prov:type': 'prov:Mention'})
pro_relation = prov_api.get_relation(matching_attributes)

The problem is that this kind of filter mechanism could return a list instead of a single entry. According to the PROV spec the uniques of a relation is defined by all formal attributes (eg form / to node). Maybe we can set a filter by this formal attributes.

This seems the best solution but also require to alter the BaseAdapter and all adapter implementations.

Also I really don't know if it is necessary to get only a single relation between to ProvElements. Is there any good use case for this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions