Picklist
Value constraints of type “Picklist” are split into lists of literals (strings) by using the Picklist Item Separator, by default whitespace. Lists are rendered in the text display as quoted strings, separated by commas and enclosed in square brackets, and in the JSON and YAML outputs as list objects.
In the following example: - In the absence of valueConstraintType “picklist”, “red blue green” is a string value. - With valueConstraintType “picklist”, “red blue green” is parsed on whitespace into a list. - With valueConstraintType “picklist”, “yellow” is parsed on whitespace into a list with a single item.
propertyID |
valueConstraint |
valueConstraintType |
---|---|---|
:color |
red blue green |
|
:color |
red blue green |
picklist |
:color |
yellow |
picklist |
This is interpreted as:
DCTAP instance
Shape
shapeID default
Statement Template
propertyID :color
valueConstraint red blue green
Statement Template
propertyID :color
valueConstraint ['red', 'blue', 'green']
valueConstraintType picklist
Statement Template
propertyID :color
valueConstraint ['yellow']
valueConstraintType picklist
If dctap is configured to use a comma as the Picklist Item Separator, the CSV
propertyID |
valueConstraint |
valueConstraintType |
---|---|---|
:color |
reddish brown, greenish yellow, bluish green |
picklist |
is interpreted as:
DCTAP instance
Shape
shapeID default
Statement Template
propertyID :color
valueConstraint ['reddish brown', 'greenish yellow', 'bluish green']
valueConstraintType picklist