Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

neo4j-data-modelsNeo4j 数据模型

Agent Skill

用于辅助数据整理、表格处理、CSV/Excel 分析、指标计算和图表准备。它适合让 Agent 清洗字段、汇总数据、发现异常、生成统计口径或把分析结果转成可读说明。使用时需要确认数据来源、字段含义和时间范围,避免把样本数据当全量事实;涉及敏感数据、导出文件或批量写回时,应先确认权限和脱敏边界。

总安装

661

周安装

27

GitHub Stars

1

下载量

214
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:neo4j-data-models(Neo4j 数据模型)
来源仓库:https://github.com/michaelkeevildown/claude-agents-skills
仓库路径:skills/neo4j-data-models
安装命令:
npx skills add https://github.com/michaelkeevildown/claude-agents-skills --skill neo4j-data-models
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/michaelkeevildown/claude-agents-skills --skill neo4j-data-models

简介

neo4j-data-models 用于辅助数据整理、表格处理、CSV/Excel 分析、指标计算和图表准备。

  • 适用于数据清洗、汇总、异常检测和统计口径生成的场景。
  • 可生成可读说明并转换分析结果,但需确认数据来源和时间范围。
  • 安装命令为 npx skills add https://github.com/michaelkeevildown/claude-agents-skills --skill neo4j-data-models。
  • 涉及敏感数据或批量写回时,应先确认权限和脱敏边界。

SKILL.md

Neo4j Data Models

When to Use

Use this skill when designing or extending a Neo4j graph data model. Covers naming conventions, node/relationship design, property management, fraud detection domain models, and modeling best practices.

Design Process

Start with specific business questions before designing the model. Follow a three-phase cycle:

  1. Conceptualize the structure (nodes, relationships, properties)
  2. Design queries that answer the business questions
  3. Validate against real data and optimize

Every node requires a unique identifier or property combination. Prioritize the model around the application's most frequent or critical queries.

Naming Conventions

Node Labels — CapitalCase

CREATE (:Person {name: "Alice"})
CREATE (:Company {name: "Neo4j"})
CREATE (:Transaction {transactionId: "TX-001"})

Relationship Types — UPPER_SNAKE_CASE

(:Person)-[:WORKS_AT]->(:Company)
(:Account)-[:PERFORM]->(:Transaction)
(:Customer)-[:HAS_EMAIL]->(:Email)

Properties — camelCase

CREATE (:Person {firstName: "Alice", lastName: "Smith", deptId: 101})
CREATE (:Transaction {transactionId: "TX-001", createdAt: datetime()})

Node Design

Keep Labels Minimal (max 4)

Additional attributes belong in properties, not labels:

// BAD: too many labels
CREATE (:Person:Employee:Developer:Manager {name: "Alice"})

// GOOD: use properties for attributes
CREATE (:Person {name: "Alice", role: "Developer", department: "Engineering"})

Eliminate Redundancy with Shared Nodes

Instead of duplicating data across nodes, create shared nodes:

// BAD: email duplicated as string property on multiple customers
CREATE (:Customer {email: "shared@example.com"})
CREATE (:Customer {email: "shared@example.com"})

// GOOD: shared Email node
CREATE (e:Email {address: "shared@example.com"})
CREATE (c1:Customer)-[:HAS_EMAIL]->(e)
CREATE (c2:Customer)-[:HAS_EMAIL]->(e)

Extract Collections into Nodes

When attributes form collections, connect them as separate nodes rather than storing arrays:

// BAD: array property
CREATE (:Customer {phones: ["+1-555-0100", "+1-555-0200"]})

// GOOD: separate nodes with relationships
CREATE (c:Customer)-[:HAS_PHONE]->(:Phone {number: "+1-555-0100"})
CREATE (c)-[:HAS_PHONE]->(:Phone {number: "+1-555-0200"})

Relationship Design

Use Specific, Descriptive Types

// BAD: generic relationship
(:Person)-[:RELATED_TO]->(:Company)

// GOOD: descriptive type
(:Person)-[:WORKS_AT]->(:Company)
(:Person)-[:FOUNDED]->(:Company)

Single Direction, Not Symmetric Pairs

// BAD: redundant symmetric relationships
(:Person)-[:KNOWS]->(:Person)
(:Person)<-[:KNOWS]-(:Person)

// GOOD: single direction, query in either direction
(:Person)-[:KNOWS]->(:Person)
// Query: MATCH (a)-[:KNOWS]-(b)  -- undirected traversal

Intermediate Nodes for Hyperedges

When a relationship involves three or more entities, introduce an intermediate node:

// Model: Alice and Bob worked on a project with specific roles
CREATE (a:Person {name: "Alice"})-[:WORKED_ON]->(w:Work {role: "Contributor"})
CREATE (w)-[:FOR_PROJECT]->(p:Project {name: "GraphDB Project"})
CREATE (b:Person {name: "Bob"})-[:WORKED_ON]->(w)

Property Management

Properties for Identification and Querying

  • Identification properties: unique keys for anchoring queries (indexed)
  • Query-support properties: simple, indexed properties for filtering and traversal
  • Decoration properties: complex data returned in results only (not indexed)

Always Create Constraints on Business Keys

CREATE CONSTRAINT customer_unique FOR (c:Customer) REQUIRE c.customerId IS UNIQUE
CREATE CONSTRAINT email_unique FOR (e:Email) REQUIRE e.address IS UNIQUE
CREATE CONSTRAINT account_unique FOR (a:Account) REQUIRE a.accountNumber IS UNIQUE

Index Frequently Queried Properties

CREATE INDEX customer_nationality FOR (c:Customer) ON (c.nationality)
CREATE INDEX transaction_date FOR (t:Transaction) ON (t.timestamp)

Data Loading Best Practices

  1. Establish constraints first — unique constraints on business keys before loading
  2. Use MERGE for nodes with unique identifiers (avoids duplicates)
  3. Batch large datasets — process in chunks of 1,000–10,000
  4. Pre-clean source data — deduplicate before loading
  5. Transform foreign keys to relationships — don't store FKs as properties
// Batch loading pattern
UNWIND $batch AS row
MERGE (c:Customer {customerId: row.customerId})
ON CREATE SET c.firstName = row.firstName, c.lastName = row.lastName
MERGE (e:Email {address: row.email})
MERGE (c)-[:HAS_EMAIL]->(e)

Standard Patterns

Linked Lists (Ordered Sequences)

// Chain events in order
CREATE (e1:Event)-[:NEXT]->(e2:Event)-[:NEXT]->(e3:Event)

// Traverse in order
MATCH (start:Event {id: $startId})-[:NEXT*]->(subsequent:Event)
RETURN subsequent

Timeline Trees

// Year -> Month -> Day hierarchy
CREATE (:Year {value: 2024})-[:HAS_MONTH]->(:Month {value: 3})-[:HAS_DAY]->(:Day {value: 15})

// Find all events on a specific day
MATCH (:Year {value: 2024})-[:HAS_MONTH]->(:Month {value: 3})-[:HAS_DAY]->(d:Day {value: 15})
MATCH (d)<-[:ON_DAY]-(event)
RETURN event

Transaction Base Model (Reference)

This is the Neo4j reference data model for banking transactions, fraud detection, and financial investigation. Use it as the canonical schema when building fraud or banking applications.

Graph Overview

