<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How tu use dependency graph to list everything related to item in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-tu-use-dependency-graph-to-list-everything/m-p/1612401#M11356</link>
    <description>&lt;P&gt;I'm playing around with the new &lt;A href="https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.itemgraph.html" target="_self"&gt;itemgraph&lt;/A&gt;&amp;nbsp;module trying to create a dependency graph for one service.&lt;/P&gt;&lt;P&gt;I was thinking that this function would list everything that uses this service, for example maps, dashboards, hosted views and joined layers/tables. But I don't think it works that way.&lt;/P&gt;&lt;P&gt;So let's say I create a graph for a service item that is used in a webmap:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;service = "5ce9a509a99241cb921c4c10b9743f0b"
graphService = itemgraph.create_dependency_graph(gis, [service])
for i in graphService.all_items("node"):
    print("item: "+str(i.item.title)+"; type: "+str(i.item.type)+ " (id: {})".format(i.item.id))
    print("contained_by: "+str(i.contained_by()))
    print("contains: "+str(i.contained_by()))
    print("required_by: "+str(i.required_by()))
    print("requires: "+str(i.requires()))
    print("")

# item: dev actifs; type: Feature Service (id: 5ce9a509a99241cb921c4c10b9743f0b)
# contained_by: []
# contains: []
# required_by: []
# requires: [ItemNode(id: b67713a58af646d287d4405a3fdcfd24, item: gestion_actifs_export)]
#
# item: gestion_actifs_export; type: File Geodatabase (id: b67713a58af646d287d4405a3fdcfd24)
# contained_by: [ItemNode(id: 5ce9a509a99241cb921c4c10b9743f0b, item: dev actifs)]
# contains: [ItemNode(id: 5ce9a509a99241cb921c4c10b9743f0b, item: dev actifs)]
# required_by: [ItemNode(id: 5ce9a509a99241cb921c4c10b9743f0b, item: dev actifs)]
# requires: []
#&lt;/LI-CODE&gt;&lt;P&gt;So there are 2 nodes in my graph, the first being the service itself, and the second is the FGDB from which the service was published. I thought that the webmap would be present under contained_by or required_by, which is not the case.&lt;/P&gt;&lt;P&gt;If I create instead the graph for the webmap:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;wm = "81634afe93fa4cf0b9b6c0e645ae1dba"
graphWm = itemgraph.create_dependency_graph(gis, [wm])
for i in graphWm.all_items("node"):
    print("item: "+str(i.item.title)+"; type: "+str(i.item.type)+ " (id: {})".format(i.item.id))
    print("contained_by: "+str(i.contained_by()))
    print("contains: "+str(i.contained_by()))
    print("required_by: "+str(i.required_by()))
    print("requires: "+str(i.requires()))
    print("")

# item: dev actifs; type: Web Map (id: 81634afe93fa4cf0b9b6c0e645ae1dba)
# contained_by: []
# contains: []
# required_by: []
# requires: [ItemNode(id: b67713a58af646d287d4405a3fdcfd24, item: gestion_actifs_export), ItemNode(id: 5ce9a509a99241cb921c4c10b9743f0b, item: dev actifs)]
#
# item: dev actifs; type: Feature Service (id: 5ce9a509a99241cb921c4c10b9743f0b)
# contained_by: [ItemNode(id: 81634afe93fa4cf0b9b6c0e645ae1dba, item: dev actifs)]
# contains: [ItemNode(id: 81634afe93fa4cf0b9b6c0e645ae1dba, item: dev actifs)]
# required_by: [ItemNode(id: 81634afe93fa4cf0b9b6c0e645ae1dba, item: dev actifs)]
# requires: [ItemNode(id: b67713a58af646d287d4405a3fdcfd24, item: gestion_actifs_export)]
#
# item: gestion_actifs_export; type: File Geodatabase (id: b67713a58af646d287d4405a3fdcfd24)
# contained_by: [ItemNode(id: 5ce9a509a99241cb921c4c10b9743f0b, item: dev actifs)]
# contains: [ItemNode(id: 5ce9a509a99241cb921c4c10b9743f0b, item: dev actifs)]
# required_by: [ItemNode(id: 81634afe93fa4cf0b9b6c0e645ae1dba, item: dev actifs), ItemNode(id: 5ce9a509a99241cb921c4c10b9743f0b, item: dev actifs)]
# requires: []
#&lt;/LI-CODE&gt;&lt;P&gt;There are 3 nodes in my graph, the first being the webmap itself, the second being the service included in the webmap and the third the FGDB.&lt;/P&gt;&lt;P&gt;Is this working as intended? Meaning from the webmap graph I can get the feature service, but I can't get the webmap from the feature service graph?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 07 May 2025 13:43:45 GMT</pubDate>
    <dc:creator>mikaël</dc:creator>
    <dc:date>2025-05-07T13:43:45Z</dc:date>
    <item>
      <title>How tu use dependency graph to list everything related to item</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-tu-use-dependency-graph-to-list-everything/m-p/1612401#M11356</link>
      <description>&lt;P&gt;I'm playing around with the new &lt;A href="https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.itemgraph.html" target="_self"&gt;itemgraph&lt;/A&gt;&amp;nbsp;module trying to create a dependency graph for one service.&lt;/P&gt;&lt;P&gt;I was thinking that this function would list everything that uses this service, for example maps, dashboards, hosted views and joined layers/tables. But I don't think it works that way.&lt;/P&gt;&lt;P&gt;So let's say I create a graph for a service item that is used in a webmap:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;service = "5ce9a509a99241cb921c4c10b9743f0b"
