With the
For addition information on working with knowledge graph services see:
- Get started with ArcGIS Knowledge Server for overview of ArcGIS Knowledge for ArcGIS Enterprise
- Hosted Knowledge Graph Service for information on managing knowledge graph services via ArcGIS Enterprise and the REST API
- Get started with ArcGIS Knowledge (ArcGIS Pro) for information on ArcGIS Knowledge in ArcGIS Pro
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.
const knowledgeGraphModule = await $arcgis.import("@arcgis/core/rest/knowledgeGraphService.js");
//define url to knowledge graph serviceconst url = "https://myHostName.domain.com/arcgis/rest/services/Hosted/myServiceName/KnowledgeGraphServer";
//fetch knowledge graphknowledgeGraphModule.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.