Customer -[:HAS_EMAIL]-> Email
Customer -[:HAS_PHONE]-> Phone
Customer -[:HAS_ADDRESS]-> Address
Customer -[:HAS_PASSPORT]-> Passport
Customer -[:HAS_DRIVING_LICENSE]-> DrivingLicense
Customer -[:HAS_FACE]-> Face
Customer -[:HAS_NATIONALITY]-> Country
Customer -[:HAS_ACCOUNT {role, since}]-> Account
Account  -[:PERFORMS]-> Transaction -[:BENEFITS_TO]-> Account
Account  -[:IS_HOSTED]-> Country
Transaction -[:IMPLIED {totalMovements}]-> Movement
Counterparty -[:HAS_ACCOUNT {since}]-> Account
Counterparty -[:HAS_ADDRESS {since, isCurrent}]-> Address
Address  -[:LOCATED_IN]-> Country
Device   -[:USED_BY {lastUsed}]-> Customer
Session  -[:SESSION_USES_DEVICE]-> Device
Session  -[:USES_IP]-> IP
IP       -[:IS_ALLOCATED_TO {createdAt}]-> ISP
IP       -[:LOCATED_IN {createdAt}]-> Location
Location -[:LOCATED_IN]-> Country
Alert    -[:TRIGGERED]-> Case
Account  -[:SUBJECT_OF]-> Case
Customer -[:SUBJECT_OF]-> Case

Account labels: Account (required), plus Internal, External, HighRiskJurisdiction, Flagged, UnderInvestigation, Confirmed.

Node Labels and Key Properties

LabelKey PropertiesOther Properties
AccountaccountNumber (String)accountType, openedDate, closedDate, suspendedDate
CustomercustomerId (String)firstName, middleName, lastName, dateOfBirth (Date), placeOfBirth, countryOfBirth
TransactiontransactionId (String)amount (Float, always positive), currency (ISO 4217), date (DateTime), message, type
MovementmovementId (String)amount (Float), currency, date (DateTime), description, status, sequenceNumber (Integer), authorisedBy, validatedBy
CounterpartycounterpartyId (String)name, type (INDIVIDUAL/BUSINESS/GOVERNMENT/CHARITY), registrationNumber
Emailaddress (String)domain
PhonephoneNumber (String)countryCode
AddressaddressLine1 + postTown + postCode (composite)addressLine2, region, latitude, longitude
PassportpassportNumber (String)issueDate, expiryDate, issuingCountry, nationality
DrivingLicenselicenseNumber + issuingCountry (composite)issueDate, expiryDate
FacefaceId (String)embedding (List<Float>, 512–1536 dims)
DevicedeviceId (String)deviceType, userAgent
SessionsessionId (String)status
IPipAddress (String)
ISPname (String)
Locationcity + postCode + countrylatitude, longitude
Countrycode (ISO 3166-1 alpha-2)name
AlertalertId (String)ruleName, ruleId, severity (LOW/MEDIUM/HIGH/CRITICAL), triggeredAt
CasecaseId (String)status, outcome, financialStakes (Float), investigatedBy, closedAt

All nodes with timestamps use createdAt (DateTime) for record creation.

Relationship Types

RelationshipDirectionProperties
:HAS_ACCOUNTCustomer→Accountrole, since
:HAS_ACCOUNTCounterparty→Accountsince
:HAS_EMAILCustomer→Emailsince
:HAS_PHONECustomer→Phonesince
:HAS_ADDRESSCustomer→AddressaddedAt, lastChangedAt, isCurrent
:HAS_ADDRESSCounterparty→Addresssince, isCurrent
:HAS_PASSPORTCustomer→PassportverificationDate, verificationMethod, verificationStatus
:HAS_DRIVING_LICENSECustomer→DrivingLicenseverificationDate, verificationMethod, verificationStatus
:HAS_FACECustomer→FaceverificationDate, verificationMethod, verificationStatus
:HAS_NATIONALITYCustomer→Country
:PERFORMSAccount→Transaction
:BENEFITS_TOTransaction→Account
:IMPLIEDTransaction→MovementtotalMovements
:IS_HOSTEDAccount→Country
:SESSION_USES_DEVICESession→Device
:USES_IPSession→IP
:USED_BYDevice→CustomerlastUsed
:IS_ALLOCATED_TOIP→ISPcreatedAt
:LOCATED_INAddress/IP/Location→Country/LocationcreatedAt (on IP→Location)
:SUBJECT_OFAccount/Customer→Case
:TRIGGEREDAlert→Case

