[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: [OASIS Issue Tracker] (ODATA-1075) Introduce subsetof operator for checking whether a collection is a subset or equal to another collection
[ https://issues.oasis-open.org/browse/ODATA-1075?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Pizzo updated ODATA-1075: --------------------------------- Proposal: Restrict "in" to mean just "member of" Add "subsetof" function: 1) subsetOf always requires that each element of the left operand occur at least as many times in the right operand, and that order does not matter so: subsetof([1,1,2],[1,2]) => false subsetof should never take order (or gaps) into account: subsetof([4,1,3],[3,1]) => true subsetof([4,1,3],[4,3]) => true 2) for ordered collections, add a "subsequenceof" function that takes order into account and ignores gaps: subsequenceof([4,1,3], [3,1]) => false subsequenceof([4,1,3],[4,3]) => true 3) add support for ordered collections to contains, startswith, endswith, indexof, and substring, that takes gaps into account. was: Restrict "in" to mean just "member of" Add "subsetof" operator for that purpose From 2017-6-1 discussion: 1) elements of the left operand have to occur at least as many times in the right operand (so [1,1,2] subsetof [1,2] => false 2) subsetof should never take order (or gaps) into account: i [3,1] subsetof [4,1,3] => true ii [4,3] subsetof [4,1,3] => true 3) for ordered collections, a "subsequence" operator could take order into account. subsequence is defined by Wikipedia to ignore gaps: i [3,1] subsequenceof [4,1,3] => false ii [4,3] subsequenceof [4,1,3] => true 4) for ordered collections, an operator that takes gaps into account is really a "contains": i [3,1] contains [4,1,3] => false ii [4,3] contains [4,1,3] => false 5) for ordered collections we could also define startswith, endswith, indexof, and substring. Question: which should we add now (versus wait for scenarios for) and should we add as functions or as operators? Note that json constructor constructs an ordered collection. > Introduce subsetof operator for checking whether a collection is a subset or equal to another collection > -------------------------------------------------------------------------------------------------------- > > Key: ODATA-1075 > URL: https://issues.oasis-open.org/browse/ODATA-1075 > Project: OASIS Open Data Protocol (OData) TC > Issue Type: Bug > Components: URL Conventions > Affects Versions: V4.01_CSD02 > Environment: Applying > Reporter: Ralf Handl > Fix For: V4.01_CSD02 > > > 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. -- This message was sent by Atlassian JIRA (v6.2.2#6258)
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]