Knowledge graph data query SKILL

Updated at:

You can use natural language instructions to direct code agents, such as Qoder and CodeX, to run read-only queries on a knowledge graph. These queries include Cypher graph queries, neighbor node traversal, and hybrid keyword and semantic searches. This document describes the SKILL's features, prerequisites, usage examples, and results. An appendix provides a list of input information for reference.

Features

The knowledge graph data query SKILL lets you explore a knowledge graph with read-only operations using natural language instructions. Common operations include executing Cypher graph queries, traversing the neighbor nodes of an entity, and searching for entities by keyword or semantics. This SKILL is used for data exploration, relationship path analysis, and retrieving data for graph visualization.

Use cases:

  • Query entities in a knowledge graph by type, properties, or keywords.

  • Find the relationship path between two entities, or perform multi-hop path exploration and aggregation statistics.

  • View the neighbor nodes and relationship network of a specific entity to construct a local subgraph.

  • Use semantic search to locate relevant entities.

Note

This SKILL performs read-only queries and does not create or modify any knowledge graph data. Conclusions are based on the actual results returned by the command. Cypher graph queries are only available in spaces bound to a Neo4j graph engine. Spaces bound to a Lindorm graph engine do not support Cypher and instead use engine-agnostic methods, such as entity list queries, neighbor node traversal, and semantic search. Therefore, you must confirm which graph engine your space is bound to before running a query.

Prerequisites

  • The target knowledge graph space exists, its ontology model has been published to the graph engine, and it contains knowledge data.

  • This ID is not available through self-service. You must get it from the knowledge graph space list page in the Dataphin console.

  • You know the graph engine (Neo4j or Lindorm) that the space is bound to. The graph engine determines the available query methods.

Usage examples

You can describe your requirements to the agent in natural language. Here are some example instructions you can copy and use:

  • Query the names and industries of all company entities in the knowledge graph space.

  • Use a Cypher graph query to find which movies a specific actor has acted in.

  • Find the relationship path between two companies.

  • Find the company with the most outbound investments.

  • View the 1-hop neighbors and relationship network of a specific entity.

  • Use semantic search to find companies that manufacture new energy vehicles.

Interaction steps:

  1. The agent will first ask you to confirm the target knowledge graph space ID and the graph engine the space is bound to.

  2. For spaces bound to a Neo4j engine, you can use Cypher for flexible queries. For spaces bound to a Lindorm engine, the agent typically uses a combination of entity list queries, semantic search, and neighbor node traversal to complete the request.

  3. The agent usually locates the target entity first and then starts a neighbor node traversal from that entity to view the subgraph.

  4. When executing a Cypher graph query, the agent typically specifies a type label for the nodes and sets a limit on the number of returned results to avoid full database scans and excessively large result sets.

Results

The operation returns the following results:

  • Returned content: A Cypher graph query returns a list of nodes, a list of edges, or rows of scalar results. Neighbor node traversal returns neighbor nodes and the edges that connect them. Semantic search returns a list of entities ranked by similarity.

  • A success flag returned by the command indicates a successful operation. Query-only operations do not modify any graph data.

  • Review and validation: You can use the returned nodes, edges, and property information to verify the query results.

Note

A success message from the command line only indicates the request was accepted; the final results are those displayed in the Dataphin console.

Appendix: Input information

The following table lists the information you might need to query knowledge graph data. The agent identifies the required information from your instructions and prompts you if anything is missing. You do not need to provide items that the system generates automatically.

Parameter

Required

Description

Example

tenant ID

Conditional

Optional if already specified in your credential configuration.

1234567890123456789

Knowledge graph space ID

Yes

The ID of the target space. This ID is not available through self-service. You must get it from the knowledge graph space list page in the Dataphin console.

—

Graph engine type

Yes

The graph engine that the space is bound to. This determines the available query methods.

Neo4j

Cypher query statement

Required for Cypher queries

Available only for spaces bound to a Neo4j engine. Nodes must have a type label. Set a limit on the number of returned results.

MATCH (n:COMPANY) RETURN n.name LIMIT 10

Start entity ID and type

Required for neighbor node traversal

The entity ID and type of the traversal's starting point.

—

Traversal depth and direction

No

Optional for neighbor node traversal. The default depth is 1. The direction can be In, Out, or Both. The default is Both.

Depth: 1, Direction: Both

Search text

Required for semantic search

The natural language query text used for hybrid keyword and semantic search.

Companies that manufacture new energy vehicles