Zhang Weiwu wrote:
Do I need to design a new syntax at all? My requirement is the following:
I need a new syntax for ranged-values. Examples are:
- netWeight: 12~13kg
- ISOSensitivity: 800~1600
- heightAdjustableRange: 1.2m~1.5m
The spec of ranged-value is a numeric, optionally followed by a measurement unit, followed by a tild as seperator†, followed by another measurement.
The syntax needs its own comparison rules, so that you can filter a range, and get entries who offer values ranging in that range.
Not exactly what you're after but have a look at slapo-constraint. Maybe you can find some suitable regex patterns for your use-case.
Hmm, it would be handy to have min/max constraints for attribute types for which an ORDERING matching rule is defined. So maybe extending slapo-constraint would be the most flexible way of implementing ranges.
Ciao, Michael.