-
Proposal:
Hide
Introduce a new sub-chapter "3.XX $apply as expand option in $expand"; describe the behavior and add an example(s).
Extend the sub-chapter "3.15 Evaluating $apply".
Extend the ABNF Rules.
Show
Introduce a new sub-chapter "3.XX $apply as expand option in $expand"; describe the behavior and add an example(s).
Extend the sub-chapter "3.15 Evaluating $apply".
Extend the ABNF Rules.
-
Resolution:
Show
https://www.oasis-open.org/committees/document.php?document_id=56041&wg_abbrev=odata
https://tools.oasis-open.org/version-control/browse/wsvn/odata/trunk/spec/ABNF/odata-aggregation-abnf.txt?op=diff&sc=0&rev=571
We haven't specified the usage of $apply as "Expand Option" in $expand.
There are good use cases for $apply as an option of $expand (and it combines very well):
GET Products?$expand=Sales($apply=aggregate(Amount with sum as Total))
Returns all products, and the Sales navigation property value is a one-element array with the Total
Means: per Product in top-level result inline result of
GET Product(<key>)/Sales?$apply=aggregate(Amount with sum as Total)
This is equivalent to the clumsier
GET Products?$apply=groupby((<key properties of Product>,<all non-key structural properties of Product>),aggregate(Sales/(Amount with sum as Total))
{"report":{"apdex":0,"isInitial":true,"journeyId":"d3ea48cb-62cc-4932-9f6e-ab54ba54d35f","key":"jira.project.issue.view-issue","navigationType":0,"readyForUser":4334,"redirectCount":0,"resourceLoadedEnd":4158.700000286102,"resourceLoadedStart":250.2000002861023,"resourceTiming":[{"duration":421.19999980926514,"initiatorType":"link","name":"https://issues.oasis-open.org/s/3edeca31ab9ba77980aae0809fbe7121-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/0a4716d29b2d5b1bdcdb168b4efc119e/_/download/contextbatch/css/_super/batch.css","startTime":250.2000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":250.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":671.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":436.80000019073486,"initiatorType":"link","name":"https://issues.oasis-open.org/s/7d2823769c2e7b66e860863fe879b7f8-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/9aebb1c0aaa4c36289529757ec9dbb54/_/download/contextbatch/css/project.issue.navigator,jira.view.issue,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&richediton=true","startTime":250.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":250.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":687.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":436.59999990463257,"initiatorType":"link","name":"https://issues.oasis-open.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/8.0.5/_/download/batch/com.atlassian.auiplugin:split_aui.pattern.label/com.atlassian.auiplugin:split_aui.pattern.label.css","startTime":250.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":250.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":687.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":451.09999990463257,"initiatorType":"link","name":"https://issues.oasis-open.org/s/645acc233eb869f48a571293b8358a7d-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/1.0/_/download/batch/jira.webresources:global-static-adgs/jira.webresources:global-static-adgs.css","startTime":251,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":251,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":702.0999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":452,"initiatorType":"link","name":"https://issues.oasis-open.org/s/a0dd6509771c1de0667aae5429c04cda-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/1.0/_/download/batch/jira.webresources:global-static/jira.webresources:global-static.css","startTime":251.2000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":251.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":703.2000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":1170.5,"initiatorType":"script","name":"https://issues.oasis-open.org/s/e5479157e7a0c08b005e6522f2f04104-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/0a4716d29b2d5b1bdcdb168b4efc119e/_/download/contextbatch/js/_super/batch.js?locale=en-US","startTime":251.5,"connectEnd":1193.5,"connectStart":1144.7000002861023,"domainLookupEnd":1144.7000002861023,"domainLookupStart":1144.7000002861023,"fetchStart":251.5,"redirectEnd":0,"redirectStart":0,"requestStart":1193.5999999046326,"responseEnd":1422,"responseStart":1230.5,"secureConnectionStart":1168.8000001907349},{"duration":3906.7000002861023,"initiatorType":"script","name":"https://issues.oasis-open.org/s/83514d5d4e8543747b02042eafcdc99c-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/9aebb1c0aaa4c36289529757ec9dbb54/_/download/contextbatch/js/project.issue.navigator,jira.view.issue,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en-US&richediton=true","startTime":252,"connectEnd":1239,"connectStart":1190.2000002861023,"domainLookupEnd":1190.2000002861023,"domainLookupStart":1190.2000002861023,"fetchStart":252,"redirectEnd":0,"redirectStart":0,"requestStart":1239.0999999046326,"responseEnd":4158.700000286102,"responseStart":1267.3000001907349,"secureConnectionStart":1214.3000001907349},{"duration":1244.6999998092651,"initiatorType":"script","name":"https://issues.oasis-open.org/s/70bb2263e59e7e1f04fbd137c80b895b-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/aae1242f5fc81cc6a5bb8bc963ccda29/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en-US","startTime":252.2000002861023,"connectEnd":1469.8000001907349,"connectStart":1421.9000000953674,"domainLookupEnd":1421.9000000953674,"domainLookupStart":1421.9000000953674,"fetchStart":252.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":1469.8000001907349,"responseEnd":1496.9000000953674,"responseStart":1495.5999999046326,"secureConnectionStart":1445.5999999046326},{"duration":1319.5999999046326,"initiatorType":"script","name":"https://issues.oasis-open.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":252.40000009536743,"connectEnd":1545.3000001907349,"connectStart":1496.7000002861023,"domainLookupEnd":1496.7000002861023,"domainLookupStart":1496.7000002861023,"fetchStart":252.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":1545.4000000953674,"responseEnd":1572,"responseStart":1570.9000000953674,"secureConnectionStart":1520.8000001907349},{"duration":1396.5,"initiatorType":"script","name":"https://issues.oasis-open.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":252.5,"connectEnd":1622.3000001907349,"connectStart":1571.9000000953674,"domainLookupEnd":1571.9000000953674,"domainLookupStart":1571.8000001907349,"fetchStart":252.5,"redirectEnd":0,"redirectStart":0,"requestStart":1622.3000001907349,"responseEnd":1649,"responseStart":1648,"secureConnectionStart":1595.7000002861023},{"duration":1472.0999999046326,"initiatorType":"script","name":"https://issues.oasis-open.org/s/cda37faab827dbdf305de8efe8282062-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/8.0.5/_/download/batch/com.atlassian.auiplugin:split_aui.pattern.label/com.atlassian.auiplugin:split_aui.pattern.label.js?locale=en-US","startTime":252.7000002861023,"connectEnd":1697.3000001907349,"connectStart":1648.9000000953674,"domainLookupEnd":1648.9000000953674,"domainLookupStart":1648.9000000953674,"fetchStart":252.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":1697.4000000953674,"responseEnd":1724.8000001907349,"responseStart":1723.5999999046326,"secureConnectionStart":1672.8000001907349},{"duration":498.19999980926514,"initiatorType":"link","name":"https://issues.oasis-open.org/s/07245784f53abc49bad9d9d4d36c577a-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/cadc4f20cc5c138dee060d42cf85f220/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":252.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":252.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":751,"responseStart":0,"secureConnectionStart":0},{"duration":1547.5,"initiatorType":"script","name":"https://issues.oasis-open.org/rest/api/1.0/shortcuts/803004/a29179d70fa8562374ee16707692af77/shortcuts.js?context=issuenavigation&context=issueaction","startTime":252.90000009536743,"connectEnd":1772.8000001907349,"connectStart":1724.5999999046326,"domainLookupEnd":1724.5999999046326,"domainLookupStart":1724.5999999046326,"fetchStart":252.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":1773,"responseEnd":1800.4000000953674,"responseStart":1799.3000001907349,"secureConnectionStart":1748.5999999046326},{"duration":599.5,"initiatorType":"link","name":"https://issues.oasis-open.org/s/f77fd89aa211a76b20e9b0e63564383c-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/4a9288299d147101bf66484f4be48925/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-jira.view.issue,-project.issue.navigator/batch.css?jira.create.linked.issue=true&richediton=true","startTime":297.7000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":297.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":897.2000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":1883.3000001907349,"initiatorType":"script","name":"https://issues.oasis-open.org/s/41525c48ddceeb9b11e54085268fc285-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/4a9288299d147101bf66484f4be48925/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-jira.view.issue,-project.issue.navigator/batch.js?jira.create.linked.issue=true&locale=en-US&richediton=true","startTime":297.90000009536743,"connectEnd":2153.800000190735,"connectStart":2105.4000000953674,"domainLookupEnd":2105.4000000953674,"domainLookupStart":2105.4000000953674,"fetchStart":297.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":2153.9000000953674,"responseEnd":2181.2000002861023,"responseStart":2180.2000002861023,"secureConnectionStart":2129.4000000953674},{"duration":2957.199999809265,"initiatorType":"script","name":"https://issues.oasis-open.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":308.40000009536743,"connectEnd":3238.7000002861023,"connectStart":3190.5,"domainLookupEnd":3190.5,"domainLookupStart":3190.4000000953674,"fetchStart":308.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":3238.800000190735,"responseEnd":3265.5999999046326,"responseStart":3264.4000000953674,"secureConnectionStart":3214.4000000953674},{"duration":3019.0999999046326,"initiatorType":"script","name":"https://issues.oasis-open.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":321,"connectEnd":3313.4000000953674,"connectStart":3265.4000000953674,"domainLookupEnd":3265.4000000953674,"domainLookupStart":3265.4000000953674,"fetchStart":321,"redirectEnd":0,"redirectStart":0,"requestStart":3313.5,"responseEnd":3340.0999999046326,"responseStart":3339,"secureConnectionStart":3289.0999999046326},{"duration":1493.8999996185303,"initiatorType":"xmlhttprequest","name":"https://issues.oasis-open.org/rest/webResources/1.0/resources","startTime":1547.2000002861023,"connectEnd":3010.800000190735,"connectStart":3001.7000002861023,"domainLookupEnd":3001.7000002861023,"domainLookupStart":3001.7000002861023,"fetchStart":1547.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":3010.9000000953674,"responseEnd":3041.0999999046326,"responseStart":3040.0999999046326,"secureConnectionStart":3001.7000002861023}],"threshold":1000,"fetchStart":0,"domainLookupStart":27,"domainLookupEnd":69,"connectStart":69,"connectEnd":151,"secureConnectionStart":94,"requestStart":151,"responseStart":233,"responseEnd":320,"domLoading":236,"domInteractive":4378,"domContentLoadedEventStart":4378,"domContentLoadedEventEnd":4434,"domComplete":6395,"loadEventStart":6395,"loadEventEnd":6397,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[],"measures":[],"correlationId":"49ab076f2aab22","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":143,"dbReadsTimeInMs":28,"dbConnsTimeInMs":35,"applicationHash":"4d4040e0714d65b7fffa4801569d014c0b16eaa9","experiments":[]}}
Resolved as proposed 2015-5-7