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

Allow multiple preidcates for walker #10

Open
manulera opened this issue Feb 6, 2023 · 0 comments
Open

Allow multiple preidcates for walker #10

manulera opened this issue Feb 6, 2023 · 0 comments

Comments

@manulera
Copy link

manulera commented Feb 6, 2023

It would be great if for walker functions instead of allowing a single predicate, multiple predicates would be allowed. A recent use-case for me was to find all children of a given GO term related through part_of or is_a relationships. To do that I had to filter out relationships in the json before parsing the graph, but it would be nice to be able to do this within the library, providing a list instead of a string for the in_pred aragument in functions like the one below:

bbop-graph/lib/graph.js

Lines 1091 to 1099 in 8837355

graph.prototype.get_parent_edges = function(nb_id, in_pred){
var anchor = this;
var results = [];
// Get all parents, or just parents from a specific relation.
var preds_to_use = [];
if( in_pred ){
preds_to_use.push(in_pred);

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