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

get parents #18

Open
pnrobinson opened this issue Sep 3, 2017 · 5 comments
Open

get parents #18

pnrobinson opened this issue Sep 3, 2017 · 5 comments
Milestone

Comments

@pnrobinson
Copy link
Collaborator

Hi!
Are we planning to offer methods such as getParents() ? (distinct from getAncestors?)
It would be useful to have this as a simple API function.

@holtgrewe
Copy link
Contributor

Agreed, is currently only available through graph property of MinimalOntology<> and should be a convenience function in Ontology<>.

@holtgrewe holtgrewe added this to the 0.3 milestone Sep 4, 2017
holtgrewe added a commit that referenced this issue Sep 4, 2017
holtgrewe added a commit that referenced this issue Sep 4, 2017
@holtgrewe
Copy link
Contributor

Should be fine after merging #20.

@drseb
Copy link
Member

drseb commented Sep 20, 2017

Does getParents(Term t) and getAncestors(Term t) return the Term t itself? This is an important design decision. In ontologizer it did.

@holtgrewe
Copy link
Contributor

getParents() does not return the parents, a term is not its own parent.

As for getAncestors(), there is a boolean flag and by default, it returns itself, a term is contained in the set of ancestors.

cf. http://javadoc.io/doc/com.github.phenomics/ontolib-core/0.3

This might be a break of consistency and principle of least surprise.

Maybe getParents() should not return itself, as should getAncestors() and then there should be a getParentsAndSelf() and a getAncestorsAndSelf()?

@holtgrewe holtgrewe reopened this Sep 20, 2017
@drseb
Copy link
Member

drseb commented Sep 20, 2017

I think this is a good solution.

@holtgrewe holtgrewe modified the milestones: 0.3, 0.4 Sep 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants