METAMATCH expose the filter.byselector internals. It returns true if the input GTS metadata matches the given selector. Input can also be an encoder, or a list of GTS or encoders.

Standard selector: classname{labelOrAttribute=x}
  • If classname match, filter.byselector looks into input labels to check if labelOrAttribute exists and equals x. If labelOrAttribute is not found among input labels, it looks into input attributes if the label exists and equals x.
Extended selector: classname{labelname=x}{attributename=y} matches if:
  • classname matches
  • input have labelname in its labels, and label value matches
  • input have attributename in its labels, and attribute value matches
Selectors example:
  • ~.*{} matches everything.
  • ={} matches only emtpy classnames, whatever the labels and attributes.
  • ~.*{label=value}{} filter.byselector is equivalent to { 'label' 'value' } filter.bylabels.
  • ~.*{}{attribute~value} filter.byselector is equivalent to { 'attribute' '~value' } filter.byattr.
METAMATCH is available since version 2.11.



[ NEWGTS { 'room' 'A' } RELABEL // no classname NEWGTS 'temperature' RENAME { 'alive' 'true' } RELABEL NEWENCODER 'temperature' RENAME { 'room' 'B' } RELABEL NEWGTS 'temperature' RENAME { 'alive' 'maybe' } SETATTRIBUTES ] 'glist' STORE $glist '={}' METAMATCH //only empty classnames // $glist '={room=B}' METAMATCH // empty classname, label=B, or attribute=B ->no match // $glist '~.*{room=(A|B)}' METAMATCH // nothing has literal value (A|B) // $glist '~.*{room~(A|B)}' METAMATCH // any classname, room=A or room=B. // $glist '=temperat{}' METAMATCH // no classname is strictly equal to 'temperat' // $glist '=temperature{}' METAMATCH // 3 gts has classname strictly equal to 'temperature' // $glist '~.*{}' METAMATCH // no filter // $glist '~.*emper.*{}' METAMATCH // 3 gts has classname that contains 'emper' // $glist '~.*{foo=bar}' METAMATCH // no gts has 'foo' as label or attribute // $glist '~.*{alive~.*}' METAMATCH // 2 gts has 'alive' label or room attribute // $glist '~.*{}{alive~.*}' METAMATCH // only one has 'alive' attribute // $glist '~.*{alive~.*}{}' METAMATCH // only one has 'alive' label