|
51 | 51 | "source": [ |
52 | 52 | "## Introduction\n", |
53 | 53 | "\n", |
54 | | - "The ArcGIS API for Python allows editing of both the data and data model of the `KnowledgeGraph`. The goal of this guide is to provide information and examples of how to edit your knowledge graphs using python.\n", |
| 54 | + "The ArcGIS API for Python allows editing of both the data and data model of the [`KnowledgeGraph`](https://developers.arcgis.com/python/latest/api-reference/arcgis.graph.html#knowledgegraph). The goal of this guide is to provide information and examples of how to edit your knowledge graphs using python.\n", |
55 | 55 | "\n", |
56 | 56 | "Editing the data will allow for:\n", |
57 | 57 | "- Creating and deleting entities\n", |
|
69 | 69 | "metadata": {}, |
70 | 70 | "source": [ |
71 | 71 | "## Data Editing\n", |
72 | | - "All data editing is accomplished using [knowledge_graph.apply_edits()](https://developers.arcgis.com/python/api-reference/arcgis.graph.html#arcgis.graph.KnowledgeGraph.apply_edits)\n", |
| 72 | + "All data editing is accomplished using [`knowledge_graph.apply_edits()`](https://developers.arcgis.com/python/api-reference/arcgis.graph.html#arcgis.graph.KnowledgeGraph.apply_edits)\n", |
73 | 73 | "### Adds\n", |
74 | 74 | "\n", |
75 | 75 | "To add an entity to the knowledge graph, we define the type and properties of the entity:" |
|
193 | 193 | "source": [ |
194 | 194 | "#### Adds\n", |
195 | 195 | "\n", |
196 | | - "Adding new types involves forming the type objects and pushing them into the data model of the knowledge graph using [knowledge_graph.named_object_type_adds()](https://developers.arcgis.com/python/api-reference/arcgis.graph.html#arcgis.graph.KnowledgeGraph.named_object_type_adds). Named types (entity and relationship types) can be created in bulk or individually as needed. The following example shows creating these named types all at the same time:" |
| 196 | + "Adding new types involves forming the type objects and pushing them into the data model of the knowledge graph using [`knowledge_graph.named_object_type_adds()`](https://developers.arcgis.com/python/api-reference/arcgis.graph.html#arcgis.graph.KnowledgeGraph.named_object_type_adds). Named types (entity and relationship types) can be created in bulk or individually as needed. The following example shows creating these named types all at the same time:" |
197 | 197 | ] |
198 | 198 | }, |
199 | 199 | { |
|
226 | 226 | "source": [ |
227 | 227 | "#### Updates\n", |
228 | 228 | "\n", |
229 | | - "Updates are performed on named object types using [knowledge_graph.named_object_type_update()](https://developers.arcgis.com/python/api-reference/arcgis.graph.html#arcgis.graph.KnowledgeGraph.named_object_type_update). Updating the name of a type is not allowed." |
| 229 | + "Updates are performed on named object types using [`knowledge_graph.named_object_type_update()`](https://developers.arcgis.com/python/api-reference/arcgis.graph.html#arcgis.graph.KnowledgeGraph.named_object_type_update). Updating the name of a type is not allowed." |
230 | 230 | ] |
231 | 231 | }, |
232 | 232 | { |
|
252 | 252 | "source": [ |
253 | 253 | "#### Deletes\n", |
254 | 254 | "\n", |
255 | | - "Deleting types is as simple as passing the string name of the type to [knowledge_graph.named_object_type_delete()](https://developers.arcgis.com/python/api-reference/arcgis.graph.html#arcgis.graph.KnowledgeGraph.named_object_type_delete)" |
| 255 | + "Deleting types is as simple as passing the string name of the type to [`knowledge_graph.named_object_type_delete()`](https://developers.arcgis.com/python/api-reference/arcgis.graph.html#arcgis.graph.KnowledgeGraph.named_object_type_delete)" |
256 | 256 | ] |
257 | 257 | }, |
258 | 258 | { |
|
277 | 277 | "source": [ |
278 | 278 | "#### Adds\n", |
279 | 279 | "\n", |
280 | | - "Properties can be added to named types at any point using [knowledge_graph.graph_property_adds()](https://developers.arcgis.com/python/api-reference/arcgis.graph.html#arcgis.graph.KnowledgeGraph.graph_property_adds). Many properties can be added to a given type in a single call.\n", |
| 280 | + "Properties can be added to named types at any point using [`knowledge_graph.graph_property_adds()`](https://developers.arcgis.com/python/api-reference/arcgis.graph.html#arcgis.graph.KnowledgeGraph.graph_property_adds). Many properties can be added to a given type in a single call.\n", |
281 | 281 | "\n", |
282 | 282 | "The default type for a property is esriFieldTypeString, to define a different type use one of the [available field types](https://github.com/Esri/knowledge-pbf/blob/master/proto/esriPBuffer/EsriExtendedTypes/EsriExtendedTypes.proto):\n", |
283 | 283 | "- esriFieldTypeSmallInteger\n", |
|
323 | 323 | "source": [ |
324 | 324 | "#### Updates\n", |
325 | 325 | "\n", |
326 | | - "Information about the properties on a type can be updated using [knowledge_graph.graph_property_update()](https://developers.arcgis.com/python/api-reference/arcgis.graph.html#arcgis.graph.KnowledgeGraph.graph_property_update). Only one property of a given type can be updated in a single call." |
| 326 | + "Information about the properties on a type can be updated using [`knowledge_graph.graph_property_update()`](https://developers.arcgis.com/python/api-reference/arcgis.graph.html#arcgis.graph.KnowledgeGraph.graph_property_update). Only one property of a given type can be updated in a single call." |
327 | 327 | ] |
328 | 328 | }, |
329 | 329 | { |
|
350 | 350 | "source": [ |
351 | 351 | "#### Deletes\n", |
352 | 352 | "\n", |
353 | | - "Deleting a property is a very simple, just pass the name of the type and property to be deleted using [knowledge_graph.graph_property_delete()](https://developers.arcgis.com/python/api-reference/arcgis.graph.html#arcgis.graph.KnowledgeGraph.graph_property_delete). Only one property from any given type can be deleted in a single call. To delete multiple properties, it may be good to loop through a list of properties you plan to delete or make multiple calls consecutively." |
| 353 | + "Deleting a property is a very simple, just pass the name of the type and property to be deleted using [`knowledge_graph.graph_property_delete()`](https://developers.arcgis.com/python/api-reference/arcgis.graph.html#arcgis.graph.KnowledgeGraph.graph_property_delete). Only one property from any given type can be deleted in a single call. To delete multiple properties, it may be good to loop through a list of properties you plan to delete or make multiple calls consecutively." |
354 | 354 | ] |
355 | 355 | }, |
356 | 356 | { |
|
373 | 373 | "cell_type": "markdown", |
374 | 374 | "metadata": {}, |
375 | 375 | "source": [ |
376 | | - "Search indexes can be added to esriFieldTypeString properties to allow the contents of those properties to be searched for when using [knowledge_graph.search()](https://developers.arcgis.com/python/api-reference/arcgis.graph.html#arcgis.graph.KnowledgeGraph.search)." |
| 376 | + "`esriFieldTypeString` properties can be added to the [`SearchIndex`](https://developers.arcgis.com/python/latest/api-reference/arcgis.graph.html#searchindex) to allow the contents of those properties to be searched for when using [`knowledge_graph.search()`](https://developers.arcgis.com/python/api-reference/arcgis.graph.html#arcgis.graph.KnowledgeGraph.search)." |
377 | 377 | ] |
378 | 378 | }, |
379 | 379 | { |
|
0 commit comments