I am writing a routine to check an incoming dataset before loading. The first step is to make sure the dataset has all the required attributes, the second step is to make sure the values in the attributes are valid. I am using the AttributeValidator for this second step. Unfortunately, when I am validating a value, I have to hardcode all the values in the Rule Configuration box. I would like to be able to read a table and get these values and populate it in the Rule Configuration box. How can I do this?
Hi @tnarladni, at this time there is currently no way to import a list of rules into the AttributeValidator. I recommend up-voting on the Idea to have it added: Add import attributes button on AttributeValidator .
Hi @tnarladni, the Rule Configuration field in the AttributeValidator doesn't have any function that allows you to import the rule from an external table, but you can use an attribute value as a rule configuration here. For the In operator, if you add an attribute that stores comma-separated valid values to every input feature, you can then select it as the Rule Configuration.
For example, if the valid values are stored in a text file (a value per a row), read it with the Text File reader, concatenate the values with comma-separated format (Aggregator), merge it to all the features unconditionally (FeatureMerger), and set the concatenated values to the Rule Configuration in the AttributeValidator.
Hi @tnarladni, the Rule Configuration field in the AttributeValidator doesn't have any function that allows you to import the rule from an external table, but you can use an attribute value as a rule configuration here. For the In operator, if you add an attribute that stores comma-separated valid values to every input feature, you can then select it as the Rule Configuration.
For example, if the valid values are stored in a text file (a value per a row), read it with the Text File reader, concatenate the values with comma-separated format (Aggregator), merge it to all the features unconditionally (FeatureMerger), and set the concatenated values to the Rule Configuration in the AttributeValidator.
Hi @tnarladni, at this time there is currently no way to import a list of rules into the AttributeValidator. I recommend up-voting on the Idea to have it added: Add import attributes button on AttributeValidator .
Why not use the list (from a CSV file or any other format) and validate being in the list by merging on the list values (FeatureMerger): Merged: value is in the list, Not Merged: invalid value.
Why not use the list (from a CSV file or any other format) and validate being in the list by merging on the list values (FeatureMerger): Merged: value is in the list, Not Merged: invalid value.
Hi @tnarladni, the Rule Configuration field in the AttributeValidator doesn't have any function that allows you to import the rule from an external table, but you can use an attribute value as a rule configuration here. For the In operator, if you add an attribute that stores comma-separated valid values to every input feature, you can then select it as the Rule Configuration.
For example, if the valid values are stored in a text file (a value per a row), read it with the Text File reader, concatenate the values with comma-separated format (Aggregator), merge it to all the features unconditionally (FeatureMerger), and set the concatenated values to the Rule Configuration in the AttributeValidator.
accessroad.fmw
Hi @tnarladni, the Rule Configuration field in the AttributeValidator doesn't have any function that allows you to import the rule from an external table, but you can use an attribute value as a rule configuration here. For the In operator, if you add an attribute that stores comma-separated valid values to every input feature, you can then select it as the Rule Configuration.
For example, if the valid values are stored in a text file (a value per a row), read it with the Text File reader, concatenate the values with comma-separated format (Aggregator), merge it to all the features unconditionally (FeatureMerger), and set the concatenated values to the Rule Configuration in the AttributeValidator.
And, you have to merge the code list(s) to the features which you need to validate with the AttributeValidator. Looks like the attribute "Code" has been created with the Aggregator and it would be merged to the 11 features, but it won't be merged to the 180 features output from the FeatureReader_2. Is it your intention?
And, you have to merge the code list(s) to the features which you need to validate with the AttributeValidator. Looks like the attribute "Code" has been created with the Aggregator and it would be merged to the 11 features, but it won't be merged to the 180 features output from the FeatureReader_2. Is it your intention?
So the 11 that is used in the FeatureMerger is the field names. and the 180 FeatureReader is the actual features
The domain table was something I created so if you think it should be done a different way, I am open to that as well.
Hi @tnarladni, the Rule Configuration field in the AttributeValidator doesn't have any function that allows you to import the rule from an external table, but you can use an attribute value as a rule configuration here. For the In operator, if you add an attribute that stores comma-separated valid values to every input feature, you can then select it as the Rule Configuration.
For example, if the valid values are stored in a text file (a value per a row), read it with the Text File reader, concatenate the values with comma-separated format (Aggregator), merge it to all the features unconditionally (FeatureMerger), and set the concatenated values to the Rule Configuration in the AttributeValidator.
Input: a table containing possible code values for each field.
Field,Code
PermTemp,PT1
PermTemp,PT2
PermTemp,PT3
PublicPriv,PP1
PublicPriv,PP2
PublicPriv,PP3
NewExist,NE1
NewExist,NE2
NewExist,NE3
SurfaceMat,SM1
SurfaceMat,SM2
SurfaceMat,SM3
Output: a single feature containing validation rules for each field.You can merge the feature containing validation rules to the data features from the FeatureReader, then validate the features with the AttributeValidator using the rules.
accessroad.fmw
Input: a table containing possible code values for each field.
Field,Code
PermTemp,PT1
PermTemp,PT2
PermTemp,PT3
PublicPriv,PP1
PublicPriv,PP2
PublicPriv,PP3
NewExist,NE1
NewExist,NE2
NewExist,NE3
SurfaceMat,SM1
SurfaceMat,SM2
SurfaceMat,SM3
Output: a single feature containing validation rules for each field.You can merge the feature containing validation rules to the data features from the FeatureReader, then validate the features with the AttributeValidator using the rules.