Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-1075

Introduce operator for checking whether a collection is a subset or equal to another collection

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.01_CSD02
    • Fix Version/s: V4.01_CSD02
    • Component/s: URL Conventions
    • Labels:
      None
    • Environment:

      Applied

    • Proposal:
      Hide

      Restrict "in" to mean just "member of"
      Add "hassubset" function:

      1) hassubset always requires that each element of the right argument occurs at least as many times in the left argument, and that order does not matter so:
      hassubset([1,2],[1,1,2]) => false
      hassubset should never take order (or gaps) into account:
      hassubset([4,1,3],[3,1]) => true
      hassubset([4,1,3],[4,3]) => true

      2) for ordered collections, add a "hassubsequence" function that takes order into account and ignores gaps:
      hassubsequence([4,1,3], [3,1]) => false
      hassubsequence([4,1,3],[4,3]) => true

      3) add support for ordered collections to contains (that takes gaps into account) as well as startswith, endswith, indexof, and substring.

      Show
      Restrict "in" to mean just "member of" Add "hassubset" function: 1) hassubset always requires that each element of the right argument occurs at least as many times in the left argument, and that order does not matter so: hassubset( [1,2] , [1,1,2] ) => false hassubset should never take order (or gaps) into account: hassubset( [4,1,3] , [3,1] ) => true hassubset( [4,1,3] , [4,3] ) => true 2) for ordered collections, add a "hassubsequence" function that takes order into account and ignores gaps: hassubsequence( [4,1,3] , [3,1] ) => false hassubsequence( [4,1,3] , [4,3] ) => true 3) add support for ordered collections to contains (that takes gaps into account) as well as startswith, endswith, indexof, and substring.
    • Resolution:
      Show
      https://tools.oasis-open.org/version-control/browse/wsvn/odata/trunk/4.01%20spec/ABNF/odata-abnf-construction-rules.txt?op=diff&rev=1047 https://tools.oasis-open.org/version-control/browse/wsvn/odata/trunk/4.01%20spec/ABNF/odata-abnf-testcases.xml?op=diff&rev=1047 https://www.oasis-open.org/committees/download.php/60941/odata-v4.01-wd02-part2-url-conventions-2017-06-07.docx

      Description

      Currently we "overload" the in operator to be "subset of" if the left operand is a collection.

      This would block us from introducing collections of collections, and checking whether a collection is an item of a collection of collections.

        Attachments

          Activity

            People

            • Assignee:
              handl Ralf Handl
              Reporter:
              handl Ralf Handl
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: