← 返回 Skills 市场
fisa712

Knowledge Graph - NL To Graph Query Translator

作者 Muhammad Asif · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
38
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install nl-to-graph-query-translator
功能描述
Translate natural language questions into Cypher or SPARQL queries for graph databases and knowledge graphs.
使用说明 (SKILL.md)

Natural Language → Cypher / SPARQL Translator

Convert natural language questions into executable graph queries.

This skill translates human-readable requests into graph query languages such as Cypher (Neo4j) or SPARQL (RDF), allowing developers to interact with graph databases using natural language instead of writing complex query syntax.

Quick Start

Use Cases

Use this skill when a user wants to:

  • ✅ Convert natural language questions into graph queries
  • ✅ Generate Cypher queries for property graph databases
  • ✅ Generate SPARQL queries for RDF triple stores
  • ✅ Explore graph datasets using plain English
  • ✅ Quickly prototype graph queries

Example requests:

  • "Find employees who work at Acme."
  • "Show all companies located in California."
  • "List people connected to Alice within two hops."
  • "Find products purchased by customers in London."

What This Skill Produces

The skill generates executable graph queries in supported query languages:

  • 🔗 Cypher queries (Neo4j)
  • 🔗 SPARQL queries (RDF triple stores)
  • 📝 Query explanations
  • 🎯 Query parameter templates

Translation Process

The translator follows a 5-step process to convert natural language into executable queries:

  1. Identify Entities — Detect entity names (people, organizations, locations)
  2. Identify Relationships — Extract relationship verbs (works at, located in, purchased, etc.)
  3. Determine Query Type — Classify request type (nodes, relationships, paths, counts, aggregations)
  4. Construct Query Pattern — Build graph patterns representing relationships
  5. Generate Query Syntax — Convert patterns into Cypher or SPARQL

For detailed information about each step, see Query Translation Strategy.

Supported Query Languages

Cypher

Used in Neo4j and other property graph databases.

Example:

MATCH (p:Person)-[:PURCHASED]->(product:Product)
RETURN p, product

📖 See Cypher Query Guide

SPARQL

Used in RDF triple stores and knowledge graphs.

Example:

SELECT ?person ?product
WHERE {
  ?person :purchased ?product .
}

📖 See SPARQL Query Guide

Common Patterns

Simple Entity Lookup

"Find all people named Alice"

Relationship Traversal

"Show companies where employees work"

Multi-Hop Queries

"Find people connected to Alice within two relationships"

For more patterns, see Query Patterns Reference.

Examples

Browse practical examples organized by complexity and use case:

Best Practices

When generating and executing graph queries:

✓ Use schema labels consistently
✓ Avoid overly broad relationship patterns
✓ Prefer parameterized queries for security
✓ Include LIMIT clauses for large datasets
✓ Validate query syntax before execution

See Architecture & Implementation for advanced considerations.

Advanced Topics

Related Skills


Last Updated: 2026-03-08
Maintainer: OpenClaw Community
License: See LICENSE in repository root

安全使用建议
Installers should treat generated Cypher/SPARQL as draft code: review it before execution, use read-only or least-privilege database roles when possible, parameterize user values, add LIMIT clauses for broad traversals, and avoid running CREATE/SET/DELETE examples on production data without explicit approval and backups.
能力标签
crypto
能力评估
Purpose & Capability
The artifacts match the stated purpose: translating natural-language questions into Cypher or SPARQL, with documentation, examples, and local helper scripts that generate or validate query text.
Instruction Scope
The skill produces executable query text and the Cypher reference includes create, update, and delete syntax; this is disclosed as query-language reference material, but users should review generated queries before running them.
Install Mechanism
No package dependencies, install hooks, background services, or automatic setup behavior were identified in the supplied metadata or artifacts.
Credentials
The Python scripts use local parsing and string generation only; no database connection, network call, credential loading, file scanning, or remote execution path was found.
Persistence & Privilege
No persistence mechanism, privilege escalation, session/profile access, or automatic mutation of the local environment is present.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install nl-to-graph-query-translator
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /nl-to-graph-query-translator 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of natural language to graph query translator. - Converts natural language questions into Cypher or SPARQL queries for graph databases and knowledge graphs. - Supports entity/relationship extraction, query type identification, and pattern construction. - Produces executable Cypher and SPARQL queries, explanations, and parameter templates. - Includes best practices, example queries, and reference guides for Cypher and SPARQL. - Provides links to related skills and advanced documentation.
元数据
Slug nl-to-graph-query-translator
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Knowledge Graph - NL To Graph Query Translator 是什么?

Translate natural language questions into Cypher or SPARQL queries for graph databases and knowledge graphs. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 38 次。

如何安装 Knowledge Graph - NL To Graph Query Translator?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install nl-to-graph-query-translator」即可一键安装,无需额外配置。

Knowledge Graph - NL To Graph Query Translator 是免费的吗?

是的,Knowledge Graph - NL To Graph Query Translator 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Knowledge Graph - NL To Graph Query Translator 支持哪些平台?

Knowledge Graph - NL To Graph Query Translator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Knowledge Graph - NL To Graph Query Translator?

由 Muhammad Asif(@fisa712)开发并维护,当前版本 v1.0.0。

💬 留言讨论