A FOREACH with as binds one name in its filter and body: the as. The element is reachable as $<as> and its fields as $<as>.<field>. A field is no longer bound under its own name.
An explicit as: item counts as as: its fields are read as $item.<field>.
A FOREACH without as keeps the rule of RFC-016: the element is $item, and the fields of an object element are also bound under their own names.
RFC-016 binds every field of an object element under its own name, with or without as. A field then shadows an outer variable of the same name. A reduction with a parameter bsn_jongere, over rows that also have bsn_jongere, cannot compare the row with the parameter: inside the body both names are the field. The only way out was a helper output under another name.
RFC-016 already advised dot notation for new laws for this reason. With as the law has named the element, so the bare field names add nothing and only take names away.
as is absent.FOREACH without as as possibly a field, and claims nothing about it. With as, a bare name is the declared variable.as, an undefined bare name in the body is a finding.FOREACH with as read a field by its bare name.as (“Defaults to ‘item’”) gets the clarification that an explicit as: item binds only $item in the next schema release.FOREACH without as, such as the demo corpus’s wet_structuur_uitvoeringsorganisatie_werk_en_inkomen.$status is a field or an input depends on what the law declares, and adding an input changes what a body reads.An exploration into transparent, executable legislation, and one of the three projects in the starting selection of the Nederlandse Digitale Dienst.
GitHub repository
How it works
Stay informed
Roadmap (Dutch)
Documentation
Research
Nederlandse Digitale Dienst
Ministry of Economic Affairs and Climate Policy