Introduction to knowledge graph service

With the , you can connect to a knowledge graph service. A knowledge graph service is composed of two primary resources. The knowledge graph contains entities and relationships and their associated properties. The data model defines the schema of the knowledge graph by defining the entity types and relationship types in the graph. Through the knowledgeGraphService you can search and query the knowledge graph as well as add, update and delete entities and relationships. A knowledge graph can contain spatial and non-spatial data. Any entities with geometry can be added to a map along with their connected relationships.

For addition information on working with knowledge graph services see:

Fetch knowledge graph

The knowledgeGraphService is its own module that connects to an existing knowledge graph service on ArcGIS Enterprise. The first step is to load the knowledge graph module and fetch the knowledge graph.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require([
  "esri/rest/knowledgeGraphService"
], (knowledgeGraphModule) => {

  //define url to knowledge graph service
  const url = "https://myHostName.domain.com/arcgis/rest/services/Hosted/myServiceName/KnowledgeGraphServer";

  //fetch knowledge graph
  KnowledgeGraphModule.fetchKnowledgeGraph(url)
  .then((kg) => {

    //view the knowledge graph data model in the console
    console.log(knowledgeGraph);
  });
});

Once you have loaded a knowledge graph, use executeSearchStreaming() and executeQueryStreaming() to retrieve specific records, or executeApplyEdits() to add, update, or delete records from the graph.

Additional topics

Search and query a knowledge graph

Learn how to search and query a knowledge graph.

Edit knowledge graph data

Learn how to add, edit and remove records from a knowledge graph.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

The developer dashboard has moved

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close