Select to view content in your preferred language

Python Resources for ArcGIS Knowledge

689
0
01-10-2024 10:16 AM
AdamMartin
Esri Contributor
4 0 689

With knowledge graph support in the ArcGIS API for Python, and the guides and sample notebooks below, data scientists, engineers, and developers can easily:

  • Get started working with ArcGIS Knowledge graphs using the arcgis.graph module
  • Create new knowledge graphs with sample data
  • Back up existing knowledge graphs and support ArcGIS Enterprise migrations
  • Automate the data hydration of your enterprise knowledge graph

This post will be periodically updated with additional resource links related to Python. Be sure to check out other developer resources for JavaScript and Knowledge Server REST API

Starting with the Python version (2.1.0.3), the native version in the ArcGIS Pro 3.2 release, you can also use local ArcGIS Notebooks inside Pro and the ArcGIS API for Python version out of the box to create and work with Knowledge Graphs with ArcGIS Knowledge in Enterprise 11.1 or higher. You can also easily share those Pro projects with other analysts. 

These python guides will help you get started:

Sample notebooks:

Spoiler

Note to python beginners: you don't need to know any python to run these, simply replace a few ArcGIS login values in the first cells of these notebooks.

  • Create a sample knowledge graph with dataset pulled from a web API: With 'DataLoadingBees' notebook (attached below), you can pull bee observation data collected by users of the iNaturalist application. This sample data model and queries is also used in other training resources, demos, JavaScript developer resources.
    The workflow is simple:
    • Provide portal credentials (publisher or admin), a name for your graph, and the number of observations you want to get (up to 200, due to API limits).
    • Run all cells
    • Get a graph that contains observations (only those that are licensed as public domain, so all this data can be used in demos without worry), users, and species with their relationships. There is a data model for this drawn out in the notebook but it can also be easily seen when you start exploring the data. 
  • Never lose your graphs again with backups! Create a backup of an ArcGIS Knowledge graph you have created to store your data model and data. The backup will be in the format of JSON files that can read to recreate your graph or be shared for others to be able to create the same graph on a different server. Create and load knowledge graph backups

Sample notebooks with a Pro Project:

  • ArcGIS Dependencies: This sample ArcGIS Pro project can be used for quickly creating a knowledge graph, or an entity-relationship network, representing the IT infrastructure and content from one or more ArcGIS Enterprise or ArcGIS Online portals using a graph database in ArcGIS Enterprise with ArcGIS Knowledge. (See attached ArcGIS Pro 3.2 Package and README)