返回顶部
l

ladybug-opencypher

|

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
95
下载量
1
收藏
概述
安装方式
版本历史

ladybug-opencypher

# Ladybug openCypher Ladybug follows [openCypher](https://opencypher.org/) where possible. **Schema, DDL, some clauses, and MATCH semantics differ** from Neo4j. Overview: [Differences between Ladybug and Neo4j](https://docs.ladybugdb.com/cypher/difference/). DDL: [Create table](https://docs.ladybugdb.com/cypher/data-definition/create-table/). Ladybug is **embedded (in-process)** — no server URI; open a file path or **`:memory:`** via `real_ladybug`. ## Core principles 1. **Schema first** — node and relationship tables must exist before insert. One label per node/rel table; every node table needs a **primary key**. 2. **Walk vs trail** — patterns use **walk** semantics (edges may repeat). Use **`is_trail()`** / **`is_acyclic()`** when you need Neo4j-like trail checks. 3. **Variable-length paths** — require an upper bound for termination; if omitted, default upper bound is **30**. 4. **Catalog** — prefer **`CALL procedure(...)`** instead of Neo4j `SHOW …` for many introspection tasks. ## Execute from Python (quick start) Import **`real_ladybug`** (Ladybug Python bindings). Full docs: [Python API](https://docs.ladybugdb.com/client-apis/python/), [generated reference](https://api-docs.ladybugdb.com/python). ```python import real_ladybug as lb db = lb.Database("path/to/db.lbug") conn = lb.Connection(db) rows = conn.execute(""" MATCH (a:User)-[f:Follows]->(b:User) RETURN a.name, b.name, f.since; """) for row in rows: print(row) ``` - **`conn.execute` / `await conn.execute`** per statement unless the API documents batching. - **Multiple statements** (semicolon-separated) return a **list** of results; a single statement returns one result. - **`COPY` / `LOAD FROM`** paths resolve relative to the process CWD unless absolute. For async, result helpers, UDFs, and Parquet/DataFrame import — see [references/api-reference.md](references/api-reference.md). ## Schema snippet (DDL) ```cypher CREATE NODE TABLE User(name STRING PRIMARY KEY, age INT64); CREATE NODE TABLE City(name STRING PRIMARY KEY, population INT64); CREATE REL TABLE Follows(FROM User TO User, since INT64); CREATE REL TABLE LivesIn(FROM User TO City, MANY_ONE); ``` Optional **`IF NOT EXISTS`**. Multiplicity: `MANY_ONE`, `ONE_MANY`, `MANY_MANY`, `ONE_ONE`. **`CREATE NODE TABLE AS` / `CREATE REL TABLE AS`** — infer schema from `LOAD FROM` or `MATCH … RETURN`. ## Import - **`COPY NodeTable FROM "file.csv"`** (Parquet and other formats per [Import data](https://docs.ladybugdb.com/import/)). - Neo4j’s `LOAD CSV FROM` → **`LOAD FROM`** in Ladybug. - In Python: **`LOAD FROM df`** / **`COPY Table FROM df`** for Pandas/Polars/Arrow without an intermediate file. ## Full-text search (FTS) Load the FTS [extension](https://docs.ladybugdb.com/extensions/) first. Index **STRING** columns on node tables only; query with **`CALL QUERY_FTS_INDEX`**; list with **`CALL SHOW_INDEXES() RETURN *`**. Full procedure signatures: [references/api-reference.md](references/api-reference.md). ## When results differ from Neo4j Use the checklist and clause table in [references/workflow-patterns.md](references/workflow-patterns.md): walk vs trail, variable-length defaults, unsupported clauses (`FOREACH`, `REMOVE`, `FINISH`, `SET +=`, …), and **`CALL`** vs `SHOW`. ## Utility scripts Bundled helpers (optional — require `real_ladybug` on `PYTHONPATH`): - **`scripts/run_cypher.py`** — run a Cypher string or `.cypher` file against a `.lbug` path. - **`scripts/check_env.py`** — verify `import real_ladybug` and print basic info. ## Additional resources - Detailed Python API, FTS `CALL` syntax, and DDL/import tables: [references/api-reference.md](references/api-reference.md) - Debugging workflows, Neo4j comparison table, query habits: [references/workflow-patterns.md](references/workflow-patterns.md) ## Doc links - [Ladybug vs Neo4j](https://docs.ladybugdb.com/cypher/difference/) - [DDL / create table](https://docs.ladybugdb.com/cypher/data-definition/create-table/) - [Import data](https://docs.ladybugdb.com/import/) - [Full-text search](https://docs.ladybugdb.com/extensions/full-text-search/) - [MATCH](https://docs.ladybugdb.com/cypher/query-clauses/match) - [CALL / functions](https://docs.ladybugdb.com/cypher/query-clauses/call)

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 ladybug-opencypher-1776030034 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 ladybug-opencypher-1776030034 技能

通过命令行安装

skillhub install ladybug-opencypher-1776030034

下载 Zip 包

⬇ 下载 ladybug-opencypher v1.0.0

文件大小: 8.64 KB | 发布时间: 2026-4-13 10:47

v1.0.0 最新 2026-4-13 10:47
Initial release of ladybug-opencypher.

- Run openCypher queries on Ladybug DB with schema-first DDL support.
- Supports Python (sync/async) execution, CALL procedures, and full-text search extensions (FTS).
- Highlights key differences from Neo4j Cypher, including schema, DDL, and pattern semantics.
- Includes utility scripts for query execution and environment checks.
- Documentation links provided for Cypher features, DDL, import, FTS, and Neo4j migration notes.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部