graphService = itemgraph.create_dependency_graph(gis, [service])
for i in graphService.all_items("node"):
    print("item: "+str(i.item.title)+"; type: "+str(i.item.type)+ " (id: {})".format(i.item.id))
    print("contained_by: "+str(i.contained_by()))
    print("contains: "+str(i.contained_by()))
    print("required_by: "+str(i.required_by()))
    print("requires: "+str(i.requires()))
    print("")

# item: dev actifs; type: Feature Service (id: 5ce9a509a99241cb921c4c10b9743f0b)
# contained_by: []
# contains: []
# required_by: []
# requires: [ItemNode(id: b67713a58af646d287d4405a3fdcfd24, item: gestion_actifs_export)]
#
# item: gestion_actifs_export; type: File Geodatabase (id: b67713a58af646d287d4405a3fdcfd24)
# contained_by: [ItemNode(id: 5ce9a509a99241cb921c4c10b9743f0b, item: dev actifs)]
# contains: [ItemNode(id: 5ce9a509a99241cb921c4c10b9743f0b, item: dev actifs)]
# required_by: [ItemNode(id: 5ce9a509a99241cb921c4c10b9743f0b, item: dev actifs)]
# requires: []
#&lt;/LI-CODE&gt;&lt;P&gt;So there are 2 nodes in my graph, the first being the service itself, and the second is the FGDB from which the service was published. I thought that the webmap would be present under contained_by or required_by, which is not the case.&lt;/P&gt;&lt;P&gt;If I create instead the graph for the webmap:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;wm = "81634afe93fa4cf0b9b6c0e645ae1dba"
graphWm = itemgraph.create_dependency_graph(gis, [wm])
for i in graphWm.all_items("node"):
    print("item: "+str(i.item.title)+"; type: "+str(i.item.type)+ " (id: {})".format(i.item.id))
    print("contained_by: "+str(i.contained_by()))
    print("contains: "+str(i.contained_by()))
    print("required_by: "+str(i.required_by()))
    print("requires: "+str(i.requires()))
    print("")

# item: dev actifs; type: Web Map (id: 81634afe93fa4cf0b9b6c0e645ae1dba)
# contained_by: []
# contains: []
# required_by: []
# requires: [ItemNode(id: b67713a58af646d287d4405a3fdcfd24, item: gestion_actifs_export), ItemNode(id: 5ce9a509a99241cb921c4c10b9743f0b, item: dev actifs)]
#
# item: dev actifs; type: Feature Service (id: 5ce9a509a99241cb921c4c10b9743f0b)
# contained_by: [ItemNode(id: 81634afe93fa4cf0b9b6c0e645ae1dba, item: dev actifs)]
# contains: [ItemNode(id: 81634afe93fa4cf0b9b6c0e645ae1dba, item: dev actifs)]
# required_by: [ItemNode(id: 81634afe93fa4cf0b9b6c0e645ae1dba, item: dev actifs)]
# requires: [ItemNode(id: b67713a58af646d287d4405a3fdcfd24, item: gestion_actifs_export)]
#
# item: gestion_actifs_export; type: File Geodatabase (id: b67713a58af646d287d4405a3fdcfd24)
# contained_by: [ItemNode(id: 5ce9a509a99241cb921c4c10b9743f0b, item: dev actifs)]
# contains: [ItemNode(id: 5ce9a509a99241cb921c4c10b9743f0b, item: dev actifs)]
# required_by: [ItemNode(id: 81634afe93fa4cf0b9b6c0e645ae1dba, item: dev actifs), ItemNode(id: 5ce9a509a99241cb921c4c10b9743f0b, item: dev actifs)]
# requires: []
#&lt;/LI-CODE&gt;&lt;P&gt;There are 3 nodes in my graph, the first being the webmap itself, the second being the service included in the webmap and the third the FGDB.&lt;/P&gt;&lt;P&gt;Is this working as intended? Meaning from the webmap graph I can get the feature service, but I can't get the webmap from the feature service graph?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 07 May 2025 13:43:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-tu-use-dependency-graph-to-list-everything/m-p/1612401#M11356</guid>
      <dc:creator>mikaël</dc:creator>
      <dc:date>2025-05-07T13:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: How tu use dependency graph to list everything related to item</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-tu-use-dependency-graph-to-list-everything/m-p/1638525#M11538</link>
      <description>&lt;P&gt;If you follow this sample you should be able to find reverse dependencies as you are looking to do. I have gotten it to work with some smaller organizations that I assist with administering, but have run into the "create_dependency_graph" function failing on my own organization when running it on all items. My organization has a lot of items and might have something corrupt that causes the function to fail?&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/python/latest/samples/org-wide-dependency-graph/" target="_self"&gt;Working with an Organization-Wide Dependency Graph&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2025 19:18:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-tu-use-dependency-graph-to-list-everything/m-p/1638525#M11538</guid>
      <dc:creator>ClaytonBurns2</dc:creator>
      <dc:date>2025-08-01T19:18:21Z</dc:date>
    </item>
  </channel>
</rss>