Constraints and Indexes

// Node key constraints (unique business identifiers)
CREATE CONSTRAINT customer_id IF NOT EXISTS
  FOR (c:Customer) REQUIRE c.customerId IS NODE KEY;
CREATE CONSTRAINT account_number IF NOT EXISTS
  FOR (a:Account) REQUIRE a.accountNumber IS NODE KEY;
CREATE CONSTRAINT transaction_id IF NOT EXISTS
  FOR (t:Transaction) REQUIRE t.transactionId IS NODE KEY;
CREATE CONSTRAINT movement_id IF NOT EXISTS
  FOR (m:Movement) REQUIRE m.movementId IS NODE KEY;
CREATE CONSTRAINT email_address IF NOT EXISTS
  FOR (e:Email) REQUIRE e.address IS NODE KEY;
CREATE CONSTRAINT phone_number IF NOT EXISTS
  FOR (p:Phone) REQUIRE p.number IS NODE KEY;
CREATE CONSTRAINT passport_number IF NOT EXISTS
  FOR (p:Passport) REQUIRE (p.passportNumber, p.issuingCountry) IS NODE KEY;
CREATE CONSTRAINT driving_licence_number IF NOT EXISTS
  FOR (d:DrivingLicense) REQUIRE (d.licenseNumber, d.issuingCountry) IS NODE KEY;
CREATE CONSTRAINT device_id IF NOT EXISTS
  FOR (d:Device) REQUIRE d.deviceId IS NODE KEY;
CREATE CONSTRAINT ip_address IF NOT EXISTS
  FOR (i:IP) REQUIRE i.ipAddress IS NODE KEY;
CREATE CONSTRAINT session_id IF NOT EXISTS
  FOR (s:Session) REQUIRE s.sessionId IS NODE KEY;
CREATE CONSTRAINT face_id IF NOT EXISTS
  FOR (f:Face) REQUIRE f.faceId IS NODE KEY;
CREATE CONSTRAINT counterparty_id IF NOT EXISTS
  FOR (cp:Counterparty) REQUIRE cp.counterpartyId IS NODE KEY;
CREATE CONSTRAINT isp_name IF NOT EXISTS
  FOR (i:ISP) REQUIRE i.name IS NODE KEY;
CREATE CONSTRAINT country_code IF NOT EXISTS
  FOR (c:Country) REQUIRE c.code IS NODE KEY;
CREATE CONSTRAINT address_composite IF NOT EXISTS
  FOR (a:Address) REQUIRE (a.addressLine1, a.postTown, a.postCode) IS NODE KEY;
CREATE CONSTRAINT alert_id IF NOT EXISTS
  FOR (a:Alert) REQUIRE a.alertId IS NODE KEY;
CREATE CONSTRAINT case_id IF NOT EXISTS
  FOR (c:Case) REQUIRE c.caseId IS NODE KEY;

// Performance indexes
CREATE INDEX transaction_date_idx IF NOT EXISTS FOR (t:Transaction) ON (t.date);
CREATE INDEX transaction_amount_idx IF NOT EXISTS FOR (t:Transaction) ON (t.amount);

// Vector index for facial recognition
CALL db.index.vector.createNodeIndex(
  'face_embedding_idx', 'Face', 'embedding', 1536, 'cosine'
);

// Full-text index for customer name search
CREATE FULLTEXT INDEX customer_name_idx IF NOT EXISTS
  FOR (c:Customer) ON EACH [c.firstName, c.lastName, c.middleName];

Key Design Decisions

  • PII as separate nodes (Email, Phone, Address, Passport, DrivingLicense, Face) — enables shared-identity detection via graph traversal
  • Transaction as a node (not a relationship) — allows attaching amount, currency, timestamp, and linking to Movements
  • Movement sub-transactions — Transaction :IMPLIED Movement captures multi-part payments (installments, fees)
  • Account multi-labelsInternal, External, HighRiskJurisdiction enable label-based filtering without property checks
  • Verification on relationships:HAS_PASSPORT, :HAS_DRIVING_LICENSE, :HAS_FACE carry verificationDate/Method/Status so the same document can have different verification states per customer
  • Session → Device → Customer chain — connects digital activity to identity for device fingerprinting and session analysis
  • IP → ISP + Location — enriches network data for geographic anomaly detection
  • Alert → Case pipeline — separates automated detection (Alert) from human investigation (Case) with :TRIGGERED and :SUBJECT_OF

Fraud Investigation Pattern

// Flag an account and open a case
MATCH (a:Account {accountNumber: $accNum})
SET a:Flagged

CREATE (alert:Alert {
  alertId: $alertId,
  ruleName: $ruleName,
  severity: 'HIGH',
  triggeredAt: datetime()
})
CREATE (case:Case {
  caseId: $caseId,
  status: 'OPEN',
  createdAt: datetime()
})
CREATE (alert)-[:TRIGGERED]->(case)
CREATE (a)-[:SUBJECT_OF]->(case)

// Link customer to the same case
MATCH (c:Customer)-[:HAS_ACCOUNT]->(a:Account)-[:SUBJECT_OF]->(case:Case {caseId: $caseId})
CREATE (c)-[:SUBJECT_OF]->(case)

Query Performance

  • Anchor on indexed properties — start MATCH from a constrained, indexed node
  • Use specific relationship types[:PERFORMS] not [*]
  • PROFILE queries to verify index usage and eliminate CartesianProduct operators
  • Pre-aggregate statistics for frequently accessed counts/sums
  • Use label filteringMATCH (a:Account:HighRiskJurisdiction) is faster than WHERE a.jurisdiction = 'high-risk'

Anti-Patterns

1. Modeling Everything as Properties

// BAD: can't traverse to find shared attributes
CREATE (:Customer {email: "a@b.com", phone: "555-0100"})

// GOOD: nodes enable graph queries
CREATE (:Customer)-[:HAS_EMAIL]->(:Email {address: "a@b.com"})

2. Generic Relationship Types

// BAD: loses semantic meaning
(:Customer)-[:CONNECTED_TO]->(:Account)

// GOOD: specific and queryable
(:Customer)-[:HAS_ACCOUNT]->(:Account)

3. Symmetric Relationships

Don't create both directions — Cypher can traverse relationships regardless of direction.

4. Missing Unique Constraints

Always create constraints on business keys before loading data. Without them, MERGE creates duplicates.

5. Storing Foreign Keys as Properties

// BAD: relational thinking
CREATE (:Order {customerId: "C001", productId: "P001"})

// GOOD: graph thinking
CREATE (:Customer {customerId: "C001"})-[:PLACED]->(:Order)-[:CONTAINS]->(:Product {productId: "P001"})

6. Unbounded Fanout Without Grouping

If a node has 100,000+ relationships of the same type, consider intermediate grouping nodes (e.g., group by time period or category).

Validation Checklist

  • Model addresses all business questions
  • Every node has a unique identifier
  • Relationship types are specific and meaningful
  • No symmetric relationship pairs
  • Unique constraints exist on business keys
  • Critical query paths are indexed
  • Model validated with representative data volume
  • Naming conventions are consistent (CapitalCase labels, UPPER_SNAKE_CASE rels, camelCase props)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.09%
按下载量换算77

Claude

27.73%
按下载量换算59

Cursor

17.15%
按下载量换算37

Gemini CLI

9.13%
按下载量换算20

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills