arcgis-knowledge-graphs
Skill0 starsChanged 7 months agoMITView on GitHub
Work with ArcGIS Knowledge graphs for storing, querying, and visualizing connected data using KnowledgeGraphLayer, LinkChartView, and openCypher queries. Use for graph databases, relationship visualization, and entity exploration.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- geoai-latam/SKILL_JS5_ARCGIStheir own version, first seen Nov 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- geoai-latam/SKILL_JS5_ARCGIS★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository47 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/arcgis-ai-components/AGENTS.mdAGENTS.md
- skills/arcgis-authentication/AGENTS.mdAGENTS.md
- skills/arcgis-charts/AGENTS.mdAGENTS.md
- skills/arcgis-coding-components/AGENTS.mdAGENTS.md
- skills/arcgis-core-maps/AGENTS.mdAGENTS.md
- skills/arcgis-editing/AGENTS.mdAGENTS.md
- skills/arcgis-embeddable-maps/AGENTS.mdAGENTS.md
- skills/arcgis-interaction/AGENTS.mdAGENTS.md
- skills/arcgis-layers/AGENTS.mdAGENTS.md
- skills/arcgis-starter-app/AGENTS.mdAGENTS.md
- skills/arcgis-visualization/AGENTS.mdAGENTS.md
- skills/arcgis-widgets-ui/AGENTS.mdAGENTS.md
- arcgis-3d-layersSkill
- arcgis-advanced-layersSkill
- arcgis-ai-componentsSkill
- arcgis-arcadeSkill
- arcgis-authenticationSkill
- arcgis-chartsSkill
- arcgis-cim-symbolsSkill
- arcgis-coding-componentsSkill
- arcgis-coordinates-projectionSkill
- arcgis-core-mapsSkill
- arcgis-core-utilitiesSkill
- arcgis-custom-renderingSkill
- arcgis-editingSkill
- arcgis-embeddable-mapsSkill
- arcgis-feature-effectsSkill
- arcgis-geometry-operationsSkill
- arcgis-imagerySkill
- arcgis-interactionSkill
- arcgis-layersSkill
- arcgis-map-toolsSkill
- arcgis-performanceSkill
- arcgis-popup-templatesSkill
- arcgis-portal-contentSkill
- arcgis-rest-servicesSkill
- arcgis-scene-environmentSkill
- arcgis-smart-mappingSkill
- arcgis-spatial-analysisSkill
- arcgis-starter-appSkill
- arcgis-tables-formsSkill
- arcgis-time-animationSkill
- arcgis-utility-networksSkill
- arcgis-visualizationSkill
- arcgis-widgets-advancedSkill
- arcgis-widgets-uiSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill for knowledge graphs, graph queries (openCypher), link chart visualization, and entity-relationship management.
- Very specific: line 464
Streaming for large results: Use executeQueryStreaming for queries that may return many results.
- Very specific: line 470
Load before querying: Ensure await kgLayer.load() before accessing sublayers or metadata.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ArcGIS Knowledge Graphs
Use this skill for knowledge graphs, graph queries (openCypher), link chart visualization, and entity-relationship management.
Import Patterns
ESM (npm)
// Knowledge graph service
import * as knowledgeGraphService from "@arcgis/core/rest/knowledgeGraphService.js";
// Layers
import KnowledgeGraphLayer from "@arcgis/core/layers/KnowledgeGraphLayer.js";
import LinkChartLayer from "@arcgis/core/layers/LinkChartLayer.js";
// Views and charts
import WebLinkChart from "@arcgis/core/WebLinkChart.js";
import LinkChartView from "@arcgis/core/views/LinkChartView.js";
// Layout settings
import OrganicLayoutSettings from "@arcgis/core/linkChart/OrganicLayoutSettings.js";
import ChronologicalLayoutSettings from "@arcgis/core/linkChart/ChronologicalLayoutSettings.js";
import LinkChartLayoutSwitcher from "@arcgis/core/linkChart/LinkChartLayoutSwitcher.js";CDN (dynamic import)
const knowledgeGraphService = await $arcgis.import(
"@arcgis/core/rest/knowledgeGraphService.js",
);
const KnowledgeGraphLayer = await $arcgis.import(
"@arcgis/core/layers/KnowledgeGraphLayer.js",
);
const WebLinkChart = await $arcgis.import("@arcgis/core/WebLinkChart.js");
const LinkChartView = await $arcgis.import(
"@arcgis/core/views/LinkChartView.js",
);Knowledge Graph Service
Fetch Knowledge Graph
const url =
"https://your-server/server/rest/services/Hosted/YourKG/KnowledgeGraphServer";
const knowledgeGraph = await knowledgeGraphService.fetchKnowledgeGraph(url);
console.log("Graph name:", knowledgeGraph.name);
console.log("Entity types:", knowledgeGraph.dataModel.entityTypes);
console.log("Relationship types:", knowledgeGraph.dataModel.relationshipTypes);Service Functions
| Function | Description |
fetchKnowledgeGraph(url) | Fetch knowledge graph metadata and data model |
executeQuery(kg, params) | Execute openCypher query, return all results |
executeQueryStreaming(kg, params) | Stream large query results |
executeSearch(kg, params) | Full-text search across entities |
executeApplyEdits(kg, params) | Add, update, or delete entities and relationships |
KnowledgeGraphLayer
Add to Map
const kgLayer = new KnowledgeGraphLayer({
url: "https://your-server/server/rest/services/Hosted/YourKG/KnowledgeGraphServer",
});
await kgLayer.load();
map.add(kgLayer);Configure Sublayers
const kgLayer = new KnowledgeGraphLayer({
url: "...",
inclusionModeDefinition: {
generateAllSublayers: false,
namedTypeDefinitions: new Map([
["Person", { useAllData: true }],
["Location", { useAllData: true }],
]),
},
});Querying with openCypher
Basic Query
const result = await knowledgeGraphService.executeQuery(knowledgeGraph, {
openCypherQuery: "MATCH (n:Person) RETURN n LIMIT 10",
});
console.log("Results:", result.resultRows);Streaming Query (Large Results)
const queryResults = await knowledgeGraphService.executeQueryStreaming(
knowledgeGraph,
{
openCypherQuery: "MATCH (n:Person)-[r]->(m) RETURN n, r, m",
},
);
const reader = queryResults.resultRowsStream.getReader();
while (true) {
const { done, value } = await reader.read();
if (done) break;
value.forEach((row) => {
console.log("Row:", row);
});
}Spatial Query with Bind Parameters
import Polygon from "@arcgis/core/geometry/Polygon.js";
const searchArea = new Polygon({
rings: [
[
[-76, 45],
[-70, 45],
[-70, 40],
[-76, 40],
[-76, 45],
],
],
});
const queryResults = await knowledgeGraphService.executeQueryStreaming(
knowledgeGraph,
{
openCypherQuery: `
MATCH path=(a:User)-[]->(b:Observation)
WHERE esri.graph.ST_Intersects($geometry, b.shape)
RETURN path
`,
bindParameters: {
geometry: searchArea,
},
},
);Query with Filters
// Filter by property
const result = await knowledgeGraphService.executeQuery(knowledgeGraph, {
openCypherQuery: `
MATCH (p:Person)
WHERE p.age > 30 AND p.name CONTAINS 'John'
RETURN p
`,
});
// Query relationships
const result = await knowledgeGraphService.executeQuery(knowledgeGraph, {
openCypherQuery: `
MATCH (p:Person)-[r:WORKS_AT]->(c:Company)
WHERE c.name = 'Esri'
RETURN p.name, r.startDate, c.name
`,
});Common openCypher Patterns
-- Find all entities of a type
MATCH (p:Person) RETURN p
-- Find relationships
MATCH (a)-[r]->(b) RETURN a, r, b
-- Find path with depth
MATCH path = (a:Person)-[:KNOWS*1..3]->(b:Person)
WHERE a.name = 'John'
RETURN path
-- Aggregate
MATCH (p:Person)-[:WORKS_AT]->(c:Company)
RETURN c.name, COUNT(p) as employeeCount
-- Spatial filter
MATCH (loc:Location)
WHERE esri.graph.ST_Intersects($geometry, loc.shape)
RETURN locSearch Knowledge Graph
const searchResults = await knowledgeGraphService.executeSearch(
knowledgeGraph,
{
searchQuery: "John Smith",
typeCategoryFilter: "entity", // "entity", "relationship", "both"
typeNames: ["Person", "Employee"],
returnSearchContext: true,
},
);
searchResults.results.forEach((result) => {
console.log("Found:", result.typeName, result.id);
console.log("Context:", result.searchContext);
});Apply Edits
// Add entity
await knowledgeGraphService.executeApplyEdits(knowledgeGraph, {
entityAdds: [
{
typeName: "Person",
properties: { name: "Jane Doe", age: 28 },
},
],
});
// Update entity
await knowledgeGraphService.executeApplyEdits(knowledgeGraph, {
entityUpdates: [
{
typeName: "Person",
properties: { globalId: "{existing-global-id}", age: 29 },
},
],
});
// Delete entity
await knowledgeGraphService.executeApplyEdits(knowledgeGraph, {
entityDeletes: [
{
typeName: "Person",
ids: ["{global-id-to-delete}"],
},
],
});
// Add relationship
await knowledgeGraphService.executeApplyEdits(knowledgeGraph, {
relationshipAdds: [
{
typeName: "WORKS_AT",
properties: {
originGlobalId: "{person-global-id}",
destinationGlobalId: "{company-global-id}",
startDate: new Date(),
},
},
],
});Data Model
const dataModel = knowledgeGraph.dataModel;
dataModel.entityTypes.forEach((entityType) => {
console.log("Entity:", entityType.name);
console.log("Properties:", entityType.properties);
});
dataModel.relationshipTypes.forEach((relType) => {
console.log("Relationship:", relType.name);
console.log("Origin:", relType.originEntityTypes);
console.log("Destination:", relType.destinationEntityTypes);
});Link Chart Visualization
Create Link Chart (Core API)
const linkChartLayer = new LinkChartLayer({
url: "https://your-server/.../KnowledgeGraphServer",
});
const linkChart = new WebLinkChart({
layers: [linkChartLayer],
});
const linkChartView = new LinkChartView({
container: "linkChartDiv",
map: linkChart,
highlightOptions: {
color: [0, 255, 255, 1],
haloColor: [0, 255, 255, 0.5],
haloOpacity: 0.8,
},
});Link Chart Component
<arcgis-link-chart>
<arcgis-legend slot="top-right"></arcgis-legend>
<arcgis-zoom slot="bottom-right"></arcgis-zoom>
</arcgis-link-chart>
<script type="module">
const linkChartComponent = document.querySelector("arcgis-link-chart");
await linkChartComponent.componentOnReady();
const lcView = linkChartComponent.view;
const linkChart = lcView.map;
await linkChart.addRecords([
{ id: "entity1", typeName: "Person" },
{ id: "entity2", typeName: "Company" },
]);
</script>Adding and Removing Records
// Add records
await linkChart.addRecords([
{ id: "person-1", typeName: "Person" },
{ id: "company-1", typeName: "Company" },
{ id: "rel-1", typeName: "WORKS_AT" },
]);
// Remove records
await linkChart.removeRecords([{ id: "person-1", typeName: "Person" }]);Expand Entities
await linkChart.expand({
ids: ["entity-id"],
typeName: "Person",
relationshipTypes: ["KNOWS", "WORKS_AT"],
direction: "both", // "outgoing", "incoming", "both"
});Navigate to Entities
linkChartView.goTo([{ id: "person-1", typeName: "Person" }]);Link Chart Events
linkChartView.on("click", async (event) => {
const response = await linkChartView.hitTest(event);
if (response.results.length > 0) {
const graphic = response.results[0].graphic;
console.log("Clicked:", graphic.attributes);
}
});Update Link Chart from Query Results
async function updateLinkChart(queryResults, linkChart) {
const reader = queryResults.resultRowsStream.getReader();
while (true) {
const { done, value } = await reader.read();
if (done) break;
const records = [];
for (const row of value) {
for (const record of row[0].path) {
records.push({
id: record.id,
typeName: record.typeName,
});
}
}
await linkChart.addRecords(records);
}
}Layout Settings
Organic Layout
const organicLayout = new OrganicLayoutSettings();
linkChart.layoutSettings = organicLayout;Chronological Layout
const chronoLayout = new ChronologicalLayoutSettings();
linkChart.layoutSettings = chronoLayout;Layout Switcher Widget
const layoutSwitcher = new LinkChartLayoutSwitcher({
view: linkChartView,
});
linkChartView.ui.add(layoutSwitcher, "top-right");Layout Switcher Component
<arcgis-link-chart>
<arcgis-link-chart-layout-switcher
slot="top-right"
></arcgis-link-chart-layout-switcher>
</arcgis-link-chart>WebLinkChart Properties
const webLinkChart = new WebLinkChart({
portalItem: { id: "LINKCHART_ID" },
layoutSettings: organicLayout,
});
// Save to portal
await webLinkChart.saveAs({
title: "My Link Chart",
snippet: "Visualization of entity relationships",
});Common Pitfalls
- Authentication required: Knowledge graph services typically require authentication — configure credentials or OAuth.
- Streaming for large results: Use
executeQueryStreamingfor queries that may return many results;executeQueryloads everything into memory. - Geometry conversion: Convert geometries to WGS84 before using in spatial queries with
esri.graph.ST_Intersects. - Case sensitivity: openCypher property names are case-sensitive —
p.Nameandp.nameare different. - Load before querying: Ensure
await kgLayer.load()before accessing sublayers or metadata. - Link chart records: Both entities and relationships must be added as records for links to display.
Reference Samples
knowledgegraph-query— Querying knowledge graphs with openCypherknowledgegraph-knowledgegraphlayer— Using KnowledgeGraphLayerknowledgegraph-search— Full-text searchknowledgegraph-applyedits— Editing graph entitiesknowledgegraph-datamodelediting— Data model editinglinkchart— Link chart visualization
Related Skills
arcgis-layers— Layer configuration and managementarcgis-interaction— Hit testing and event handlingarcgis-editing— Feature editing patterns
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

