{"action":"created","comment":{"url":"https://api.github.com/repos/28msec/cellstore/pulls/comments/32515239","id":32515239,"diff_hunk":"@@ -302,25 +302,36 @@ declare %private function resolution:convert-concept-relationship-node(\n (:~\n  : Helper, recursive function for resolution:convert-concept-relationship-node#3\n  :\n- : @param $network a network to expand.\n+ : @param $networks a sequence of networks to expand.\n  : @param $components a sequence of components.\n  : @param $parent-child-order \"parentFirst\" or \"childrenFirst\"\n+ : @param some options.\n  :\n  : @return the converted structural nodes.\n  :)\n declare %private function resolution:expand-concept-network(\n-    $network as object,\n+    $networks as object*,\n     $components as object*,\n     $parent-child-order as string?,\n     $options as object?) as object*\n {\n+    for $network in $networks\n+    let $order := $network.Order\n+    order by $order\n     let $concept as string := $network.Name\n     let $default-languages as string* := $components.$components:DEFAULT-LANGUAGE\n     let $default-languages := if(exists($default-languages)) then $default-languages else \"en-US\"\n     let $concept-metadata := ($components.Concepts[])[$$.Name eq $concept][1]\n     let $calculation-network as object* :=\n       descendant-objects(networks:networks-for-components-and-short-names($components, $networks:CALCULATION_NETWORK))[$$.Name eq $concept]\n-    let $is-total as boolean := exists($calculation-network.To[])\n+    let $preceding-siblings as string* := descendant-objects($networks[$$.Order le $order]).Name\n+    let $roll-up-children as string* := $calculation-network.To[].Name\n+    let $is-total as boolean :=\n+      exists($roll-up-children) and\n+      (\n+        every $roll-up-child as string in $roll-up-children\n+        satisfies $roll-up-child = $preceding-siblings","path":"queries/modules/io/28/modules/xbrl/resolution.jq","position":44,"original_position":44,"commit_id":"201bb9a425f3694c55c2942893c6fa6d0c6e9b60","original_commit_id":"201bb9a425f3694c55c2942893c6fa6d0c6e9b60","user":{"login":"dknochen","id":1012324,"avatar_url":"https://avatars.githubusercontent.com/u/1012324?v=3","gravatar_id":"","url":"https://api.github.com/users/dknochen","html_url":"https://github.com/dknochen","followers_url":"https://api.github.com/users/dknochen/followers","following_url":"https://api.github.com/users/dknochen/following{/other_user}","gists_url":"https://api.github.com/users/dknochen/gists{/gist_id}","starred_url":"https://api.github.com/users/dknochen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dknochen/subscriptions","organizations_url":"https://api.github.com/users/dknochen/orgs","repos_url":"https://api.github.com/users/dknochen/repos","events_url":"https://api.github.com/users/dknochen/events{/privacy}","received_events_url":"https://api.github.com/users/dknochen/received_events","type":"User","site_admin":false},"body":"Is it really important that it's preceding? This is making some strong assumptions. What if someone wants to put the total at the top?","created_at":"2015-06-16T12:26:09Z","updated_at":"2015-06-16T12:26:09Z","html_url":"https://github.com/28msec/cellstore/pull/1053#discussion_r32515239","pull_request_url":"https://api.github.com/repos/28msec/cellstore/pulls/1053","_links":{"self":{"href":"https://api.github.com/repos/28msec/cellstore/pulls/comments/32515239"},"html":{"href":"https://github.com/28msec/cellstore/pull/1053#discussion_r32515239"},"pull_request":{"href":"https://api.github.com/repos/28msec/cellstore/pulls/1053"}}},"pull_request":{"url":"https://api.github.com/repos/28msec/cellstore/pulls/1053","id":37681653,"html_url":"https://github.com/28msec/cellstore/pull/1053","diff_url":"https://github.com/28msec/cellstore/pull/1053.diff","patch_url":"https://github.com/28msec/cellstore/pull/1053.patch","issue_url":"https://api.github.com/repos/28msec/cellstore/issues/1053","number":1053,"state":"open","locked":false,"title":"Fix bug in total detection.","user":{"login":"ghislainfourny","id":6652352,"avatar_url":"https://avatars.githubusercontent.com/u/6652352?v=3","gravatar_id":"","url":"https://api.github.com/users/ghislainfourny","html_url":"https://github.com/ghislainfourny","followers_url":"https://api.github.com/users/ghislainfourny/followers","following_url":"https://api.github.com/users/ghislainfourny/following{/other_user}","gists_url":"https://api.github.com/users/ghislainfourny/gists{/gist_id}","starred_url":"https://api.github.com/users/ghislainfourny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghislainfourny/subscriptions","organizations_url":"https://api.github.com/users/ghislainfourny/orgs","repos_url":"https://api.github.com/users/ghislainfourny/repos","events_url":"https://api.github.com/users/ghislainfourny/events{/privacy}","received_events_url":"https://api.github.com/users/ghislainfourny/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-15T11:25:38Z","updated_at":"2015-06-16T12:26:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"79aa6488ef1f95bac6e7a6426036cb079ad9df6a","assignee":{"login":"dknochen","id":1012324,"avatar_url":"https://avatars.githubusercontent.com/u/1012324?v=3","gravatar_id":"","url":"https://api.github.com/users/dknochen","html_url":"https://github.com/dknochen","followers_url":"https://api.github.com/users/dknochen/followers","following_url":"https://api.github.com/users/dknochen/following{/other_user}","gists_url":"https://api.github.com/users/dknochen/gists{/gist_id}","starred_url":"https://api.github.com/users/dknochen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dknochen/subscriptions","organizations_url":"https://api.github.com/users/dknochen/orgs","repos_url":"https://api.github.com/users/dknochen/repos","events_url":"https://api.github.com/users/dknochen/events{/privacy}","received_events_url":"https://api.github.com/users/dknochen/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/28msec/cellstore/pulls/1053/commits","review_comments_url":"https://api.github.com/repos/28msec/cellstore/pulls/1053/comments","review_comment_url":"https://api.github.com/repos/28msec/cellstore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/28msec/cellstore/issues/1053/comments","statuses_url":"https://api.github.com/repos/28msec/cellstore/statuses/201bb9a425f3694c55c2942893c6fa6d0c6e9b60","head":{"label":"28msec:TotalDetection","ref":"TotalDetection","sha":"201bb9a425f3694c55c2942893c6fa6d0c6e9b60","user":{"login":"28msec","id":5612491,"avatar_url":"https://avatars.githubusercontent.com/u/5612491?v=3","gravatar_id":"","url":"https://api.github.com/users/28msec","html_url":"https://github.com/28msec","followers_url":"https://api.github.com/users/28msec/followers","following_url":"https://api.github.com/users/28msec/following{/other_user}","gists_url":"https://api.github.com/users/28msec/gists{/gist_id}","starred_url":"https://api.github.com/users/28msec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/28msec/subscriptions","organizations_url":"https://api.github.com/users/28msec/orgs","repos_url":"https://api.github.com/users/28msec/repos","events_url":"https://api.github.com/users/28msec/events{/privacy}","received_events_url":"https://api.github.com/users/28msec/received_events","type":"Organization","site_admin":false},"repo":{"id":14939107,"name":"cellstore","full_name":"28msec/cellstore","owner":{"login":"28msec","id":5612491,"avatar_url":"https://avatars.githubusercontent.com/u/5612491?v=3","gravatar_id":"","url":"https://api.github.com/users/28msec","html_url":"https://github.com/28msec","followers_url":"https://api.github.com/users/28msec/followers","following_url":"https://api.github.com/users/28msec/following{/other_user}","gists_url":"https://api.github.com/users/28msec/gists{/gist_id}","starred_url":"https://api.github.com/users/28msec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/28msec/subscriptions","organizations_url":"https://api.github.com/users/28msec/orgs","repos_url":"https://api.github.com/users/28msec/repos","events_url":"https://api.github.com/users/28msec/events{/privacy}","received_events_url":"https://api.github.com/users/28msec/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/28msec/cellstore","description":"Modern Data Warehouse","fork":false,"url":"https://api.github.com/repos/28msec/cellstore","forks_url":"https://api.github.com/repos/28msec/cellstore/forks","keys_url":"https://api.github.com/repos/28msec/cellstore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/28msec/cellstore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/28msec/cellstore/teams","hooks_url":"https://api.github.com/repos/28msec/cellstore/hooks","issue_events_url":"https://api.github.com/repos/28msec/cellstore/issues/events{/number}","events_url":"https://api.github.com/repos/28msec/cellstore/events","assignees_url":"https://api.github.com/repos/28msec/cellstore/assignees{/user}","branches_url":"https://api.github.com/repos/28msec/cellstore/branches{/branch}","tags_url":"https://api.github.com/repos/28msec/cellstore/tags","blobs_url":"https://api.github.com/repos/28msec/cellstore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/28msec/cellstore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/28msec/cellstore/git/refs{/sha}","trees_url":"https://api.github.com/repos/28msec/cellstore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/28msec/cellstore/statuses/{sha}","languages_url":"https://api.github.com/repos/28msec/cellstore/languages","stargazers_url":"https://api.github.com/repos/28msec/cellstore/stargazers","contributors_url":"https://api.github.com/repos/28msec/cellstore/contributors","subscribers_url":"https://api.github.com/repos/28msec/cellstore/subscribers","subscription_url":"https://api.github.com/repos/28msec/cellstore/subscription","commits_url":"https://api.github.com/repos/28msec/cellstore/commits{/sha}","git_commits_url":"https://api.github.com/repos/28msec/cellstore/git/commits{/sha}","comments_url":"https://api.github.com/repos/28msec/cellstore/comments{/number}","issue_comment_url":"https://api.github.com/repos/28msec/cellstore/issues/comments{/number}","contents_url":"https://api.github.com/repos/28msec/cellstore/contents/{+path}","compare_url":"https://api.github.com/repos/28msec/cellstore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/28msec/cellstore/merges","archive_url":"https://api.github.com/repos/28msec/cellstore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/28msec/cellstore/downloads","issues_url":"https://api.github.com/repos/28msec/cellstore/issues{/number}","pulls_url":"https://api.github.com/repos/28msec/cellstore/pulls{/number}","milestones_url":"https://api.github.com/repos/28msec/cellstore/milestones{/number}","notifications_url":"https://api.github.com/repos/28msec/cellstore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/28msec/cellstore/labels{/name}","releases_url":"https://api.github.com/repos/28msec/cellstore/releases{/id}","created_at":"2013-12-04T23:41:55Z","updated_at":"2015-05-20T08:10:35Z","pushed_at":"2015-06-15T15:51:08Z","git_url":"git://github.com/28msec/cellstore.git","ssh_url":"git@github.com:28msec/cellstore.git","clone_url":"https://github.com/28msec/cellstore.git","svn_url":"https://github.com/28msec/cellstore","homepage":"http://28msec.github.io/cellstore","size":88332,"stargazers_count":16,"watchers_count":16,"language":"JSONiq","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6,"mirror_url":null,"open_issues_count":62,"forks":6,"open_issues":62,"watchers":16,"default_branch":"master"}},"base":{"label":"28msec:master","ref":"master","sha":"6b3eb710ac462a7659afbf5fa9352d5c8a79f5c1","user":{"login":"28msec","id":5612491,"avatar_url":"https://avatars.githubusercontent.com/u/5612491?v=3","gravatar_id":"","url":"https://api.github.com/users/28msec","html_url":"https://github.com/28msec","followers_url":"https://api.github.com/users/28msec/followers","following_url":"https://api.github.com/users/28msec/following{/other_user}","gists_url":"https://api.github.com/users/28msec/gists{/gist_id}","starred_url":"https://api.github.com/users/28msec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/28msec/subscriptions","organizations_url":"https://api.github.com/users/28msec/orgs","repos_url":"https://api.github.com/users/28msec/repos","events_url":"https://api.github.com/users/28msec/events{/privacy}","received_events_url":"https://api.github.com/users/28msec/received_events","type":"Organization","site_admin":false},"repo":{"id":14939107,"name":"cellstore","full_name":"28msec/cellstore","owner":{"login":"28msec","id":5612491,"avatar_url":"https://avatars.githubusercontent.com/u/5612491?v=3","gravatar_id":"","url":"https://api.github.com/users/28msec","html_url":"https://github.com/28msec","followers_url":"https://api.github.com/users/28msec/followers","following_url":"https://api.github.com/users/28msec/following{/other_user}","gists_url":"https://api.github.com/users/28msec/gists{/gist_id}","starred_url":"https://api.github.com/users/28msec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/28msec/subscriptions","organizations_url":"https://api.github.com/users/28msec/orgs","repos_url":"https://api.github.com/users/28msec/repos","events_url":"https://api.github.com/users/28msec/events{/privacy}","received_events_url":"https://api.github.com/users/28msec/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/28msec/cellstore","description":"Modern Data Warehouse","fork":false,"url":"https://api.github.com/repos/28msec/cellstore","forks_url":"https://api.github.com/repos/28msec/cellstore/forks","keys_url":"https://api.github.com/repos/28msec/cellstore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/28msec/cellstore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/28msec/cellstore/teams","hooks_url":"https://api.github.com/repos/28msec/cellstore/hooks","issue_events_url":"https://api.github.com/repos/28msec/cellstore/issues/events{/number}","events_url":"https://api.github.com/repos/28msec/cellstore/events","assignees_url":"https://api.github.com/repos/28msec/cellstore/assignees{/user}","branches_url":"https://api.github.com/repos/28msec/cellstore/branches{/branch}","tags_url":"https://api.github.com/repos/28msec/cellstore/tags","blobs_url":"https://api.github.com/repos/28msec/cellstore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/28msec/cellstore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/28msec/cellstore/git/refs{/sha}","trees_url":"https://api.github.com/repos/28msec/cellstore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/28msec/cellstore/statuses/{sha}","languages_url":"https://api.github.com/repos/28msec/cellstore/languages","stargazers_url":"https://api.github.com/repos/28msec/cellstore/stargazers","contributors_url":"https://api.github.com/repos/28msec/cellstore/contributors","subscribers_url":"https://api.github.com/repos/28msec/cellstore/subscribers","subscription_url":"https://api.github.com/repos/28msec/cellstore/subscription","commits_url":"https://api.github.com/repos/28msec/cellstore/commits{/sha}","git_commits_url":"https://api.github.com/repos/28msec/cellstore/git/commits{/sha}","comments_url":"https://api.github.com/repos/28msec/cellstore/comments{/number}","issue_comment_url":"https://api.github.com/repos/28msec/cellstore/issues/comments{/number}","contents_url":"https://api.github.com/repos/28msec/cellstore/contents/{+path}","compare_url":"https://api.github.com/repos/28msec/cellstore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/28msec/cellstore/merges","archive_url":"https://api.github.com/repos/28msec/cellstore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/28msec/cellstore/downloads","issues_url":"https://api.github.com/repos/28msec/cellstore/issues{/number}","pulls_url":"https://api.github.com/repos/28msec/cellstore/pulls{/number}","milestones_url":"https://api.github.com/repos/28msec/cellstore/milestones{/number}","notifications_url":"https://api.github.com/repos/28msec/cellstore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/28msec/cellstore/labels{/name}","releases_url":"https://api.github.com/repos/28msec/cellstore/releases{/id}","created_at":"2013-12-04T23:41:55Z","updated_at":"2015-05-20T08:10:35Z","pushed_at":"2015-06-15T15:51:08Z","git_url":"git://github.com/28msec/cellstore.git","ssh_url":"git@github.com:28msec/cellstore.git","clone_url":"https://github.com/28msec/cellstore.git","svn_url":"https://github.com/28msec/cellstore","homepage":"http://28msec.github.io/cellstore","size":88332,"stargazers_count":16,"watchers_count":16,"language":"JSONiq","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6,"mirror_url":null,"open_issues_count":62,"forks":6,"open_issues":62,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/28msec/cellstore/pulls/1053"},"html":{"href":"https://github.com/28msec/cellstore/pull/1053"},"issue":{"href":"https://api.github.com/repos/28msec/cellstore/issues/1053"},"comments":{"href":"https://api.github.com/repos/28msec/cellstore/issues/1053/comments"},"review_comments":{"href":"https://api.github.com/repos/28msec/cellstore/pulls/1053/comments"},"review_comment":{"href":"https://api.github.com/repos/28msec/cellstore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/28msec/cellstore/pulls/1053/commits"},"statuses":{"href":"https://api.github.com/repos/28msec/cellstore/statuses/201bb9a425f3694c55c2942893c6fa6d0c6e9b60"}}}}