Source node common properties
Properties that are common to all source nodes are listed below, with information on specific nodes in the topics that follow.
Example 1
varfilenode = modeler.script.stream().create("variablefile", "Var. File")
varfilenode.setPropertyValue("full_filename", "$CLEO_DEMOS/DRUG1n")
varfilenode.setKeyedPropertyValue("check", "Age", "None")
varfilenode.setKeyedPropertyValue("values", "Age", [1, 100])
varfilenode.setKeyedPropertyValue("type", "Age", "Range")
varfilenode.setKeyedPropertyValue("direction", "Age", "Input")
Example 2
This script assumes that the specified data file contains a field called Region
that represents a multi-line string.
from modeler.api import StorageType
from modeler.api import MeasureType
# Create a Variable File node that reads the data set containing
# the "Region" field
varfilenode = modeler.script.stream().create("variablefile", "My Geo Data")
varfilenode.setPropertyValue("full_filename", "C:/mydata/mygeodata.csv")
varfilenode.setPropertyValue("treat_square_brackets_as_lists", True)
# Override the storage type to be a list...
varfilenode.setKeyedPropertyValue("custom_storage_type", "Region", StorageType.LIST)
# ...and specify the type if values in the list and the list depth
varfilenode.setKeyedPropertyValue("custom_list_storage_type", "Region", StorageType.INTEGER)
varfilenode.setKeyedPropertyValue("custom_list_depth", "Region", 2)
# Now change the measurement to indentify the field as a geospatial value...
varfilenode.setKeyedPropertyValue("measure_type", "Region", MeasureType.GEOSPATIAL)
# ...and finally specify the necessary information about the specific
# type of geospatial object
varfilenode.setKeyedPropertyValue("geo_type", "Region", "MultiLineString")
varfilenode.setKeyedPropertyValue("geo_coordinates", "Region", "2D")
varfilenode.setKeyedPropertyValue("has_coordinate_system", "Region", True)
varfilenode.setKeyedPropertyValue("coordinate_system", "Region",
"ETRS_1989_EPSG_Arctic_zone_5-47")
Property name | Data type | Property description |
---|---|---|
direction |
Input
Target
Both
None
Partition
Split
Frequency
RecordID |
Keyed property for field roles.
Usage format:
NODE.direction.FIELDNAME
Note: The values
In and Out are now deprecated. Support
for them may be withdrawn in a future release. |
type |
Range
Flag
Set
Typeless
Discrete
Ordered
Set
Default |
Type of field. Setting this property to Default will
clear any values property setting, and if value_mode is
set to Specify, it will be reset to Read. If value_mode is
already set to Pass or Read, it will be unaffected by
the type setting.
Usage format:
NODE.type.FIELDNAME |
storage |
Unknown
String
Integer
Real
Time
Date
Timestamp |
Read-only keyed property for field storage type.
Usage
format:
NODE.storage.FIELDNAME |
check |
None
Nullify
Coerce
Discard
Warn
Abort |
Keyed property for field type and range checking.
Usage
format:
NODE.check.FIELDNAME |
values |
[value value] | For a continuous (range) field, the first value is the minimum, and the last value is the
maximum. For nominal (set) fields, specify all values. For flag fields, the first value represents
false, and the last value represents true. Setting this property automatically sets
the value_mode property to Specify. The storage is determined based on the
first value in the list, for example, if the first value is a string then the storage is set
to String.
Usage format:
NODE.values.FIELDNAME
|
value_mode |
Read
Pass
Read+
Current
Specify |
Determines how values are set for a field on the next data
pass.
Usage format:
NODE.value_mode.FIELDNAME
Note
that you cannot set this property to Specify directly; to use
specific values, set the values property. |
default_value_mode |
Read
Pass |
Specifies the default method for setting values for all fields.
Usage format:
NODE.default_value_mode
This setting can be overridden for specific fields by using the value_mode
property. |
extend_values |
flag | Applies when value_mode is set to Read.
Set to T to add newly read values to any existing values for
the field. Set to F to discard existing values in favor of
the newly read values.
Usage format:
NODE.extend_values.FIELDNAME |
value_labels |
string | Used to specify a value label. Note that values must be specified first. |
enable_missing |
flag | When set to T, activates tracking of missing values
for the field.
Usage format:
NODE.enable_missing.FIELDNAME |
missing_values |
[value value ...] | Specifies data values that denote missing data.
Usage
format:
NODE.missing_values.FIELDNAME |
range_missing |
flag | When this property is set to T, specifies whether a
missing-value (blank) range is defined for a field.
Usage
format:
NODE.range_missing.FIELDNAME |
missing_lower |
string | When range_missing is true, specifies the
lower bound of the missing-value range.
Usage format:
NODE.missing_lower.FIELDNAME |
missing_upper |
string | When range_missing is true, specifies the
upper bound of the missing-value range.
Usage format:
NODE.missing_upper.FIELDNAME |
null_missing |
flag | When this property is set to T, nulls (undefined values
that are displayed as $null$ in the software) are
considered missing values.
Usage format:
NODE.null_missing.FIELDNAME |
whitespace_missing |
flag | When this property is set to T, values containing only
white space (spaces, tabs, and new lines) are considered missing values.
Usage
format:
NODE.whitespace_missing.FIELDNAME |
description |
string | Used to specify a field label or description. |
default_include |
flag | Keyed property to specify whether the default behavior is to
pass or filter fields:
NODE.default_include
Example:
set
mynode:filternode.default_include = false |
include |
flag | Keyed property used to determine whether individual fields are included or filtered:
NODE.include.FIELDNAME . |
new_name
|
string | |
measure_type
|
Range / MeasureType.RANGE
Discrete /
MeasureType.DISCRETE
Flag / MeasureType.FLAG
Set /
MeasureType.SET
OrderedSet /
MeasureType.ORDERED_SET
Typeless /
MeasureType.TYPELESS
Collection /
MeasureType.COLLECTION
Geospatial / MeasureType.GEOSPATIAL |
This keyed property is similar to type in that it can be used to define the
measurement associated with the field. What is different is that in Python scripting, the setter
function can also be passed one of the MeasureType values while the getter will
always return on the MeasureType values. |
collection_measure
|
Range / MeasureType.RANGE
Flag /
MeasureType.FLAG
Set / MeasureType.SET
OrderedSet /
MeasureType.ORDERED_SET
Typeless / MeasureType.TYPELESS |
For collection fields (lists with a depth of 0), this keyed property defines the measurement type associated with the underlying values. |
geo_type
|
Point
MultiPoint
LineString
MultiLineString
Polygon
MultiPolygon |
For geospatial fields, this keyed property defines the type of geospatial object represented by this field. This should be consistent with the list depth of the values. |
has_coordinate_system
|
boolean | For geospatial fields, this property defines whether this field has a coordinate system |
coordinate_system
|
string | For geospatial fields, this keyed property defines the coordinate system for this field. |
custom_storage_type
|
Unknown / MeasureType.UNKNOWN
String /
MeasureType.STRING
Integer /
MeasureType.INTEGER
Real / MeasureType.REAL
Time /
MeasureType.TIME
Date / MeasureType.DATE
Timestamp /
MeasureType.TIMESTAMP
List / MeasureType.LIST |
This keyed property is similar to custom_storage in that it can be used to
define the override storage for the field. What is different is that in Python scripting, the setter
function can also be passed one of the StorageType values while the getter will
always return on the StorageType values. |
custom_list_storage_type
|
String / MeasureType.STRING
Integer /
MeasureType.INTEGER
Real / MeasureType.REAL
Time /
MeasureType.TIME
Date / MeasureType.DATE
Timestamp /
MeasureType.TIMESTAMP |
For list fields, this keyed property specifies the storage type of the underlying values. |
custom_list_depth
|
integer | For list fields, this keyed property specifies the depth of the field |
max_list_length
|
integer | Only available for data with a measurement level of either Geospatial or Collection. Set the maximum length of the list by specifying the number of elements the list can contain. |
max_string_length
|
integer | Only available for typeless data and used when you are generating SQL to create a table. Enter the value of the largest string in your data; this generates a column in the table that is big enough to contain the string. |