Skip to content

Allow multiple preidcates for walker #10

@manulera

Description

@manulera

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);

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