Skip to content

Commit f261458

Browse files
committed
addressed the comments
1 parent 26d684a commit f261458

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

guide/13-managing-arcgis-applications/itemgraph_and_remap_data.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,8 @@
314314
],
315315
"source": [
316316
"# conversely, we can grab a dependent item and see what items immediately contain it and need it to exist\n",
317-
"result_form = graph.get_item(\"41dd3cca32914cc7ae8fd3a727f44e17\")\n",
318-
"result_form.item"
317+
"result_flayer = graph.get_item(\"41dd3cca32914cc7ae8fd3a727f44e17\")\n",
318+
"result_flayer.item"
319319
]
320320
},
321321
{
@@ -338,7 +338,7 @@
338338
],
339339
"source": [
340340
"# contained_by() = items in the graph that immediately use/reference this feature layer item\n",
341-
"result_form.contained_by()"
341+
"result_flayer.contained_by()"
342342
]
343343
},
344344
{
@@ -362,7 +362,7 @@
362362
],
363363
"source": [
364364
"# required_by() = every item in the graph that needs this feature layer item to exist\n",
365-
"result_form.required_by()"
365+
"result_flayer.required_by()"
366366
]
367367
},
368368
{
@@ -384,9 +384,9 @@
384384
"\n",
385385
"[The documentation for this function can be found here.](https://developers.arcgis.com/python/latest/api-reference/arcgis.gis.toc.html#arcgis.gis.Item.remap_data)\n",
386386
"\n",
387-
"We've covered functionality that can identify items contained within other items- now let's take a look at functionality that can automate replacement of those items, or fix other parts of an application's structure. `remap_data()` is a powerful tool for working with your JSON-based applications in the ArcGIS system. At its core, it allows you to swap out data sources within your apps. Say you have multiple layers in a webmap you want to swap out, or a map present in a StoryMap- all you have to do is construct a replacement dictionary mapping your old item ID's to your new ones, and it will replace them, both in the draft and published versions of your app.\n",
387+
"We've covered functionality that can identify items contained within other items- now let's take a look at functionality that can automate replacement of those items, or fix other parts of an application's structure. `remap_data()` is a powerful tool for working with your JSON-based applications in the ArcGIS system. At its core, it allows you to swap out data sources within your item's JSON structure. Say you have multiple layers in a webmap you want to swap out, or a map present in a StoryMap- all you have to do is construct a replacement dictionary mapping your old item ID's to your new ones, and it will replace them, both in the draft and published versions of your app.\n",
388388
"\n",
389-
"When the `force` parameter is set to `False` (the default), some validation occurs under the hood. The function ensures that both items exist in the GIS organization, and that they're of the same type, so nothing gets messed up in the application. However, setting `Force` to `True` gives you more power, at the risk of altering the underlying structure without validation. You can use it to replace item ID's that no longer exist in the organization, change the name of something throughout the app, fix a typo, etc. It uses a regular expression to identify and replace instances of strings, so it will pick things up wherever they are in the structure.\n",
389+
"When the `force` parameter is set to `False` (the default), some validation occurs under the hood. The function ensures that both items exist in the GIS organization, and that they're of the same type, to retain a valid configuration of the application. However, setting `Force` to `True` gives you more power, at the risk of altering the underlying structure without validation. You can use it to replace item ID's that no longer exist in the organization, change the name of something throughout the app, fix a typo, etc. It uses a regular expression to identify and replace instances of strings, so it will pick things up wherever they are in the structure.\n",
390390
"\n",
391391
"Let's look at a basic example of it in action. We'll examine the JSON of an application we're working with to note the effects."
392392
]
@@ -729,7 +729,7 @@
729729
"source": [
730730
"### Putting it Together\n",
731731
"\n",
732-
"Now that we've seen how these things work, let's see how we can use them to speed up what might be an otherwise tedious workflow.\n",
732+
"Now that we've seen how these things work, let's see how we can use them to speed up what might be an otherwise time-consuming workflow.\n",
733733
"\n",
734734
"Put yourself in the shoes of an admin that has been tasked with the process of migrating items to a new portal. Before migrating, you want to ensure that all of your items (such as your complex apps) are rendering correctly and not missing any data sources, but don't want to manually click through each one and/or their drafts. How can we more efficiently find out what's missing?\n",
735735
"\n",

samples/03_org_administrators/org_wide_dependency_graph.ipynb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"With a little patience and creativity, we can create an actively-updated dependency graph that encapsulates every item in our organization. Doing so opens up all sorts of doors for us, such as:\n",
1919
"- The ability to examine the total reverse dependencies of an item (e.g., take a feature layer- we can see every app or map in our org that requires it to exist, or that will be effected by a change to it\n",
2020
"- Quick identification of all broken dependencies in our organization\n",
21-
"- Sorting of org items by complexity (most vs. least dependencies)\n",
21+
"- Sorting of items in our organization by complexity (most vs. least dependencies)\n",
2222
"\n",
2323
"In this sample, we'll provide code to create and update an organization-wide graph, glean information from our graph, and then finally include a section on how to automate this process via ArcGIS Notebooks."
2424
]
@@ -91,6 +91,8 @@
9191
"source": [
9292
"### Efficiently Analyzing the Existent Graph\n",
9393
"\n",
94+
"This workflow is predicated on preserving our graph offline in a [GML format file](https://networkx.org/documentation/stable/reference/readwrite/gml.html), which is a commonly used file type for storing graph structures. Our `write_to_file()` function generates a .gml file with both the basic graph structure and some additional metadata that informs our `load_from_file()` function how to grab a given item from a GIS organization.\n",
95+
"\n",
9496
"When loading up an existent graph based on a .gml file, it still may take some time to retrieve every single item associated with each node in the graph, especially for organizations with thousands and thousands of items. If you want to instantly analyze the items and relationships in a .gml file with thousands of records, we can call `load_to_file()` and elect to *not* retrieve each item. This still gives us the power to view all item id's and their dependencies in the org, but without the overhead of retrieving each one from a REST endpoint first. Users can simply retrieve the associated items as needed, based on the id's.\n",
9597
"\n",
9698
"We'll show a quick example of this using the existent graph, and then use a graph loaded with the items to ensure we're up-to-date with the current state of organization. We'll only print the first few for the sake of keeping this page short."
@@ -207,7 +209,7 @@
207209
"\n",
208210
"### Automation: Updating our Org-Wide Graph\n",
209211
"\n",
210-
"The items in our org might not be the same as the ones we had in it yesterday- that's why we want to update our graph periodically. We can use some attributes of the `ItemGraph` class and some networkx tricks to maintain an up-to-date record of everything in the org.\n",
212+
"The items in our org might not be the same as the ones we had in it yesterday- that's why we want to update our graph periodically. The `ItemGraph` class is an extension of [NetworkX's DiGraph class](https://networkx.org/documentation/stable/reference/classes/digraph.html), meaning we get all sorts of handy functions and ways to manipulate our graph built in. We can use some attributes of the `ItemGraph` class and some networkx tricks to maintain an up-to-date record of everything in the org.\n",
211213
"\n",
212214
"We'll start by loading up our existent graph stored in the .gml file with every `Item` attached. This may take a while to do, depending on how many items must be retrieved. We retrieve the items so that later we can verify which ones still exist and which ones have been deleted."
213215
]
@@ -1257,7 +1259,7 @@
12571259
"name": "python",
12581260
"nbconvert_exporter": "python",
12591261
"pygments_lexer": "ipython3",
1260-
"version": "3.13.2"
1262+
"version": "3.11.10"
12611263
}
12621264
},
12631265
"nbformat": 4,

0 commit comments

Comments
 (0)