{"id":2080042,"date":"2023-10-16T08:30:51","date_gmt":"2023-10-16T15:30:51","guid":{"rendered":"https:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=2080042"},"modified":"2023-10-20T14:04:36","modified_gmt":"2023-10-20T21:04:36","slug":"ddl-in-pro-sdk","status":"publish","type":"blog","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk","title":{"rendered":"Get started with the Data Definition Language (DDL) API in the ArcGIS Pro SDK for .NET"},"author":346082,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"_searchwp_excluded":""},"categories":[23851,738191],"tags":[23641,42651],"industry":[],"product":[36851,36601],"class_list":["post-2080042","blog","type-blog","status-publish","format-standard","hentry","category-data-management","category-developers","tag-net","tag-arcgis-pro-sdk","product-arcgis-pro-net","product-developers"],"acf":{"authors":[{"ID":345992,"user_firstname":"Aashis","user_lastname":"Lamsal","nickname":"alamsal","user_nicename":"alamsal","display_name":"Aashis Lamsal","user_email":"alamsal@esri.com","user_url":"","user_registered":"2023-09-18 16:07:02","user_description":"Aashis Lamsal is a Product Engineer at Esri, primarily working in the ArcGIS Pro and ArcGIS Enterprise SDKs. He has 10+ years of GIS application development experience and a background in epidemiology, natural resources, utilities, and more.","user_avatar":"<img data-del=\"avatar\" src='https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/09\/600x600_aashislamsal-465x465.png' class='avatar pp-user-avatar avatar-96 photo ' height='96' width='96'\/>"},{"ID":346082,"user_firstname":"Jacob","user_lastname":"Zhi","nickname":"jzhi","user_nicename":"jzhi","display_name":"Jacob Zhi","user_email":"jzhi@esri.com","user_url":"","user_registered":"2023-09-19 18:29:30","user_description":"Jacob is a Student Technician in the Software Products division at Esri. He is also currently studying computer science as an undergraduate student at UCLA.","user_avatar":"<img alt='' src='https:\/\/secure.gravatar.com\/avatar\/e0c9cd7475fb15c715e848eda1317cee3649283d5753413b274c4a4e6bcc98c0?s=96&#038;d=blank&#038;r=g' srcset='https:\/\/secure.gravatar.com\/avatar\/e0c9cd7475fb15c715e848eda1317cee3649283d5753413b274c4a4e6bcc98c0?s=192&#038;d=blank&#038;r=g 2x' class='avatar avatar-96 photo' height='96' width='96' loading='lazy' decoding='async'\/>"}],"short_description":"ArcGIS Pro SDK's Data Definition Language (DDL) API allows developers to create, modify, and delete geodatabases and schema programmatically.","flexible_content":[{"acf_fc_layout":"content","content":"<h1>Overview<\/h1>\n<p>The release of <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/sdk\/\">ArcGIS Pro SDK 3.1<\/a> brings improvements to the Data Definition Language (DDL) API for geodatabases schema management. This API allows developers to create, modify, and delete geodatabases and their schema programmatically from scratch. Developers who rely on traditional geoprocessing tools for managing workspaces, datasets, fields, domains, subtypes, and relationship classes can use the DDL API to automate and extend the functionality of ArcGIS Pro.<\/p>\n<p>The following functionalities are available on the specified geodatabase types:<\/p>\n<table>\n<tbody>\n<tr>\n<td>Capability<\/td>\n<td>File Geodatabase<\/td>\n<td>Mobile Geodatabase<\/td>\n<td>Enterprise Geodatabase<\/td>\n<td>Memory Geodatabase<\/td>\n<\/tr>\n<tr>\n<td>Tables (create, modify, rename, delete)<\/td>\n<td>\u2714<\/td>\n<td>\u2714<\/td>\n<td>\u2714<\/td>\n<td>\u2714<\/td>\n<\/tr>\n<tr>\n<td>Feature classes (create, modify, rename, delete)<\/td>\n<td>\u2714<\/td>\n<td>\u2714<\/td>\n<td>\u2714<\/td>\n<td>\u2714<\/td>\n<\/tr>\n<tr>\n<td>Feature datasets (create, change contents, rename, delete)<\/td>\n<td>\u2714<\/td>\n<td>\u2714<\/td>\n<td>\u2714<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Domains (create, modify, rename, delete)<\/td>\n<td>\u2714<\/td>\n<td>\u2714<\/td>\n<td>\u2714<\/td>\n<td>\u2714<\/td>\n<\/tr>\n<tr>\n<td>Annotation feature classes (create, modify, rename, delete)<\/td>\n<td>\u2714<\/td>\n<td>\u2714<\/td>\n<td>\u2714<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Subtypes (create, modify, delete)<\/td>\n<td>\u2714<\/td>\n<td>\u2714<\/td>\n<td>\u2714<\/td>\n<td>\u2714<\/td>\n<\/tr>\n<tr>\n<td>Relationship classes (create, modify, rename, delete)<\/td>\n<td>\u2714<\/td>\n<td>\u2714<\/td>\n<td>\u2714<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Indexes (create, delete)<\/td>\n<td>\u2714<\/td>\n<td>\u2714<\/td>\n<td>\u2714<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Geodatabases (create, delete)<\/td>\n<td>\u2714<\/td>\n<td>\u2714<\/td>\n<td><\/td>\n<td>\u2714<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n"},{"acf_fc_layout":"content","content":"<h1>Usage pattern<\/h1>\n<p>The DDL routines follow a common pattern. First, a <code>Description<\/code> class is used to specify the schema object to be created or deleted. The <code>Description<\/code> objects are either created by assigning desired values to a set of properties and parameters, or using existing schema objects, including tokens or existing definitions.<\/p>\n<p>In this example, you will create a description of a table with fields. A <code>TableDescription<\/code> object describes a table. One property of a table description is a list of <code>FieldDescription<\/code> objects to specify the fields.<\/p>\n<pre><code><span style=\"color: #008000\">\/\/ Create a FieldDescription for the InspectionDate field<\/span>\r\nFieldDescription inspectionDateFieldDescription = <span style=\"color: #0000ff\">new<\/span> FieldDescription(<span style=\"color: #a31515\">\"InspectionDate\"<\/span>, FieldType.Date)\r\n{\r\n    AliasName = <span style=\"color: #a31515\">\"Inspection Date\"<\/span>\r\n};\r\nTableDescription inspectionTableDescription = <span style=\"color: #0000ff\">new<\/span> TableDescription(\r\n    <span style=\"color: #a31515\">\"Inspections\"<\/span>, \r\n    <span style=\"color: #0000ff\">new<\/span> List&lt;FieldDescription&gt; { inspectionDateFieldDescription }\r\n);\r\n<\/code><\/pre>\n<p>To obtain the <code>TableDescription<\/code> of a table that exists in the geodatabase, pass the <code>Definition<\/code> object to the constructor.<\/p>\n<div style=\"background: #ffffff;overflow: auto;width: auto;font-size: 0.8em\">\n<pre style=\"margin: 0;line-height: 125%\">TableDescription inspectionTableDescription = <span style=\"color: #0000ff\">new<\/span> TableDescription(inspectionTableDefinition);\r\n<\/pre>\n<\/div>\n<p>The schema objects are created, modified, and deleted using a <code>SchemaBuilder<\/code> object, which is constructed from the <code>Geodatabase<\/code> object where the schema operations will take place.<\/p>\n<pre><code><span style=\"color: #008000\">\/\/ Create a SchemaBuilder Object<\/span>\r\nSchemaBuilder schemaBuilder = <span style=\"color: #0000ff\">new<\/span> SchemaBuilder(geodatabase);\r\n<\/code><\/pre>\n<p>DDL operations for creation are enqueued with the schema builder using the <code>Create<\/code> method.<\/p>\n<pre><code><span style=\"color: #008000\">\/\/ Add the creation of the table to our list of DDL tasks<\/span>\r\nTableToken tableToken = schemaBuilder.Create(tableDescription);\r\n<\/code><\/pre>\n<p>The set of DDL operations is then run with a call to <code>Build<\/code>. If the process fails, the <code>ErrorMessages<\/code> property of the <code>SchemaBuilder<\/code> object can be queried to find out what went wrong.<\/p>\n<pre><code><span style=\"color: #008000\">\/\/ Run the DDL<\/span>\r\n<span style=\"color: #2b91af\">bool<\/span> success = schemaBuilder.Build();\r\nIReadOnlyList&lt;<span style=\"color: #2b91af\">string<\/span>&gt; errorMessages = schemaBuilder.ErrorMessages;\r\n<\/code><\/pre>\n<p>When using the Modify method to modify schema, there are two common patterns to obtain a modified description to pass to the method:<\/p>\n<ol>\n<li>Copy properties and attributes from the current description to a new description object, except for the properties that need to be modified. This is often done if the property to modify is read-only in the description class.<\/li>\n<li>Directly modify the current description object if the property is not read-only.<\/li>\n<\/ol>\n"},{"acf_fc_layout":"sidebar","content":"<p>Certain DDL operations, such as designating subtypes or creating relationship classes, acquire schema locks on one or more participating datasets. If the datasets are open or being edited elsewhere, it may cause the DDL operation to fail with an error message stating that a lock could not be acquired. Before performing these operations, it may be necessary to close the datasets.<\/p>\n","image_reference":false,"layout":"standard","image_reference_figure":"","snippet":"","spotlight_name":"","section_title":"","position":"Center","spotlight_image":false},{"acf_fc_layout":"content","content":"<h2>Tokens<\/h2>\n<p>Each call to the <code>Create<\/code> method returns a <code>Token<\/code> object. These tokens are used to specify the dependencies between DDL operations. For example, the <code>Create(FeatureDatasetDescription)<\/code> routine returns a <code>FeatureDatasetToken<\/code>. Developers can use this token to create feature classes inside a feature dataset.<\/p>\n<pre><code>schemaBuilder.Create(FeatureDatasetDescription(FeatureDatasetToken), FeatureClassDescription)<\/code><\/pre>\n<p>The <code>FeatureDatasetToken<\/code> is used to create a <code>FeatureDatasetDescription<\/code>.<\/p>\n<p>Tokens can also be used to create a <code>Description<\/code> representing the dataset from the enqueued operation:<\/p>\n<pre><code>TableDescription anotherTableDescription = <span style=\"color: #0000ff\">new<\/span> TableDescription(tableToken)<\/code><\/pre>\n<p>Next, let\u2019s look at some of the key workflows using the DDL API. The following code snippets show various patterns for some common operations\u2014other patterns are also possible.<\/p>\n"},{"acf_fc_layout":"content","content":"<h1>Workspaces<\/h1>\n<p>The DDL API supports creation and deletion of the memory and local workspaces. You can create and delete memory, file, and mobile geodatabases using static methods from the <code>SchemaBuilder<\/code> class using the <code>CreateGeodatabase<\/code> and <code>DeleteGeodatabase<\/code> methods.<\/p>\n<pre><code><span style=\"color: #008000\">\/\/ Creates a file geodatabase at specified path<\/span>\r\nSchemaBuilder.CreateGeodatabase(<span style=\"color: #0000ff\">new<\/span> FileGeodatabaseConnectionPath(pathUri));\r\n<span style=\"color: #008000\">\/\/ Creates a mobile geodatabase at specified path<\/span>\r\nSchemaBuilder.CreateGeodatabase(<span style=\"color: #0000ff\">new<\/span> MobileGeodatabaseConnectionPath(pathUri));\r\n<span style=\"color: #008000\">\/\/ Creates the default memory geodatabase<\/span>\r\nSchemaBuilder.CreateGeodatabase(<span style=\"color: #0000ff\">new<\/span> MemoryConnectionProperties());\r\n\r\n<span style=\"color: #008000\">\/\/ Deletes a file geodatabase at specified path<\/span>\r\nSchemaBuilder.DeleteGeodatabase(<span style=\"color: #0000ff\">new<\/span> FileGeodatabaseConnectionPath(pathUri));\r\n<span style=\"color: #008000\">\/\/ Deletes a mobile geodatabase at specified path<\/span>\r\nSchemaBuilder.DeleteGeodatabase(<span style=\"color: #0000ff\">new<\/span> MobileGeodatabaseConnectionPath(pathUri));\r\n<span style=\"color: #008000\">\/\/ Deletes the default memory geodatabase<\/span>\r\nSchemaBuilder.DeleteGeodatabase(<span style=\"color: #0000ff\">new<\/span> MemoryConnectionProperties());\r\n<\/code><\/pre>\n"},{"acf_fc_layout":"sidebar","content":"<p>The speed and temporary nature of <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/help\/analysis\/geoprocessing\/basics\/the-in-memory-workspace.htm\">Memory workspaces<\/a> make them ideal for workflows with intermediate processing steps. Memory workspaces can also be created directly in the Geodatabase class constructor.<\/p>\n","image_reference":false,"layout":"standard","image_reference_figure":"","snippet":"","spotlight_name":"","section_title":"","position":"Center","spotlight_image":false},{"acf_fc_layout":"content","content":"<h1>Fields<\/h1>\n<p>The <code>FieldDescription<\/code> class in the DDL API allows developer to specify the schema of attribute fields, with support for a range of field types, including ObjectID and GlobalID fields, as well as features including domains and default values.<\/p>\n<pre><code><span style=\"color: #008000\">\/\/ Creating a domain field named as 'PipeMaterials' for materials used in pipes<\/span>\r\nFieldDescription pipeMaterialDomainField = FieldDescription.CreateDomainField(\r\n    <span style=\"color: #a31515\">\"PipeMaterials\"<\/span>, \r\n    <span style=\"color: #0000ff\">new<\/span> CodedValueDomainDescription(\r\n        <span style=\"color: #a31515\">\"MaterialType\"<\/span>, \r\n        FieldType.String, \r\n        <span style=\"color: #0000ff\">new<\/span> SortedList&lt;<span style=\"color: #2b91af\">object<\/span>, <span style=\"color: #2b91af\">string<\/span>&gt;(){{<span style=\"color: #a31515\">\"Cu\"<\/span>,<span style=\"color: #a31515\">\"Copper\"<\/span>}, {<span style=\"color: #a31515\">\"Fe\"<\/span>,<span style=\"color: #a31515\">\"Iron\"<\/span>}}\r\n    )\r\n);\r\n\r\n\r\n<span style=\"color: #008000\">\/\/ Creating a double field named as 'PipeLength' with default value of 1.5<\/span>\r\nFieldDescription pipeLength = <span style=\"color: #0000ff\">new<\/span> FieldDescription(<span style=\"color: #a31515\">\"PipeLength\"<\/span>, FieldType.Double);\r\npipeLength.SetDefaultValue(1.5);\r\n<\/code><\/pre>\n<p>To create a domain using the DDL API, see the Domains section.<\/p>\n"},{"acf_fc_layout":"content","content":"<h1>Table, feature class, and feature dataset<\/h1>\n<p>The <code>TableDescription<\/code>, <code>FeatureClassDescription<\/code>, and <code>AnnotationFeatureClassDescription<\/code> classes are used to create a standalone table, feature class, or an annotation feature class respectively with the DDL API.<\/p>\n<p>Certain parameters are required in each constructor when creating these descriptions without a prior schema object such as a <code>Token<\/code> or <code>Description<\/code>. The <code>TableDescription<\/code> class requires the table\u2019s name and a set of attribute fields to create a standalone table. Similarly, constructing the <code>FeatureClassDescription<\/code> object requires the feature class\u2019s name, a set of attribute fields, and the shape information of a feature class. In addition to the information required for a feature class, constructing the <code>AnnotationFeatureClassDescription<\/code> object requires the labels and their placement information.<\/p>\n<p>These datasets can also be created inside a feature dataset if feature dataset information is provided.<\/p>\n<h2>Create a table and feature class<\/h2>\n<p>In this example, you will create a feature class. First, create a <code>ShapeDescription<\/code> object to specify the geometry type and spatial reference. A <code>FieldDescription<\/code> object is specified in the constructor, contained in the <code>pipeLength<\/code> variable. Other fields required for this feature class are generated by default when building the schema.<\/p>\n<pre><code><span style=\"color: #008000\">\/\/ Create feature class called Pipe<\/span>\r\nShapeDescription shapeDescription = <span style=\"color: #0000ff\">new<\/span> ShapeDescription(GeometryType.Polyline, SpatialReferenceBuilder.CreateSpatialReference(4326));\r\nFeatureClassDescription featureClassDescription = <span style=\"color: #0000ff\">new<\/span> FeatureClassDescription(\r\n    <span style=\"color: #a31515\">\"Pipe\"<\/span>, \r\n    <span style=\"color: #0000ff\">new<\/span> List&lt;FieldDescription&gt; { pipeLength }, \r\n    shapeDescription\r\n);\r\n\r\nschemaBuilder.Create(featureClassDescription);\r\n<span style=\"color: #2b91af\">bool<\/span> success = schemaBuilder.Build();<\/code><\/pre>\n"},{"acf_fc_layout":"image","image":{"ID":2081002,"id":2081002,"title":"fc-create","filename":"fc-create.png","filesize":16119,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/fc-create.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk\/fc-create","alt":"ArcGIS Pro screenshot of a Fields view of a Pipe feature class. Four fields are visible: PipeLength, OBJECTID, Shape, and Shape_Length.","author":"346082","description":"","caption":"The resulting Fields view of the new feature class.","name":"fc-create","status":"inherit","uploaded_to":2080042,"date":"2023-09-20 17:28:40","modified":"2023-09-27 18:07:28","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":587,"height":242,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/fc-create-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/fc-create.png","medium-width":464,"medium-height":191,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/fc-create.png","medium_large-width":587,"medium_large-height":242,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/fc-create.png","large-width":587,"large-height":242,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/fc-create.png","1536x1536-width":587,"1536x1536-height":242,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/fc-create.png","2048x2048-width":587,"2048x2048-height":242,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/fc-create.png","card_image-width":587,"card_image-height":242,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/fc-create.png","wide_image-width":587,"wide_image-height":242}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<h2>Modify the table and feature class<\/h2>\n<p>To obtain the schema of the existing feature class, first get a <code>FeatureClassDefinition<\/code> object (called <code>featureClassDefinition<\/code>) from the datastore. Then add a field to the <code>Description<\/code> by first creating a new <code>Description<\/code>, as the list of fields is a read-only property, and call <code>Modify()<\/code> on the description.<\/p>\n<pre><code><span style=\"color: #008000\">\/\/ Use definition to make a description object, and a field to the original feature class<\/span>\r\nFieldDescription pipeDiameter = <span style=\"color: #0000ff\">new<\/span> FieldDescription(<span style=\"color: #a31515\">\"PipeDiameter\"<\/span>, FieldType.Double);\r\nFeatureClassDescription originalDescription = <span style=\"color: #0000ff\">new<\/span> FeatureClassDescription(featureClassDefinition);\r\nFeatureClassDescription modifiedDescription = <span style=\"color: #0000ff\">new<\/span> FeatureClassDescription(\r\n    originalDescription.Name, \r\n    originalDescription.FieldDescriptions.Append(pipeDiameter), \r\n    originalDescription.ShapeDescription\r\n);\r\n\r\nschemaBuilder.Modify(modifiedDescription);\r\n<span style=\"color: #2b91af\">bool<\/span> success = schemaBuilder.Build();\r\n<\/code><\/pre>\n"},{"acf_fc_layout":"image","image":{"ID":2081012,"id":2081012,"title":"fc-modify","filename":"fc-modify.png","filesize":17889,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/fc-modify.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk\/fc-modify","alt":"ArcGIS Pro screenshot of a Fields view of the Pipe feature class. Five fields are visible: PipeLength, OBJECTID, Shape, Shape_Length, and PipeDiameter. The added field, PipeDiameter, is emphasized.","author":"346082","description":"","caption":"The resulting Fields view of the modified feature class.","name":"fc-modify","status":"inherit","uploaded_to":2080042,"date":"2023-09-20 17:32:52","modified":"2023-09-27 18:09:14","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":586,"height":272,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/fc-modify-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/fc-modify.png","medium-width":464,"medium-height":215,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/fc-modify.png","medium_large-width":586,"medium_large-height":272,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/fc-modify.png","large-width":586,"large-height":272,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/fc-modify.png","1536x1536-width":586,"1536x1536-height":272,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/fc-modify.png","2048x2048-width":586,"2048x2048-height":272,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/fc-modify.png","card_image-width":586,"card_image-height":272,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/fc-modify.png","wide_image-width":586,"wide_image-height":272}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<h2>Delete a table and feature class<\/h2>\n<p>Similar to the pattern for modifying feature classes, obtain <code>Definitions<\/code> for the feature class using the datastore, and then create a description. Then call <code>Delete()<\/code> on the descriptions.<\/p>\n<pre><code><span style=\"color: #008000\">\/\/ Use definition to make description object and delete it<\/span>\r\nFeatureClassDescription featureClassDescription = <span style=\"color: #0000ff\">new<\/span> FeatureClassDescription(featureClassDefinition);\r\nschemaBuilder.Delete(featureClassDescription);\r\n\r\n<span style=\"color: #2b91af\">bool<\/span> success = schemaBuilder.Build();\r\n<\/code><\/pre>\n"},{"acf_fc_layout":"content","content":"<h1>Domains<\/h1>\n<p>Attribute domains are rules that describes the acceptable values of a field for a given field type. They ensure data integrity by limiting the choice of values for a particular field.<\/p>\n<p>The DDL API supports creation of both types of domains\u2013Range and Coded Value. Range Domains specify a valid range of values for numeric and date attribute fields, and Coded Value Domain specify a valid set of values for any type of attribute field. Domains can also be modified or deleted using the DDL API. After creating a domain, they can be associated with fields via their <code>FieldDescription<\/code> object.<\/p>\n<h2>Create domains<\/h2>\n<p>To create domains, first create a Range Domain description as well as a Coded Value Domain description using their respective constructors. The range domain will have a minimum value of 1.1 and a maximum value of 9.5. The coded value domain will have 2 coded values representing pipe materials.<\/p>\n<pre><code><span style=\"color: #008000\">\/\/ Create a range domain description<\/span>\r\nRangeDomainDescription rangeDomainDescription = <span style=\"color: #0000ff\">new<\/span> RangeDomainDescription(<span style=\"color: #a31515\">\"PipeLengthRangeDomain\"<\/span>, FieldType.Double, 1.1, 9.5)\r\n{\r\n    Description = <span style=\"color: #a31515\">\"A new range domain\"<\/span>,\r\n};\r\n\r\n<span style=\"color: #008000\">\/\/ Create a coded value domain description<\/span>\r\nCodedValueDomainDescription codedValueDomainDescription = <span style=\"color: #0000ff\">new<\/span> CodedValueDomainDescription(\r\n    <span style=\"color: #a31515\">\"MaterialType\"<\/span>,\r\n    FieldType.String,\r\n    <span style=\"color: #0000ff\">new<\/span> SortedList&lt;<span style=\"color: #2b91af\">object<\/span>, <span style=\"color: #2b91af\">string<\/span>&gt;() { { <span style=\"color: #a31515\">\"Cu\"<\/span>, <span style=\"color: #a31515\">\"Copper\"<\/span> }, { <span style=\"color: #a31515\">\"Fe\"<\/span>, <span style=\"color: #a31515\">\"Iron\"<\/span> } }\r\n);\r\n\r\nschemaBuilder.Create(rangeDomainDescription);\r\nschemaBuilder.Create(codedValueDomainDescription);\r\n\r\n<span style=\"color: #2b91af\">bool<\/span> success = schemaBuilder.Build();\r\n<\/code><\/pre>\n"},{"acf_fc_layout":"image","image":{"ID":2081032,"id":2081032,"title":"domain-create","filename":"domain-create.png","filesize":11322,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/domain-create.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk\/domain-create","alt":"ArcGIS Pro screenshot of the Domains view of a geodatabase. Two domains are visible: MaterialType and PipeLengthRangeDomain.","author":"346082","description":"","caption":"The resulting Domains view of the geodatabase.","name":"domain-create","status":"inherit","uploaded_to":2080042,"date":"2023-09-20 17:35:49","modified":"2023-09-27 18:11:34","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":1136,"height":118,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/domain-create-213x118.png","thumbnail-width":213,"thumbnail-height":118,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/domain-create.png","medium-width":464,"medium-height":48,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/domain-create.png","medium_large-width":768,"medium_large-height":80,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/domain-create.png","large-width":1136,"large-height":118,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/domain-create.png","1536x1536-width":1136,"1536x1536-height":118,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/domain-create.png","2048x2048-width":1136,"2048x2048-height":118,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/domain-create-826x86.png","card_image-width":826,"card_image-height":86,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/domain-create.png","wide_image-width":1136,"wide_image-height":118}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<h2>Modify domains<\/h2>\n<p>Because you are modifying properties of the domains that cannot be set, you will create a modified domain description and copy some properties over from the original. The original domain was created using a constructor, which takes the <code>Domain<\/code> object itself as a parameter. The <code>Domain<\/code> object can be obtained from the geodatabase. Note that the description of the Range Domain is not copied, and thus does not appear in the modified domain.<\/p>\n<pre><code><span style=\"color: #008000\">\/\/ Modify range of the range domain<\/span>\r\nRangeDomainDescription originalRangeDomainDescription = <span style=\"color: #0000ff\">new<\/span> RangeDomainDescription(rangeDomain);\r\nRangeDomainDescription modifiedRangeDomainDescription = <span style=\"color: #0000ff\">new<\/span> RangeDomainDescription(\r\n    originalRangeDomainDescription.Name, \r\n    originalRangeDomainDescription.FieldType, \r\n    0.0, 10.0\r\n);\r\n\r\n<span style=\"color: #008000\">\/\/ Modify coded values of the coded value domain<\/span>\r\nCodedValueDomainDescription originalCodedValueDomainDescription = <span style=\"color: #0000ff\">new<\/span> CodedValueDomainDescription(codedValueDomain);\r\nSortedList&lt;<span style=\"color: #2b91af\">object<\/span>, <span style=\"color: #2b91af\">string<\/span>&gt; newCodedValuePairs = <span style=\"color: #0000ff\">new<\/span> SortedList&lt;<span style=\"color: #2b91af\">object<\/span>, <span style=\"color: #2b91af\">string<\/span>&gt;()\r\n{\r\n    { <span style=\"color: #a31515\">\"Cu\"<\/span>, <span style=\"color: #a31515\">\"Copper\"<\/span> }, { <span style=\"color: #a31515\">\"Fe\"<\/span>, <span style=\"color: #a31515\">\"Iron\"<\/span> }, { <span style=\"color: #a31515\">\"Pvc\"<\/span>, <span style=\"color: #a31515\">\"Polyvinyl Chloride\"<\/span> }\r\n};\r\nCodedValueDomainDescription modifiedCodedValueDomainDescription = <span style=\"color: #0000ff\">new<\/span> CodedValueDomainDescription(\r\n    originalCodedValueDomainDescription.Name, \r\n    originalCodedValueDomainDescription.FieldType,\r\n    newCodedValuePairs\r\n);\r\n\r\nschemaBuilder.Modify(modifiedRangeDomainDescription);\r\nschemaBuilder.Modify(modifiedCodedValueDomainDescription);\r\n<span style=\"color: #2b91af\">bool<\/span> success = schemaBuilder.Build();\r\n<\/code><\/pre>\n"},{"acf_fc_layout":"image","image":{"ID":2081052,"id":2081052,"title":"domain-modify","filename":"domain-modify.png","filesize":12909,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/domain-modify.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk\/domain-modify","alt":"Diagram with two sets of screenshots showing the configuration of a domain before and after modification. The MaterialType domain has gained a coded value, while the range values for PipeLengthRange domain have changed from 1.1\u20139.5 to 0\u201310.","author":"346082","description":"","caption":"The resulting details for each domain before and after modification.","name":"domain-modify","status":"inherit","uploaded_to":2080042,"date":"2023-09-20 17:44:15","modified":"2023-09-27 18:12:11","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":780,"height":290,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/domain-modify-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/domain-modify.png","medium-width":464,"medium-height":173,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/domain-modify.png","medium_large-width":768,"medium_large-height":286,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/domain-modify.png","large-width":780,"large-height":290,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/domain-modify.png","1536x1536-width":780,"1536x1536-height":290,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/domain-modify.png","2048x2048-width":780,"2048x2048-height":290,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/domain-modify.png","card_image-width":780,"card_image-height":290,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/domain-modify.png","wide_image-width":780,"wide_image-height":290}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<h2>Delete Domains<\/h2>\n<p>Similar to the pattern for modifying domains, obtain <code>Domain<\/code> objects for both the Range and Coded Value domain using the datastore and then create descriptions using them. Then call <code>Delete()<\/code> on the descriptions.<\/p>\n<pre><code>RangeDomainDescription rangeDomainDescription = <span style=\"color: #0000ff\">new<\/span> RangeDomainDescription(rangeDomain);\r\nCodedValueDomainDescription codedValueDomainDescription = <span style=\"color: #0000ff\">new<\/span> CodedValueDomainDescription(codedValueDomain);\r\n\r\nschemaBuilder.Delete(rangeDomainDescription);\r\nschemaBuilder.Delete(codedValueDomainDescription);\r\n<span style=\"color: #2b91af\">bool<\/span> success = schemaBuilder.Build();\r\n<\/code><\/pre>\n"},{"acf_fc_layout":"content","content":"<h1>Subtypes<\/h1>\n<p>Subtypes are used to categorize objects in a single dataset that shares the same attributes. To add subtypes, you must have a subtype field in the dataset. The subtype field must be of long or short integer data type.<\/p>\n<p>The DDL API provides patterns to assign an existing field as the subtype field and add subtype values in the dataset using the <code>SubtypeFieldDescription<\/code> class. The API also allows for modifications of the subtype list and unassigning a field as the subtype field. The class constructor takes a field name and code-name (key-value) pair of subtypes as parameters.<\/p>\n<h2>Designate a field as the subtype field<\/h2>\n<p>Suppose a field called PipeType is added to the previously created Pipe feature class. Obtain the <code>FeatureClassDefinition<\/code> object representing the table in order to modify it, and pass it into the <code>FeatureClassDescription<\/code> constructor. To set PipeType as the subtype field, create a <code>SubtypeFieldDescription<\/code> object with the field name as the first parameter of the constructor, and then call <code>Modify()<\/code>.<\/p>\n<pre><code><span style=\"color: #008000\">\/\/ Assign the PipeType field as the subtype field<\/span>\r\nFeatureClassDescription featureClassDescription = <span style=\"color: #0000ff\">new<\/span> FeatureClassDescription(featureClassDefinition);\r\nfeatureClassDescription.SubtypeFieldDescription = <span style=\"color: #0000ff\">new<\/span> SubtypeFieldDescription(\r\n    <span style=\"color: #a31515\">\"PipeType\"<\/span>, \r\n    <span style=\"color: #0000ff\">new<\/span> Dictionary&lt;<span style=\"color: #2b91af\">int<\/span>, <span style=\"color: #2b91af\">string<\/span>&gt;\r\n    {\r\n        { 0, <span style=\"color: #a31515\">\"water\"<\/span> },\r\n        { 1, <span style=\"color: #a31515\">\"sewage\"<\/span> }\r\n    }\r\n);\r\n\r\nschemaBuilder.Modify(featureClassDescription);\r\n<span style=\"color: #2b91af\">bool<\/span> success = schemaBuilder.Build();\r\n<\/code><\/pre>\n"},{"acf_fc_layout":"image","image":{"ID":2081072,"id":2081072,"title":"subtype-assign","filename":"subtype-assign.png","filesize":20351,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/subtype-assign.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk\/subtype-assign","alt":"ArcGIS Pro screenshot of a Fields view of the Pipe feature class. The PipeType field is emphasized, as it is the subtype field.","author":"346082","description":"","caption":"The resulting Fields view of the feature class is shown. Because PipeType is now the subtype field, it is bold.","name":"subtype-assign","status":"inherit","uploaded_to":2080042,"date":"2023-09-20 17:47:36","modified":"2023-09-27 18:14:07","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":597,"height":298,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/subtype-assign-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/subtype-assign.png","medium-width":464,"medium-height":232,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/subtype-assign.png","medium_large-width":597,"medium_large-height":298,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/subtype-assign.png","large-width":597,"large-height":298,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/subtype-assign.png","1536x1536-width":597,"1536x1536-height":298,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/subtype-assign.png","2048x2048-width":597,"2048x2048-height":298,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/subtype-assign.png","card_image-width":597,"card_image-height":298,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/subtype-assign.png","wide_image-width":597,"wide_image-height":298}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<h2>Modify subtypes<\/h2>\n<p>To modify the subtype, you will rely on the pattern of accessing the <code>SubtypeFieldDescription<\/code> from the properties of the feature class&#8217; <code>FeatureClassDescription<\/code>. Then call <code>Modify()<\/code>.<\/p>\n<pre><code><span style=\"color: #008000\">\/\/ Remove a subtype from the PipeType subtype field<\/span>\r\nFeatureClassDescription featureClassDescription = <span style=\"color: #0000ff\">new<\/span> FeatureClassDescription(featureClassDefinition);\r\nfeatureClassDescription.SubtypeFieldDescription.Subtypes.Remove(1);\r\n\r\nschemaBuilder.Modify(featureClassDescription);\r\n<span style=\"color: #2b91af\">bool<\/span> success = schemaBuilder.Build();\r\n<\/code><\/pre>\n"},{"acf_fc_layout":"image","image":{"ID":2081082,"id":2081082,"title":"subtype-modify","filename":"subtype-modify.png","filesize":37866,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/subtype-modify.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk\/subtype-modify","alt":"Diagram with two ArcGIS Pro screenshots, each of the subtypes view of the Pipe feature class. Before, there are two possible values for the subtype field and only one after.","author":"346082","description":"","caption":"The resulting details for each domain before and after modification.","name":"subtype-modify","status":"inherit","uploaded_to":2080042,"date":"2023-09-20 17:48:56","modified":"2023-09-27 18:14:48","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":780,"height":580,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/subtype-modify-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/subtype-modify.png","medium-width":351,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/subtype-modify.png","medium_large-width":768,"medium_large-height":571,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/subtype-modify.png","large-width":780,"large-height":580,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/subtype-modify.png","1536x1536-width":780,"1536x1536-height":580,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/subtype-modify.png","2048x2048-width":780,"2048x2048-height":580,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/subtype-modify-625x465.png","card_image-width":625,"card_image-height":465,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/subtype-modify.png","wide_image-width":780,"wide_image-height":580}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<h2>Remove subtype designation<\/h2>\n<p>To modify the subtype, you will rely on the pattern of accessing the <code>SubtypeFieldDescription<\/code> from the properties of the feature class&#8217; <code>FeatureClassDescription<\/code>. To remove the subtype, set the property to <code>null<\/code>, and then call <code>Modify()<\/code>.<\/p>\n<pre><code><span style=\"color: #008000\">\/\/ Unassign the PipeType field as the subtype field<\/span>\r\nFeatureClassDescription featureClassDescription = <span style=\"color: #0000ff\">new<\/span> FeatureClassDescription(featureClassDefinition);\r\nfeatureClassDescription.SubtypeFieldDescription = <span style=\"color: #0000ff\">null<\/span>;\r\n\r\nschemaBuilder.Modify(featureClassDescription);\r\n<span style=\"color: #2b91af\">bool<\/span> success = schemaBuilder.Build();\r\n<\/code><\/pre>\n"},{"acf_fc_layout":"content","content":"<h1>Relationship Class<\/h1>\n<p>Relationship classes define the associations between objects in one feature class or table to objects in another feature class or table. ArcGIS Pro supports one-to-one, one-to-many, and many-to-many and may have attributes about the relationship itself.<\/p>\n<p>For the DDL API, the <code>RelationshipClassDescription<\/code> class describes the relationship class between two classes as well as the origin and foreign key fields participating in the relationship.<\/p>\n<p>Attributed relationship classes can contain their own attributes for each relationship between objects in the origin and destination class and are described by the <code>AttributedRelationshipDescription<\/code> class.<\/p>\n<h2>Create a relationship class<\/h2>\n<p>To create a relationship class from scratch without prior schema, description objects for both the origin table (<code>pipeFeatureClassDescription<\/code>) and destination table (<code>inspectionDateTableDescription<\/code>) are required for the constructor. You will also pass the name of the origin primary key field and origin foreign key field, which have been already created.<\/p>\n<pre><code><span style=\"color: #008000\">\/\/ Create relationship from pipes to inspection dates<\/span>\r\nFeatureClassDescription pipeFeatureClassDescription = <span style=\"color: #0000ff\">new<\/span> FeatureClassDescription(pipeFeatureClassDefinition);\r\nTableDescription inspectionDateTableDescription = <span style=\"color: #0000ff\">new<\/span> TableDescription(inspectionDateTableDefinition);\r\n\r\nRelationshipClassDescription relationshipClassDescription = <span style=\"color: #0000ff\">new<\/span> RelationshipClassDescription(\r\n    <span style=\"color: #a31515\">\"PipeToInspectionDate\"<\/span>,\r\n    pipeFeatureClassDescription, inspectionDateTableDescription, \r\n    RelationshipCardinality.OneToMany, \r\n    <span style=\"color: #a31515\">\"PipeID\"<\/span>, <span style=\"color: #a31515\">\"InspectionID\"<\/span>\r\n);\r\n\r\nschemaBuilder.Create(relationshipClassDescription);\r\n<span style=\"color: #2b91af\">bool<\/span> success = schemaBuilder.Build();\r\n<\/code><\/pre>\n"},{"acf_fc_layout":"image","image":{"ID":2081122,"id":2081122,"title":"rc-create","filename":"rc-create.png","filesize":21071,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/rc-create.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk\/rc-create","alt":"ArcGIS Pro screenshot showing the the properties of the PipeToInspectionDate relationship class. The properties match chosen parameters in the code.","author":"346082","description":"","caption":"The properties of the resulting relationship class are shown.","name":"rc-create","status":"inherit","uploaded_to":2080042,"date":"2023-09-20 17:53:25","modified":"2023-09-27 18:16:10","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":732,"height":357,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/rc-create-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/rc-create.png","medium-width":464,"medium-height":226,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/rc-create.png","medium_large-width":732,"medium_large-height":357,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/rc-create.png","large-width":732,"large-height":357,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/rc-create.png","1536x1536-width":732,"1536x1536-height":357,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/rc-create.png","2048x2048-width":732,"2048x2048-height":357,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/rc-create.png","card_image-width":732,"card_image-height":357,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/12\/rc-create.png","wide_image-width":732,"wide_image-height":357}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<h2>Modify relationship class<\/h2>\n<p>To obtain the schema of the existing relationship class, you will first get a <code>RelationshipClassDefinition<\/code> object from the datastore. Then change the split policy property on a created <code>RelationshipClassDescription<\/code> object and call <code>Modify()<\/code> on the description.<\/p>\n<pre><code><span style=\"color: #008000\">\/\/ Modify relationship split policy<\/span>\r\nRelationshipClassDescription relationshipClassDescription = <span style=\"color: #0000ff\">new<\/span> RelationshipClassDescription(relationshipClassDefinition);\r\nrelationshipClassDescription.RelationshipSplitPolicy = RelationshipSplitPolicy.UseDefault;\r\n\r\nschemaBuilder.Modify(relationshipClassDescription);\r\n<span style=\"color: #2b91af\">bool<\/span> success = schemaBuilder.Build();\r\n<\/code><\/pre>\n<h2>Delete a relationship class<\/h2>\n<p>Similar to the pattern for modifying relationship classes, obtain the <code>RelationshipClassDefinition<\/code> object using the datastore, and then create a <code>Description<\/code> object using it. Then call <code>Delete()<\/code> on the description.<\/p>\n<pre><code><span style=\"color: #008000\">\/\/ Delete the relationship class<\/span>\r\nRelationshipClassDescription relationshipClassDescription = <span style=\"color: #0000ff\">new<\/span> RelationshipClassDescription(relationshipClassDefinition);\r\n\r\nschemaBuilder.Delete(relationshipClassDescription);\r\n<span style=\"color: #2b91af\">bool<\/span> success = schemaBuilder.Build();\r\n<\/code><\/pre>\n"},{"acf_fc_layout":"content","content":"<h1>Takeaway<\/h1>\n<p>The <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/sdk\/api-reference\/topic40795.html\">DDL API<\/a> supports developers, users, and business partners who want to create and manipulate their datasets using the ArcGIS Pro SDK. Examples of workflows include storing results of operations in new datasets, creating temporary memory datastores for nonpersistent data, or programmatically modifying geodatabase schema based on user needs.<\/p>\n<p>While geoprocessing tools and Python remain the preferred way to perform and automate large-scale schema operations, support for manipulating geodatabase schema directly in the ArcGIS Pro SDK provides you with another powerful way to extend the functionality of ArcGIS Pro. Please refer to the <a href=\"https:\/\/github.com\/Esri\/arcgis-pro-sdk\/wiki\/ProConcepts-DDL\">DDL Conceptual Document<\/a> and the geodatabase <a href=\"http:\/\/arcgis.github.io\/arcgis-pro-sdk\/content\/OMDs\/Geodatabase-Object-Model-Diagram.pdf\">Object Model Diagram<\/a> for additional details.<\/p>\n<p>&nbsp;<\/p>\n"}],"related_articles":[{"ID":72061,"post_author":"6271","post_date":"2016-06-01 11:39:30","post_date_gmt":"2016-06-01 11:39:30","post_content":"","post_title":"ArcGIS Pro SDK Development Series, Part 1:  Getting Started","post_excerpt":"","post_status":"publish","comment_status":"open","ping_status":"closed","post_password":"","post_name":"arcgis-pro-sdk-development-series-part-1-getting-started","to_ping":"","pinged":"","post_modified":"2018-03-26 21:08:54","post_modified_gmt":"2018-03-26 21:08:54","post_content_filtered":"","post_parent":0,"guid":"http:\/\/www.esri.com\/arcgis-blog\/products\/product\/uncategorized\/arcgis-pro-sdk-development-series-part-1-getting-started\/","menu_order":0,"post_type":"blog","post_mime_type":"","comment_count":"0","filter":"raw"},{"ID":72171,"post_author":"6271","post_date":"2016-06-13 10:49:52","post_date_gmt":"2016-06-13 10:49:52","post_content":"","post_title":"ArcGIS Pro SDK Development Series, Part 2:  Learning the Pro SDK","post_excerpt":"","post_status":"publish","comment_status":"open","ping_status":"closed","post_password":"","post_name":"arcgis-pro-sdk-development-series-part-2-learning-the-pro-sdk","to_ping":"","pinged":"","post_modified":"2018-03-26 21:09:03","post_modified_gmt":"2018-03-26 21:09:03","post_content_filtered":"","post_parent":0,"guid":"http:\/\/www.esri.com\/arcgis-blog\/products\/product\/uncategorized\/arcgis-pro-sdk-development-series-part-2-learning-the-pro-sdk\/","menu_order":0,"post_type":"blog","post_mime_type":"","comment_count":"0","filter":"raw"},{"ID":1622702,"post_author":"6271","post_date":"2022-06-23 13:35:08","post_date_gmt":"2022-06-23 20:35:08","post_content":"","post_title":"What\u2019s New in the ArcGIS Pro SDK 3.0","post_excerpt":"","post_status":"publish","comment_status":"open","ping_status":"closed","post_password":"","post_name":"whats-new-in-the-arcgis-pro-sdk-3-0","to_ping":"","pinged":"","post_modified":"2022-06-23 13:33:06","post_modified_gmt":"2022-06-23 20:33:06","post_content_filtered":"","post_parent":0,"guid":"https:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=1622702","menu_order":0,"post_type":"blog","post_mime_type":"","comment_count":"1","filter":"raw"}],"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/10\/DDL_card.jpg","wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/10\/DDL_wide.jpg"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Alter Geodatabase Schmea Using DDL in the ArcGIS Pro SDK for .NET.<\/title>\n<meta name=\"description\" content=\"ArcGIS Pro SDK&#039;s Data Definition Language (DDL) API allows developers to programmatically create, modify, and delete geodatabases and schema.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Get started with the Data Definition Language (DDL) API in the ArcGIS Pro SDK for .NET\" \/>\n<meta property=\"og:description\" content=\"ArcGIS Pro SDK&#039;s Data Definition Language (DDL) API allows developers to programmatically create, modify, and delete geodatabases and schema.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk\" \/>\n<meta property=\"og:site_name\" content=\"ArcGIS Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/esrigis\/\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-20T21:04:36+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@ESRI\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk\"},\"author\":{\"name\":\"Jacob Zhi\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/e291d3c0deff252eec2bad327404f3a9\"},\"headline\":\"Get started with the Data Definition Language (DDL) API in the ArcGIS Pro SDK for .NET\",\"datePublished\":\"2023-10-16T15:30:51+00:00\",\"dateModified\":\"2023-10-20T21:04:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk\"},\"wordCount\":16,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"keywords\":[\".NET\",\"ArcGIS Pro SDK\"],\"articleSection\":[\"Data Management\",\"Developers\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk\",\"name\":\"Alter Geodatabase Schmea Using DDL in the ArcGIS Pro SDK for .NET.\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\"},\"datePublished\":\"2023-10-16T15:30:51+00:00\",\"dateModified\":\"2023-10-20T21:04:36+00:00\",\"description\":\"ArcGIS Pro SDK's Data Definition Language (DDL) API allows developers to programmatically create, modify, and delete geodatabases and schema.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.esri.com\/arcgis-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Get started with the Data Definition Language (DDL) API in the ArcGIS Pro SDK for .NET\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/\",\"name\":\"ArcGIS Blog\",\"description\":\"Get insider info from Esri product teams\",\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.esri.com\/arcgis-blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\",\"name\":\"Esri\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png\",\"contentUrl\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png\",\"width\":400,\"height\":400,\"caption\":\"Esri\"},\"image\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/esrigis\/\",\"https:\/\/x.com\/ESRI\",\"https:\/\/www.linkedin.com\/company\/5311\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/e291d3c0deff252eec2bad327404f3a9\",\"name\":\"Jacob Zhi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e0c9cd7475fb15c715e848eda1317cee3649283d5753413b274c4a4e6bcc98c0?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e0c9cd7475fb15c715e848eda1317cee3649283d5753413b274c4a4e6bcc98c0?s=96&d=blank&r=g\",\"caption\":\"Jacob Zhi\"},\"description\":\"Jacob is a Student Technician in the Software Products division at Esri. He is also currently studying computer science as an undergraduate student at UCLA.\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/author\/jzhi\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Alter Geodatabase Schmea Using DDL in the ArcGIS Pro SDK for .NET.","description":"ArcGIS Pro SDK's Data Definition Language (DDL) API allows developers to programmatically create, modify, and delete geodatabases and schema.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk","og_locale":"en_US","og_type":"article","og_title":"Get started with the Data Definition Language (DDL) API in the ArcGIS Pro SDK for .NET","og_description":"ArcGIS Pro SDK's Data Definition Language (DDL) API allows developers to programmatically create, modify, and delete geodatabases and schema.","og_url":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk","og_site_name":"ArcGIS Blog","article_publisher":"https:\/\/www.facebook.com\/esrigis\/","article_modified_time":"2023-10-20T21:04:36+00:00","twitter_card":"summary_large_image","twitter_site":"@ESRI","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk#article","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk"},"author":{"name":"Jacob Zhi","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/e291d3c0deff252eec2bad327404f3a9"},"headline":"Get started with the Data Definition Language (DDL) API in the ArcGIS Pro SDK for .NET","datePublished":"2023-10-16T15:30:51+00:00","dateModified":"2023-10-20T21:04:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk"},"wordCount":16,"commentCount":0,"publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"keywords":[".NET","ArcGIS Pro SDK"],"articleSection":["Data Management","Developers"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk","url":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk","name":"Alter Geodatabase Schmea Using DDL in the ArcGIS Pro SDK for .NET.","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#website"},"datePublished":"2023-10-16T15:30:51+00:00","dateModified":"2023-10-20T21:04:36+00:00","description":"ArcGIS Pro SDK's Data Definition Language (DDL) API allows developers to programmatically create, modify, and delete geodatabases and schema.","breadcrumb":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.esri.com\/arcgis-blog\/"},{"@type":"ListItem","position":2,"name":"Get started with the Data Definition Language (DDL) API in the ArcGIS Pro SDK for .NET"}]},{"@type":"WebSite","@id":"https:\/\/www.esri.com\/arcgis-blog\/#website","url":"https:\/\/www.esri.com\/arcgis-blog\/","name":"ArcGIS Blog","description":"Get insider info from Esri product teams","publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.esri.com\/arcgis-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization","name":"Esri","url":"https:\/\/www.esri.com\/arcgis-blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png","contentUrl":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png","width":400,"height":400,"caption":"Esri"},"image":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/esrigis\/","https:\/\/x.com\/ESRI","https:\/\/www.linkedin.com\/company\/5311\/"]},{"@type":"Person","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/e291d3c0deff252eec2bad327404f3a9","name":"Jacob Zhi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e0c9cd7475fb15c715e848eda1317cee3649283d5753413b274c4a4e6bcc98c0?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e0c9cd7475fb15c715e848eda1317cee3649283d5753413b274c4a4e6bcc98c0?s=96&d=blank&r=g","caption":"Jacob Zhi"},"description":"Jacob is a Student Technician in the Software Products division at Esri. He is also currently studying computer science as an undergraduate student at UCLA.","url":"https:\/\/www.esri.com\/arcgis-blog\/author\/jzhi"}]}},"text_date":"October 16, 2023","author_name":"Multiple Authors","author_page":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro-net\/developers\/ddl-in-pro-sdk","custom_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/10\/DDL_wide.jpg","primary_product":"ArcGIS Pro SDK","tag_data":[{"term_id":23641,"name":".NET","slug":"net","term_group":0,"term_taxonomy_id":23641,"taxonomy":"post_tag","description":"","parent":0,"count":65,"filter":"raw"},{"term_id":42651,"name":"ArcGIS Pro SDK","slug":"arcgis-pro-sdk","term_group":0,"term_taxonomy_id":42651,"taxonomy":"post_tag","description":"","parent":0,"count":33,"filter":"raw"}],"category_data":[{"term_id":23851,"name":"Data Management","slug":"data-management","term_group":0,"term_taxonomy_id":23851,"taxonomy":"category","description":"","parent":0,"count":920,"filter":"raw"},{"term_id":738191,"name":"Developers","slug":"developers","term_group":0,"term_taxonomy_id":738191,"taxonomy":"category","description":"","parent":0,"count":420,"filter":"raw"}],"product_data":[{"term_id":36851,"name":"ArcGIS Pro SDK","slug":"arcgis-pro-net","term_group":0,"term_taxonomy_id":36851,"taxonomy":"product","description":"","parent":36601,"count":91,"filter":"raw"},{"term_id":36601,"name":"Developers","slug":"developers","term_group":0,"term_taxonomy_id":36601,"taxonomy":"product","description":"","parent":0,"count":761,"filter":"raw"}],"primary_product_link":"https:\/\/www.esri.com\/arcgis-blog\/?s=#&products=arcgis-pro-net","_links":{"self":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/2080042","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/users\/346082"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/comments?post=2080042"}],"version-history":[{"count":0,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/2080042\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/media?parent=2080042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/categories?post=2080042"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/tags?post=2080042"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/industry?post=2080042"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/product?post=2080042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}