New attribute function for extracting single value for multivalued fields
Currently available attribute functions don't allow to get a single value if a field has many of them. Good example might be Poland:
<prg-ad:jednostkaAdmnistracyjna>Polska</prg-ad:jednostkaAdmnistracyjna>
<prg-ad:jednostkaAdmnistracyjna>kujawsko-pomorskie</prg-ad:jednostkaAdmnistracyjna>
<prg-ad:jednostkaAdmnistracyjna>brodnicki</prg-ad:jednostkaAdmnistracyjna>
<prg-ad:jednostkaAdmnistracyjna>Bartniczka</prg-ad:jednostkaAdmnistracyjna>
This is a part of a single address record. It contains many values for a key "prg-ad:jednostkaAdmnistracyjna". Region is always the second value here (kujawsko-pomorskie in this case).
I propose adding a new attribute function called i.e just get to extract single value.
"conform": {
"region": {
"function": "get",
"field": "jednostkaAdministracyjna",
"index": 1
}
}
The PR is here - https://github.com/openaddresses/machine/pull/767
There was a wrong import https://github.com/openaddresses/machine/pull/769 @iandees please approve
@iandees Another one... Could you guide me how to run CI before merge? https://github.com/openaddresses/machine/pull/770
I think it should be running itself. @migurski am I remembering right that machine had CI tests?
Not sure why the CI wasn't running on your branch, but you can follow these instructions to get tests running locally: https://github.com/openaddresses/machine/blob/master/docs/install.md#local-development
Thanks for working through this!