When creating collection or extended metadata fields in the Bathymetry Information System (BIS), you need to define the field’s data type (string, integer, date, and so on), and decide if you want to apply validation rules or restriction types to the new field. For example, for your extended metadata fields, you can create a custom field with restrictions in place that limit the range of allowed values for the number of beams in the sensor.
ArcGIS Bathymetry recognizes five different field types for the collection and extended metadata configuration XML schemas. Each field type has a corresponding data type when viewing the XML schemas directly.
Metadata field type | XML schema data type |
---|---|
Date | xmlTypeDateTime |
Double | xmlTypeDouble |
Enumeration | xmlTypeEnum |
Integer | xmlTypeLong |
Text | xmlTypeString |
Each data type has an associated data type restriction that limits the values that can be entered, such as the minimum string length, a range of numbers for an integer value, and so on, when you edit a field’s value on the Manage Collections or Add Bathymetry dialog boxes, or define a filter in the Explore Bathymetry window.
When defining a restriction for a specific data type, you will need to create specific child elements under the xmlDataRestriction element. You can also use a RelationRestriction to add business logic to fields. For example, you can ensure that an end date is not earlier than a start date.
Data types and restrictions
The following is a list of data types and data type restrictions available when creating collection and extended metadata fields. Each data type and data type restriction includes examples on how to configure them in the XML file.
xmlTypeDateTime
Use this data type for date and time entries.
The data type restriction is XmlMetadataFieldDateTimeRestrictionEditable and is used to configure metadata editing and display rules for editable fields that contain date and time entries.
The following table summarizes the options for the data type restriction.
Options | Description | Entries | Examples |
---|---|---|---|
DefaultValue (optional) | The initial value displayed when new metadata is entered. | Now: Defaults to the current system date and time on dialog boxes such as Add Bathymetry where a date field can be supplied by the user. | <DefaultValue>Now</DefaultValue> |
RelationRestrictions (optional) | Applies business rules on the field or between two fields. It implements the XmlRelationRestriction child element that defines the relation type and can be linked to another field to run the relationship check against. |
| relationXmlNodeName: A restriction could require the selection of an end date when the startDate field is defined or is not null. |
The following is an example of the xmlTypeDateTime dataType and its restrictions:
<BisExtXmlMetadataDefinitionField xmlNodeName=”startDate” title=”Start Date” dataType=”xmlTypeDateTime” required=”false” searchable=”true” displayed=”true”>
<xmlDataRestriction restrictionType=”XmlMetadataFieldDateTimeRestrictionEditable”>
<DefaultValue>Now</DefaultValue>
<RelationRestrictions>
<XmlRelationRestriction relationType="LessThanOrEqual" relationXmlNodeName="endDate" />
<RelationRestrictions>
</xmlDataRestriction>
</BisExtXmlMetadataDefinitionField>
xmlTypeDouble
Use this data type for decimal numbers (for example, 5.4545). You can define a default value, maximum and minimum values, and the total number of decimal places displayed.
The data type restriction is XmlMetadataFieldDoubleRestriction and is used to configure metadata editing and display rules for editable fields that contain decimal numbers.
The following table summarizes the options for the data type restriction.
Options | Description | Entries | Examples |
---|---|---|---|
DefaultValue (optional) | The initial value displayed when new metadata is entered. | N/A | <DefaultValue>1.123</DefaultValue> |
MaxDecimalPlaces (optional) | Defines the maximum number of decimal places allowed for a double value. If this is not defined, the limit will be based on the native double type limitation. Never decrease this value if you already have data entered in the metadata fields as this will result in editing errors in the application. | N/A | <MaxDecimalPlaces>6</MaxDecimalPlaces> |
MinValue (optional) | Defines a minimum value allowed when editing the metadata field in the user interface. Once this value has been defined, do not change it to a value greater than the original if values have been entered in the metadata fields as this can cause data editing errors. | N/A | <MinValue>2.1</MinValue> |
MaxValue (optional) | Defines the maximum value allowed when editing the metadata field in the user interface. Once this value has been defined, do not change it to a value less than the original if values have been entered in the metadata fields as this can cause data editing errors. | N/A | <MaxValue>5.6</MaxValue> |
RelationRestrictions (optional) | Applies business rules on the field or between two fields. It implements the XmlRelationRestriction child element that defines the relation type and can be linked to another field to run the relationship check against. |
| relationXmlNodeName: A restriction could require a field representing a depth value to be greater than the minimumDepth value. |
The following is an example of the xmlTypeDouble dataType and its restrictions:
<BisExtXmlMetadataDefinitionField xmlNodeName=”averageDepth” title=”Average Depth” dataType=”xmlDoubleType” required=”false” searchable=”true” displayed=”true”>
<xmlDataRestriction restrictionType=”XmlMetadataFieldDoubleRestriction”>
<DefaultValue>1.1234</DefaultValue>
<MaxDecimalPlaces>6</MaxDecimalPlaces>
<MinValue>2.1</MinValue>
<MaxValue>5.6</MaxValue>
<RelationRestrictions>
<XmlRelationRestriction relationType="GreaterThan" relationXmlNodeName="minimumDepth" />
<RelationRestrictions>
</xmlDataRestriction>
</BisExtXmlMetadataDefinitionField>
xmlTypeEnum
Use this data type to store a list of predefined values that display as a list of options for your custom field.
The data type restriction is XmlMetadataFieldEnumRestriction and is used to configure metadata editing and display rules for editable fields that contain a list of predefined values. For example, you could choose from a list of five sensors that you assign to a sensor metadata field. As new sensors are used, you can add them to the list of available sensors.
The following table summarizes the options for the data type restriction.
Options | Description | Entries | Examples |
---|---|---|---|
DefaultValue (optional) | The initial value displayed when new metadata is entered. | N/A | <DefaultValue>1</DefaultValue> |
EnumValues (required) | The parent element for the EnumValue element that holds detailed information for the list values. | N/A | N/A |
EnumValue (required) | Stores ID and text attributes for each EnumValue element. Once you have set an enumerated value to a metadata record, you can no longer remove an EnumValue element from the configuration file as this would cause metadata editing errors. If you need to show that an enumerated value is no longer valid or applicable, you can update the text attribute to show this status. The order of the EnumValue elements determines their display order in the field's drop-down list. |
| <EnumValues> <EnumValue id="0" text="Option 1" /> <EnumValue id="2" text="Option 3" /> <EnumValue id="1" text="Option 2 (deprecated)" /> </EnumValues> |
RelationRestrictions (optional) | Applies business rules on the field or between two fields. It implements the XmlRelationRestriction child element that defines the relation type and can be linked to another field to run the relationship check against. |
| relationXmlNodeName: A restriction could require a sensor type to be selected when the sonarFrequency field is defined or is not null. |
The following is an example of the xmlTypeEnum dataType and its restrictions:
<BisExtXmlMetadataDefinitionField xmlNodeName=”sensor” title=”Sensor” dataType=”xmlTypeEnum” required=”true” searchable=”true” displayed=”true”>
<xmlDataRestriction restrictionType=”XmlMetadataFieldEnumRestriction”>
<EnumValues>
<EnumValue id="0" text="Sensor 1" />
<EnumValue id="1" text="Sensor 2" />
<EnumValue id="2" text="Sensor 3" />
</EnumValues>
<RelationRestrictions>
<XmlRelationRestriction relationType="RequiredWhenOtherIsNotNull" relationXmlNodeName="sonarFrequency" />
<RelationRestrictions>
</xmlDataRestriction>
</BisExtXmlMetadataDefinitionField>
xmlTypeInt
Use this data type for whole numbers, for example, 545. The default value range is from -2147483648 to 2147483648. You can define the default, minimum, and maximum values for this field type.
The data type restriction is XmlMetadataFieldIntRestriction and is used to configure metadata editing and display rules for editable fields that contain integers.
The following table summarizes the options for the data type restriction.
Options | Description | Entries | Examples |
---|---|---|---|
DefaultValue (optional) | The initial value displayed when new metadata is entered. If you need to input a negative integer, be sure to use the proper signage for the regional setting your system uses. For example, -1 for US and 1- for certain Arabic settings. | N/A | <DefaultValue>1</DefaultValue> |
MinValue (optional) | Defines a minimum value allowed when editing the metadata field in the user interface. Once this value has been defined, do not change it to a value greater than the original if values have been entered in the metadata fields as this can cause data editing errors. | N/A | <MinValue>0</MinValue> |
MaxValue (optional) | Defines the maximum value allowed when editing the metadata field in the user interface. Once this value has been defined, do not change it to a value less than the original if values have been entered in the metadata fields as this can cause data editing errors. | N/A | <MaxValue>100</MaxValue> |
RelationRestrictions (optional) | Applies business rules on the field or between two fields. It implements the XmlRelationRestriction child element that defines the relation type and can be linked to another field to run the relationship check against. |
| relationXmlNodeName: A restriction could require a field representing a vessel's number of tracks to be greater than the minimum number of tracks for a vessel. Another restriction can also be added that requires the number of tracks to be populated when the vesselName field is populated or is not null. |
The following is an example of the xmlTypeInt dataType and its restrictions:
<BisExtXmlMetadataDefinitionField xmlNodeName="vesselTracks" title=”Number of Vessel Tracks” dataType=”xmlTypeInt” required=”false” searchable=”true” displayed=”true”>
<xmlDataRestriction restrictionType=”XmlMetadataFieldIntRestriction”>
<DefaultValue>1</DefaultValue>
<MinValue>0</MinValue>
<MaxValue>100</MaxValue>
<RelationRestrictions>
<XmlRelationRestriction relationType="GreaterThan" relationXmlNodeName="minVesselTrackReq" />
<XmlRelationRestriction relationType="RequiredWhenOtherIsNotNull" relationXmlNodeName="vesselName" />
<RelationRestrictions>
</xmlDataRestriction>
</BisExtXmlMetadataDefinitionField>
xmlTypeShort
Use this data type for short whole numbers. The range for short integers is -32768 to 32767. You can set the default, minimum, and maximum values.
The data type restriction is XmlMetadataFieldShortRestriction and is used to configure metadata editing and display rules for fields that contain short integers.
The following table summarizes the options for the data type restriction.
Options | Description | Entries | Examples |
---|---|---|---|
DefaultValue (optional) | The initial value displayed when new metadata is entered. If you need to input a negative integer, be sure to use the proper signage for the regional setting your system uses. For example, -1 for US and 1- for certain Arabic settings. | N/A | <DefaultValue>1</DefaultValue> |
MinValue (optional) | Defines a minimum value allowed when editing the metadata field in the user interface. Once this value has been defined, do not change it to a value greater than the original if values have been entered in the metadata fields as this can cause data editing errors. | N/A | <MinValue>1</MinValue> |
MaxValue (optional) | Defines the maximum value allowed when editing the metadata field in the user interface. Once this value has been defined, do not change it to a value less than the original if values have been entered in the metadata fields as this can cause data editing errors. | N/A | <MaxValue>25</MaxValue> |
RelationRestrictions (optional) | Applies business rules on the field or between two fields. It implements the XmlRelationRestriction child element that defines the relation type and can be linked to another field to run the relationship check against. |
| relationXmlNodeName: A restriction could require a vessel number to be entered when the vesselName field is populated or is not null. |
The following is an example of the xmlTypeShort dataType and its restrictions:
<BisExtXmlMetadataDefinitionField xmlNodeName="vesselNumber" title=”Vessel Number” dataType=”xmlTypeShort” required=”false” searchable=”true” displayed=”true”>
<xmlDataRestriction restrictionType=”XmlMetadataFieldShortRestriction”>
<DefaultValue>1</DefaultValue>
<MinValue>1</MinValue>
<MaxValue>25</MaxValue>
<RelationRestrictions>
<XmlRelationRestriction relationType="RequiredWhenOtherIsNotNull" relationXmlNodeName="vesselName" />
<RelationRestrictions>
</xmlDataRestriction>
</BisExtXmlMetadataDefinitionField>
xmlTypeLong
Use this data type for long whole numbers. The default value range is from -9223372036854775808 to 9223372036854775807. You can set the default, minimum, and maximum values.
The data type restriction is XmlMetadataFieldLongRestriction and is used to configure metadata editing and display rules for editable fields that contain long integers.
The following table summarizes the options for the data type restriction.
Options | Description | Entries | Examples |
---|---|---|---|
DefaultValue (optional) | The initial value displayed when new metadata is entered. If you need to input a negative integer, be sure to use the proper signage for the regional setting your system uses. For example, -1 for US and 1- for certain Arabic settings. | N/A | <DefaultValue>1</DefaultValue> |
MinValue (optional) | Defines a minimum value allowed when editing the metadata field in the user interface. Once this value has been defined, do not change it to a value greater than the original if values have been entered in the metadata fields as this can cause data editing errors. | N/A | <MinValue>1</MinValue> |
MaxValue (optional) | Defines the maximum value allowed when editing the metadata field in the user interface. Once this value has been defined, do not change it to a value less than the original if values have been entered in the metadata fields as this can cause data editing errors. | N/A | <MaxValue>25</MaxValue> |
RelationRestrictions (optional) | Applies business rules on the field or between two fields. It implements the XmlRelationRestriction child element that defines the relation type and can be linked to another field to run the relationship check against. |
| relationXmlNodeName: A restriction could require the vessel displacement to be entered when the vesselName field is populated or is not null. |
The following is an example of the xmlTypeLong dataType and its restrictions:
<BisExtXmlMetadataDefinitionField xmlNodeName="vesselDisplacement" title=”Vessel Displacement” dataType=”xmlTypeLong” required=”false” searchable=”true” displayed=”true”>
<xmlDataRestriction restrictionType=”XmlMetadataFieldLongRestriction”>
<DefaultValue>10000</DefaultValue>
<MinValue>10000</MinValue>
<MaxValue>25000000</MaxValue>
<RelationRestrictions>
<XmlRelationRestriction relationType="RequiredWhenOtherIsNotNull" relationXmlNodeName="vesselName" />
<RelationRestrictions>
</xmlDataRestriction>
</BisExtXmlMetadataDefinitionField>
xmlTypeString
Use this data type for metadata fields that will contain text values. Text values entered in a string field that represent hyperlinks, such as web URLs or UNC paths to on-disk files or folders, will automatically be recognized and converted to active links.
The data type restriction is XmlMetadataFieldStringRestriction and is used to configure metadata editing and display rules for fields that contain string values. You can set the default value for the field and define a minimum and maximum string length. For example, you can require that all string values do not exceed 255 characters.
The following table summarizes the options for the data type restriction.
Options | Description | Entries | Examples |
---|---|---|---|
DefaultValue (optional) | The initial value displayed when new metadata is entered. | N/A | <DefaultValue>Esri</DefaultValue> |
MinLength (optional) | Defines a minimum string length for the metadata field. You should not alter the value if you have added bathymetry data to your BIS geodatabase and defined values for the field because this can cause data editing errors. | N/A | <MinLength>1</MinLength> |
MaxLength (optional) | Defines the maximum length for the metadata field. You should not alter the value if you have added bathymetry data to your BIS geodatabase and defined values for the field because this will cause editing errors. | N/A | <MaxLength>255</MaxLength> |
RelationRestrictions (optional) | Applies business rules on the field or between two fields. It implements the XmlRelationRestriction child element that defines the relation type and can be linked to another field to run the relationship check against. |
| relationXmlNodeName: A restriction could require a string field representing a contact organization to be populated when the contactPerson field is populated or is not null. |
The following is an example of the xmlTypeString dataType and its restrictions:
<BisExtXmlMetadataDefinitionField xmlNodeName="contactOrganization" title=”Contact Organization” dataType=”xmlTypeString” required=”true” searchable=”true” displayed=”true”>
<xmlDataRestriction restrictionType=”XmlMetadataFieldStringRestriction”>
<DefaultValue>Esri</DefaultValue>
<MinLength>1</MinLength>
<MaxLength>255</MaxLength>
<RelationRestrictions>
<XmlRelationRestriction relationType="RequiredWhenOtherIsNotNull" relationXmlNodeName="contactPerson" />
<RelationRestrictions>
</xmlDataRestriction>
</BisExtXmlMetadataDefinitionField>
Relation restrictions and types
The collection and extended metadata fields have relation restrictions that are used to enforce your organization’s specific business rules. Relation restrictions compare one metadata field value to another to validate them against your business rules. For example, one relation type checks whether one numeric field is greater than another or whether a metadata field is populated correctly based on the value of another metadata field.
There are two types of relation restrictions that you can apply to a new metadata field: basic and numeric. The basic restriction is used for string and enumerated data types and the numeric restriction is used for all numeric data types (date, double, and integer). If you declare a relation restriction element, you must configure at least one relation restriction type, but there is no limit to the number of relation restriction types you can create for a metadata field. When defining a relation restriction, the following attributes are required:
- relationType—Defines the type of relation being applied to the metadata field
- relationXmlNodeName—Defines the xmlNodeName of another metadata field that the relationType is applied to
In the next example, the metadata value stored in the xmlNodeName="vesselTracks" field will be compared to the metadata value stored in the relationXmlNodeName="vesselName" field, which corresponds to a field defined in the XML configuration file. The RelationRestriction element, subelements, and attributes link the two fields, whereas the relationType attribute defines the type of check that will be run against the two metadata fields. In this example, there are two relation types being run: GreaterThan and RequiredWhenOtherIsNotNull.
The following is an example of a RelationRestriction element:
<BisExtXmlMetadataDefinitionField xmlNodeName="vesselTracks" title=”Number of Vessel Tracks” dataType=”xmlTypeInt” required=”false” searchable=”true” displayed=”true”>
<xmlDataRestriction restrictionType=”XmlMetadataFieldIntRestriction”>
<DefaultValue>1</DefaultValue>
<MinValue>0</MinValue>
<MaxValue>100</MaxValue>
<RelationRestrictions>
<XmlRelationRestriction relationType="GreaterThan" relationXmlNodeName="minVesselTrackReq" />
<XmlRelationRestriction relationType="RequiredWhenOtherIsNotNull" relationXmlNodeName="vesselName" />
<RelationRestrictions>
</xmlDataRestriction>
</BisExtXmlMetadataDefinitionField>
The following relationType attribute values are the available in the schema:
Relation restriction type | Description | Example |
---|---|---|
RequiredWhenOtherIsNotNull | The metadata field defined in the xmlNodeName attribute must be populated when the metadata field defined in the relationXmlNodeName attribute is populated. If no value is entered in the field defined in the relationXmlNodeName attribute, the relationType will not be applied. | <RelationRestrictions> <XmlRelationRestriction relationType="RequiredWhenOtherIsNotNull" relationXmlNodeName="stringMinimumRequired" /> <XmlRelationRestriction relationType="RequiredWhenOtherIsNotNull" relationXmlNodeName="stringSomeOptions" /> </RelationRestrictions> |
Relation restriction type | Description | Example |
---|---|---|
LessThan | The metadata field defined in the xmlNodeName attribute must be less than the value defined in the relationXmlNodeName attribute. If no value is entered in the field defined in the relationXmlNodeName attribute, the relationType will not be applied. | <RelationRestrictions> <XmlRelationRestriction relationType="LessThan"relationXmlNodeName="intMinimumRequired" /> </RelationRestrictions> |
LessThanOrEqual | The metadata field defined in the xmlNodeName must be less than or equal to the value defined in the relationXmlNodeName attribute. If no value is entered in the field defined in the relationXmlNodeName attribute, the relationType will not be applied. | <RelationRestrictions> <XmlRelationRestriction relationType=" LessThanOrEqual" relationXmlNodeName="intMinimumRequired" /> </RelationRestrictions> |
Equal | The metadata field defined in the xmlNodeName attribute must be equal to the value defined in the relationXmlNodeName attribute. If no value is entered in the field defined in the relationXmlNodeName attribute, the relationType will not be applied. | <RelationRestrictions> <XmlRelationRestriction relationType=" Equal" relationXmlNodeName="intMinimumRequired" /> </RelationRestrictions> |
GreaterThan | The metadata field defined in the xmlNodeName attribute must be greater than the value defined in the relationXmlNodeName attribute. If no value is entered in the field defined in the relationXmlNodeName attribute, the relationType will not be applied. | <RelationRestrictions> <XmlRelationRestriction relationType=" GreaterThan" relationXmlNodeName="intMinimumRequired" /> </RelationRestrictions> |
GreaterThanOrEqual | The metadata field defined in the xmlNodeName attribute must be greater than or equal to the value defined in the relationXmlNodeName attribute. If no value is entered in the field defined in the relationXmlNodeName attribute, the relationType will not be applied. | <RelationRestrictions> <XmlRelationRestriction relationType=" GreaterThanOrEqual" relationXmlNodeName="intMinimumRequired" /> </RelationRestrictions> |
RequiredWhenOtherIsNotNull | The metadata field defined in the xmlNodeName attribute must be populated when the metadata field defined in the relationXmlNodeName attribute is populated. If no value is entered in the field defined in the relationXmlNodeName attribute, the relationType will not be applied. | <RelationRestrictions> <XmlRelationRestriction relationType="RequiredWhenOtherIsNotNull" relationXmlNodeName="intMinimumRequired" /> </RelationRestrictions> |