Create Knowledge Graph (Knowledge Graph)

Summary

Creates a knowledge graph on the active portal and configures its parameters.

Usage

  • Use this tool to create a knowledge graph in ArcGIS Enterprise. A knowledge graph allows you to create a model that simulates a real-world system in a nonspatial manner. Initially, the knowledge graph will be empty. However, using ArcGIS Pro, you can do the following:

    Learn more about ArcGIS Knowledge and creating knowledge graphs

  • The Sharing Groups parameter is only available when the Share with Organization parameter is checked and when there are groups present on the portal. Only groups present on the portal will be listed.

    Learn more about how to manage groups

  • The owner of the knowledge graph and portal administrators can always edit its data. By default, other users cannot modify the knowledge graph's data unless editing is enabled. Use the Enable editing parameter to configure several editing operation parameters. Each editing operation is described as follows.

    • Add—Editors can add entities and relationships to the knowledge graph. They can define new entity types and relationship types, and add properties. They can define the geometry of a new entity by creating the entity on a map.
    • Delete—Editors can delete features from the knowledge graph.
    • Update—Editors can update properties of entities and relationships.

  • When the Enable update parameter is checked, the Properties and geometry option of the Update Option parameter is enabled by default, allowing editors to update the properties of entities and relationships and the geometry of an entity. Specify the Properties only option to allow editors to only update properties for existing entities and relationships. They cannot modify the geometry of an existing entity when this option is used.

  • The Data Store parameter will only list NoSQL data store items that have been registered with the ArcGIS Knowledge Server site. Each NoSQL data store provides access to a supported database that can store content for one knowledge graph.

    Learn more about user-managed data stores in ArcGIS Enterprise

Parameters

LabelExplanationData Type
Knowledge Graph Service Name

The name of the knowledge graph service.

String
Summary
(Optional)

The summary description of the knowledge graph.

String
Tags
(Optional)

The keywords or terms that describe the knowledge graph.

String
Portal Folder
(Optional)

The portal folder that will contain the knowledge graph.

String
Share with Organization
(Optional)

Specifies whether the knowledge graph will be shared with all authenticated users in your organization.

  • Checked—The knowledge graph will be shared with all authenticated users in your organization.
  • Unchecked—The knowledge graph will not be shared with all authenticated users in your organization. This is the default.
Boolean
Sharing Groups
(Optional)

Specifies the groups that you are a member of that the knowledge graph will be shared with.

  • GroupThe group with which the knowledge graph will be shared.
String
Data Store
(Optional)

Specifies the data store where the knowledge graph entities and relationships will be stored.

  • Hosted graph storeThe knowledge graph entities and relationships will be created and stored in the ArcGIS Graph Data Store associated with the Enterprise portal.
String
Data Managed Type
(Optional)

Specifies how data in a NoSQL database will be managed.

  • ArcGIS managedArcGIS Knowledge will create, manage, and delete the entities and relationships stored in the NoSQL database. The data model stored in the graph store will be updated automatically when entity types and relationship types and their properties change. This option is only available if the NoSQL database is empty. This is the default.
  • User managedThe data and data model will be read-only when they are accessed by ArcGIS Knowledge. You must create, manage, and delete the entities and relationships and define the data model using their NoSQL database.
String
Unique ID
(Optional)

The property in the graph database that contains a unique string value for each entity and relationship.

String
Enable editing
(Optional)

Specifies whether editing operations will be enabled for users with sufficient privileges.

  • Checked—Editing operations will be enabled in the knowledge graph.
  • Unchecked—Editing operations will not be enabled in the knowledge graph. This is the default.
Boolean
Enable add
(Optional)

Specifies whether editors can add entities and relationships to the knowledge graph and define new entity types and relationship types.

  • Checked—Editors can add entities and relationships to the knowledge graph. They can define new entity types and relationship types, and add properties. This is the default when the Enable editing parameter is checked.
  • Unchecked—Editors cannot add entities or relationships to the knowledge graph, define new entity and relationship types, or add properties.
Boolean
Enable delete
(Optional)

Specifies whether editors can delete features in the knowledge graph.

  • Checked—Editors can delete features. This is the default when the Enable editing parameter is checked.
  • Unchecked—Editors cannot delete features.
Boolean
Enable update
(Optional)

Specifies whether editors can update the properties of entities and relationships and the geometry of an entity.

  • Checked—Editors can update the properties of entities and relationships and the geometry of an entity. This is the default when the Enable editing parameter is checked.
  • Unchecked—Editors cannot update properties of entities and relationships or the geometry of an entity.
Boolean
Update Option
(Optional)

Specifies whether the properties of entities and relationships and the geometry of an entity can be updated or only the properties of entities and relationships.

  • Properties and geometryThe properties of entities and relationships and the geometry of entities can be updated. This is the default if editing has been enabled.
  • Properties onlyOnly the properties of entities and relationships can be updated.
String
Enable search option
(Optional)

Specifies whether full-text search will be enabled for graph items using their properties.

  • Checked—Full-text search will be enabled for graph items using their properties. This is the default for a hosted graph store or ArcGIS-managed NoSQL data store.
  • Unchecked—Full-text search will not be enabled for graph items using their properties.
Boolean
Document Entity Name
(Optional)

The name of the entity type in the data model that represents documents that are referenced by the knowledge graph. The default is Document.

String
Document Relationship Name
(Optional)

The name of the relationship type in the data model that represents a relationship between an entity in the knowledge graph and a document associated with that entity. The default is HasDocument.

String
Document Properties
(Optional)

Specifies the set of properties that will be created for each document entity.

  • Text—The extracted text from a document. The default property name is text.
  • URL—The location of the document. The default property name is url.
  • Keywords—The keywords that will be used to search for the document. The default property name is keywords.
  • Name—The file name of the document. The default property name is name.
  • Content Type—The type of data contained by the referenced document. This property is stored as a Multipurpose Internet Mail Extensions (MIME) type. The default property name is contentType.
  • Title—The title of the document. The default property name is title.
  • Metadata—The metadata describing the document. The default property name is metadata.
  • File Extension—The file extension when the referenced document is a file. The default property name is fileExtension.

Value Table
Maximum Records Returned by Server
(Optional)

The number of graph items that will be returned and displayed by an openCypher query. A large number may result in slower performance. The default value is 10,000.

Long
Maximum Records Returned by Server During Search
(Optional)

The number of graph items that can be returned by a search using the indexed properties of entities and relationships. A large number may result in slower performance. The default value is 2,000.

Long

Derived Output

LabelExplanationData Type
Output Knowledge Graph

The output knowledge graph.

Workspace

arcpy.kg.CreateKnowledgeGraph(service_name, {summary}, {tags}, {portal_folder}, {share_with_org}, {sharing_groups}, {data_store}, {data_managed}, {unique_id}, {enable_editing}, {enable_add}, {enable_delete}, {enable_update}, {update_options}, {enable_search}, {document_entity_name}, {has_document_relationship_name}, {document_properties}, {max_records}, {max_records_search})
NameExplanationData Type
service_name

The name of the knowledge graph service.

String
summary
(Optional)

The summary description of the knowledge graph.

String
tags
(Optional)

The keywords or terms that describe the knowledge graph.

String
portal_folder
(Optional)

The portal folder that will contain the knowledge graph.

String
share_with_org
(Optional)

Specifies whether the knowledge graph will be shared with all authenticated users in your organization.

  • SHAREThe knowledge graph will be shared with all authenticated users in your organization.
  • NO_SHAREThe knowledge graph will not be shared with all authenticated users in your organization. This is the default.
Boolean
sharing_groups
[sharing_groups,...]
(Optional)

Specifies the groups that you are a member of that the knowledge graph will be shared with.

  • GroupThe group with which the knowledge graph will be shared.
String
data_store
(Optional)

Specifies the data store where the knowledge graph entities and relationships will be stored.

  • Hosted graph storeThe knowledge graph entities and relationships will be created and stored in the ArcGIS Graph Data Store associated with the Enterprise portal.
String
data_managed
(Optional)

Specifies how data in a NoSQL database will be managed.

  • ARCGIS_MANAGEDArcGIS Knowledge will create, manage, and delete the entities and relationships stored in the NoSQL database. The data model stored in the graph store will be updated automatically when entity types and relationship types and their properties change. This option is only available if the NoSQL database is empty. This is the default.
  • USER_MANAGEDThe data and data model will be read-only when they are accessed by ArcGIS Knowledge. You must create, manage, and delete the entities and relationships and define the data model using their NoSQL database.
String
unique_id
(Optional)

The property in the graph database that contains a unique string value for each entity and relationship.

String
enable_editing
(Optional)

Specifies whether editing operations will be enabled for users with sufficient privileges.

  • ENABLE_EDITINGEditing operations will be enabled in the knowledge graph.
  • DO_NOT_ENABLE_EDITINGEditing operations will not be enabled in the knowledge graph. This is the default.
Boolean
enable_add
(Optional)

Specifies whether editors can add entities and relationships to the knowledge graph and define new entity types and relationship types.

  • ENABLE_ADDEditors can add entities and relationships to the knowledge graph. They can define new entity types and relationship types, and add properties. This is the default when the enable_editing parameter is set to ENABLE_EDITING.
  • DO_NOT_ENABLE_ADDEditors cannot add entities or relationships to the knowledge graph, define new entity and relationship types, or add properties.
Boolean
enable_delete
(Optional)

Specifies whether editors can delete features in the knowledge graph.

  • ENABLE_DELETEEditors can delete features. This is the default when the enable_editing parameter is set to ENABLE_EDITING.
  • DO_NOT_ENABLE_DELETEEditors cannot delete features.
Boolean
enable_update
(Optional)

Specifies whether editors can update the properties of entities and relationships and the geometry of an entity.

  • ENABLE_UPDATEEditors can update the properties of entities and relationships and the geometry of an entity. This is the default when the enable_editing parameter is set to ENABLE_EDITING.
  • DO_NOT_ENABLE_UPDATEEditors cannot update properties of entities and relationships or the geometry of an entity.
Boolean
update_options
(Optional)

Specifies whether the properties of entities and relationships and the geometry of an entity can be updated or only the properties of entities and relationships.

  • PROPERTIES_AND_GEOMETRIESThe properties of entities and relationships and the geometry of entities can be updated. This is the default if editing has been enabled.
  • PROPERTIES_ONLYOnly the properties of entities and relationships can be updated.
String
enable_search
(Optional)

Specifies whether full-text search will be enabled for graph items using their properties.

  • ENABLE_SEARCHFull-text search will be enabled for graph items using their properties. This is the default for a hosted graph store or ArcGIS-managed NoSQL data store.
  • DO_NOT_ENABLE_SEARCHFull-text search will not be enabled for graph items using their properties.
Boolean
document_entity_name
(Optional)

The name of the entity type in the data model that represents documents that are referenced by the knowledge graph. The default is Document.

String
has_document_relationship_name
(Optional)

The name of the relationship type in the data model that represents a relationship between an entity in the knowledge graph and a document associated with that entity. The default is HasDocument.

String
document_properties
[document_properties,...]
(Optional)

Specifies the set of properties that will be created for each document entity.

  • Text—The extracted text from a document. The default property name is text.
  • URL—The location of the document. The default property name is url.
  • Keywords—The keywords that will be used to search for the document. The default property name is keywords.
  • Name—The file name of the document. The default property name is name.
  • Content Type—The type of data contained by the referenced document. This property is stored as a Multipurpose Internet Mail Extensions (MIME) type. The default property name is contentType.
  • Title—The title of the document. The default property name is title.
  • Metadata—The metadata describing the document. The default property name is metadata.
  • File Extension—The file extension when the referenced document is a file. The default property name is fileExtension.

Value Table
max_records
(Optional)

The number of graph items that will be returned and displayed by an openCypher query. A large number may result in slower performance. The default value is 10,000.

Long
max_records_search
(Optional)

The number of graph items that can be returned by a search using the indexed properties of entities and relationships. A large number may result in slower performance. The default value is 2,000.

Long

Derived Output

NameExplanationData Type
out_knowledge_graph_service

The output knowledge graph.

Workspace

Code sample

CreateKnowledgeGraph example (stand-alone script)

The following code sample demonstrates creating a knowledge graph service with default parameters.

# Description: Create a knowledge graph service named 'MyKnowledgeGraph'.

# Import system modules
import arcpy

# Set local variables
service_name = 'MyKnowledgeGraph'
summary = 'A new knowledge graph with editing enabled and custom document property names.'
enable_editing = True
update_options = 'Properties_only'
document_properties = '["newText", "newURL", "newKeywords", "newName", "newContentType", "newTitle", "newMetadata", "newFileExtension"]'
document_values = arcpy.ValueTable(8)
document_values.addRow(document_properties)

# Call the CreateKnowledgeGraph tool to create a knowledge graph service with a
# summary, editing enabled, updating geometry disabled, search enabled, and custom
# document property names.
arcpy.kg.CreateKnowledgeGraph(service_name, summary, tags, portal_folder, share_with_org,
                              enable_editing, update_options,
                              document_properties=document_values)

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics