{"action":"closed","issue":{"url":"https://api.github.com/repos/aiidateam/aiida_core/issues/336","repository_url":"https://api.github.com/repos/aiidateam/aiida_core","labels_url":"https://api.github.com/repos/aiidateam/aiida_core/issues/336/labels{/name}","comments_url":"https://api.github.com/repos/aiidateam/aiida_core/issues/336/comments","events_url":"https://api.github.com/repos/aiidateam/aiida_core/issues/336/events","html_url":"https://github.com/aiidateam/aiida_core/issues/336","id":204029770,"number":336,"title":"Query Builder search project the distance of ancestor/descendant nodes from the reference node.  ","user":{"login":"fernandogargiulo1986","id":11215858,"avatar_url":"https://avatars.githubusercontent.com/u/11215858?v=3","gravatar_id":"","url":"https://api.github.com/users/fernandogargiulo1986","html_url":"https://github.com/fernandogargiulo1986","followers_url":"https://api.github.com/users/fernandogargiulo1986/followers","following_url":"https://api.github.com/users/fernandogargiulo1986/following{/other_user}","gists_url":"https://api.github.com/users/fernandogargiulo1986/gists{/gist_id}","starred_url":"https://api.github.com/users/fernandogargiulo1986/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fernandogargiulo1986/subscriptions","organizations_url":"https://api.github.com/users/fernandogargiulo1986/orgs","repos_url":"https://api.github.com/users/fernandogargiulo1986/repos","events_url":"https://api.github.com/users/fernandogargiulo1986/events{/privacy}","received_events_url":"https://api.github.com/users/fernandogargiulo1986/received_events","type":"User","site_admin":false},"labels":[{"id":506134169,"url":"https://api.github.com/repos/aiidateam/aiida_core/labels/topic/QueryBuilder","name":"topic/QueryBuilder","color":"eeeeee","default":false},{"id":506125015,"url":"https://api.github.com/repos/aiidateam/aiida_core/labels/type/enhancement","name":"type/enhancement","color":"0e8a16","default":false},{"id":506130137,"url":"https://api.github.com/repos/aiidateam/aiida_core/labels/type/proposal","name":"type/proposal","color":"1d76db","default":false}],"state":"closed","locked":false,"assignee":{"login":"fernandogargiulo1986","id":11215858,"avatar_url":"https://avatars.githubusercontent.com/u/11215858?v=3","gravatar_id":"","url":"https://api.github.com/users/fernandogargiulo1986","html_url":"https://github.com/fernandogargiulo1986","followers_url":"https://api.github.com/users/fernandogargiulo1986/followers","following_url":"https://api.github.com/users/fernandogargiulo1986/following{/other_user}","gists_url":"https://api.github.com/users/fernandogargiulo1986/gists{/gist_id}","starred_url":"https://api.github.com/users/fernandogargiulo1986/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fernandogargiulo1986/subscriptions","organizations_url":"https://api.github.com/users/fernandogargiulo1986/orgs","repos_url":"https://api.github.com/users/fernandogargiulo1986/repos","events_url":"https://api.github.com/users/fernandogargiulo1986/events{/privacy}","received_events_url":"https://api.github.com/users/fernandogargiulo1986/received_events","type":"User","site_admin":false},"assignees":[{"login":"fernandogargiulo1986","id":11215858,"avatar_url":"https://avatars.githubusercontent.com/u/11215858?v=3","gravatar_id":"","url":"https://api.github.com/users/fernandogargiulo1986","html_url":"https://github.com/fernandogargiulo1986","followers_url":"https://api.github.com/users/fernandogargiulo1986/followers","following_url":"https://api.github.com/users/fernandogargiulo1986/following{/other_user}","gists_url":"https://api.github.com/users/fernandogargiulo1986/gists{/gist_id}","starred_url":"https://api.github.com/users/fernandogargiulo1986/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fernandogargiulo1986/subscriptions","organizations_url":"https://api.github.com/users/fernandogargiulo1986/orgs","repos_url":"https://api.github.com/users/fernandogargiulo1986/repos","events_url":"https://api.github.com/users/fernandogargiulo1986/events{/privacy}","received_events_url":"https://api.github.com/users/fernandogargiulo1986/received_events","type":"User","site_admin":false},{"login":"lekah","id":15344896,"avatar_url":"https://avatars.githubusercontent.com/u/15344896?v=3","gravatar_id":"","url":"https://api.github.com/users/lekah","html_url":"https://github.com/lekah","followers_url":"https://api.github.com/users/lekah/followers","following_url":"https://api.github.com/users/lekah/following{/other_user}","gists_url":"https://api.github.com/users/lekah/gists{/gist_id}","starred_url":"https://api.github.com/users/lekah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lekah/subscriptions","organizations_url":"https://api.github.com/users/lekah/orgs","repos_url":"https://api.github.com/users/lekah/repos","events_url":"https://api.github.com/users/lekah/events{/privacy}","received_events_url":"https://api.github.com/users/lekah/received_events","type":"User","site_admin":false}],"milestone":null,"comments":7,"created_at":"2017-01-30T14:47:25Z","updated_at":"2017-02-28T15:38:21Z","closed_at":"2017-02-28T15:38:21Z","body":"It would be useful when traversing the graph in the seek of ancestor/descendant nodes that one could print the length of the path linking the two nodes of each connected pair. This might be achieved by adding special projection keys such as 'ancestor_distance', 'descendant_distance'. \r\nAlso, as all other projection keys, the user should be able to order the results according to the ancestor/descendant_distance. \r\n\r\nHere is an example:\r\n\r\n```python\r\nqb = QueryBuilder().append(Nodes, tag='ref_node')\r\nqb.append(Node, tag='ancestors', ancestor_of='ref_node', project=['id', 'ancestor_distance'])\r\nqb.order_by({'ancestors', {'ancestor_distance': 'asc'}})\r\n\r\nqb.all()\r\n```\r\n\r\n"}}
{"actor":{"display_login":"fernandogargiulo1986"}}