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 top level method: get_relation(....) ? #45

Open
B-Stefan opened this issue Nov 16, 2016 · 1 comment
Open

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

B-Stefan opened this issue Nov 16, 2016 · 1 comment

Comments

@B-Stefan
Copy link
Collaborator

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?

@Drake81
Copy link
Collaborator

Drake81 commented Nov 16, 2016

If we implement a method like prov_api.get_relation(matching_attributes) we should return list in every case, since its easier to process.

I don't think just return the relation itself is interesting.
At least it should return a list of all relations, including the involved node as well.
i.e.

[
 {
  id:{ 
    type:prov-type,
    attributes: ..
  },
  id:{
   type: prov-type,
   attributes: ...
  },
 },
 {...} # next entry
]

But, usually it question would be like: "Which entities were in created in a particular process".
Isn't there a filter function that could solve such questions?

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