EndNote到Neo4J集成工具

将EndNote参考文献库转换为可查询的Neo4J知识图谱,支持自动假设链接和无限制的研究查询能力。

  • by SaptaDey
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 SaptaDey/endnote-neo4j-integration

使用说明

Neo4J直接集成的尾注🔬📊

将您的EndNote参考库转换为功能强大、可查询的Neo4J知识图,具有自动假设链接和无限的研究功能。

🎯 为什么存在

通过MCP(模型上下文协议)服务器的传统EndNote访问是 脆弱、有限、缓慢该工具提供了一种强大的替代方案:

  • ⚡ 速度提高50至100倍 查询(毫秒vs秒)
  • 🔒 100%可靠 -无需重启、无需备份、无故障
  • 🚀 无限查询能力 -完整的Cypher语言与有限的工具API
  • 🧬 知识图集成 -自动假设链接
  • 📚 零制造风险 -所有引用均已从您的EndNote库中验证
  • 💾 永久存储 -引用在Neo4J中持续存在

✨ 特性

核心能力

  • 📖 直接访问SQLite:无需中介即可读取EndNote.enl文件
  • 🗄️ Neo4j集成:作为可查询证据节点的永久存储
  • 🔗 自动链接:创建引用→基于关键字的假设关系
  • 🏷️ 智能分类:按研究区域自动标记(可定制)
  • 📝 引文生成:温哥华式引文,含PMID/DOI提取
  • 🔍 元数据抽取:作者、摘要、关键字、完整的书目数据

高性能

  • 🧮 图形分析:利用Neo4j的图形算法
  • 🌐 跨学科发现:查找跨多个领域的论文
  • 📊 时间分析:跟踪出版趋势和研究进展
  • 🎯 证据映射:自动将文献与研究假设联系起来
  • 🔬 知识差距检测:识别不受支持的假设
  • 📈 作者网络:分析合著模式

🏗️ 建筑

graph LR
    A[EndNote Library<br/>.enl SQLite] -->|Direct Read| B[Python Importer]
    B -->|Extract & Classify| C[Reference Nodes]
    C -->|Store| D[Neo4j Graph Database]
    E[Hypothesis Nodes<br/>Optional] -->|Auto-Link| C
    D -->|Cypher Queries| F[Research Insights]
    D -->|Graph Algorithms| G[Network Analysis]
    
    style A fill:#e1f5ff
    style D fill:#ff9999
    style F fill:#99ff99

数据流

sequenceDiagram
    participant E as EndNote Library
    participant P as Python Script
    participant N as Neo4j Database
    participant U as Researcher
    
    P->>E: Connect to SQLite
    E-->>P: Return references
    P->>P: Extract PMID, DOI, metadata
    P->>P: Classify by research area
    P->>N: Create Reference nodes
    P->>N: Link to existing Hypotheses (optional)
    N-->>P: Confirm links created
    U->>N: Execute Cypher query
    N-->>U: Return results in <100ms

🚀 快速开始

先决条件

  • Python 3.8+: python --version
  • Neo4j数据库:获取免费云实例 Neo4j光环
  • 图书馆:.enl文件,其中包含您的参考文献

安装

# 1. Clone the repository
git clone https://github.com/YOUR_USERNAME/endnote-neo4j-integration.git
cd endnote-neo4j-integration

# 2. Install dependencies (just one!)
pip install neo4j

# 3. Configure your settings
cp config_template.py config.py
# Edit config.py with your paths and credentials

# 4. Run the import
python endnote_to_neo4j.py

配置

编辑 config.py 使用您的设置:

# EndNote Library Configuration
ENDNOTE_PATH = r"C:\path\to\your\library.enl"

# Neo4J Database Configuration  
NEO4J_URI = "neo4j+s://your-instance.databases.neo4j.io"
NEO4J_USER = "neo4j"
NEO4J_PASSWORD = "your-password"

# Import Settings
BATCH_SIZE = 100

重要: config.py 通过git排除在外 .gitignore 保护您的凭据!

首次运行

python endnote_to_neo4j.py

# Expected output:
# Found 500 references in EndNote library
# Starting import to Neo4J...
#   Imported 50/500 references...
#   Imported 100/500 references...
#   ...
# Successfully imported: 500/500 references
# References with PMID: 200
# References with DOI: 350
# Import Complete!

📊 进口什么

引用节点架构

每个引用都成为一个具有以下结构的综合证据节点:

// Example Reference Node
{
  // Identifiers
  node_id: "ENDNOTE_REF_123",
  endnote_id: 123,
  pmid: "12345678",          // Extracted from EndNote
  doi: "10.1234/example",     // Extracted from EndNote
  
  // Bibliographic Data
  title: "Example Research Paper Title",
  authors: ["Smith, J.", "Jones, A.", "Brown, K."],
  first_author: "Smith, J.",
  year: "2023",
  journal: "Nature",
  volume: "615",
  pages: "123-130",
  
  // Content
  abstract: "Full abstract text...",
  keywords: ["keyword1", "keyword2", "keyword3"],
  
  // Classification (customizable)
  primary_research_area: "Biology",
  disciplinary_tags: ["Biology", "Medicine"],
  
  // Quality Metrics
  conf_empirical: 0.9,
  conf_theoretical: 0.8,
  conf_methodological: 0.85,
  conf_consensus: 0.8,
  
  // Provenance
  source: "EndNote Library",
  citation: "Smith, J. et al. Example Research...",
  timestamp: "2024-11-24T12:00:00Z"
}

🔍 查询示例

基本查询

-- Count all references
MATCH (r:Reference)
RETURN count(r) as total_references

-- Count references by research area
MATCH (r:Reference)
RETURN r.primary_research_area, count(r) as papers
ORDER BY papers DESC

-- Find recent papers (last 5 years)
MATCH (r:Reference)
WHERE toInteger(r.year) >= 2020
RETURN r.title, r.first_author, r.year, r.citation
ORDER BY r.year DESC
LIMIT 20

-- Find papers by author
MATCH (r:Reference)
WHERE r.first_author CONTAINS 'Smith'
RETURN r.title, r.year, r.journal, r.pmid, r.doi

高级研究查询

-- Find interdisciplinary papers (multiple tags)
MATCH (r:Reference)
WHERE size(r.disciplinary_tags) >= 3
RETURN r.title, r.disciplinary_tags, r.year, r.citation
ORDER BY size(r.disciplinary_tags) DESC
LIMIT 10

-- Search abstracts for specific concepts
MATCH (r:Reference)
WHERE toLower(r.abstract) CONTAINS 'machine learning'
  AND toInteger(r.year) >= 2020
RETURN r.title, r.citation, r.year
ORDER BY r.year DESC

-- Find papers with both PMID and DOI
MATCH (r:Reference)
WHERE r.pmid IS NOT NULL AND r.doi IS NOT NULL
RETURN r.title, r.pmid, r.doi, r.citation
LIMIT 10

-- Generate literature review by topic
MATCH (r:Reference)
WHERE any(kw IN r.keywords WHERE toLower(kw) CONTAINS 'cancer')
WITH r,
  CASE 
    WHEN toLower(r.abstract) CONTAINS 'treatment' THEN 'Treatment'
    WHEN toLower(r.abstract) CONTAINS 'diagnosis' THEN 'Diagnosis'
    WHEN toLower(r.abstract) CONTAINS 'prevention' THEN 'Prevention'
    ELSE 'General'
  END as theme
RETURN theme, count(r) as papers, 
       collect(r.citation)[0..5] as sample_citations
ORDER BY papers DESC

知识图谱集成

如果你的图中有假设节点:

-- Find evidence supporting specific hypothesis
MATCH (r:Reference)-[s:SUPPORTS]->(h:Hypothesis)
WHERE h.label CONTAINS 'your hypothesis topic'
RETURN r.title, r.citation, s.strength, s.match_basis
ORDER BY s.strength DESC
LIMIT 10

-- Audit citation coverage for all hypotheses
MATCH (h:Hypothesis)
OPTIONAL MATCH (r:Reference)-[s:SUPPORTS]->(h)
WITH h, count(r) as ref_count
RETURN h.label, ref_count,
  CASE 
    WHEN ref_count = 0 THEN 'No support'
    WHEN ref_count < 5 THEN 'Limited'
    WHEN ref_count < 20 THEN 'Adequate'
    ELSE 'Strong'
  END as evidence_status
ORDER BY ref_count ASC

-- Find unsupported hypotheses
MATCH (h:Hypothesis)
WHERE NOT exists((h)<-[:SUPPORTS]-(:Reference))
RETURN h.label, h.description

时间分析

-- Publication trends over time
MATCH (r:Reference)
WHERE toInteger(r.year) >= 2015
RETURN r.year, count(r) as publications
ORDER BY r.year

-- Most prolific authors
MATCH (r:Reference)
UNWIND r.authors as author
RETURN author, count(r) as papers
ORDER BY papers DESC
LIMIT 20

-- Keyword trends
MATCH (r:Reference)
WHERE toInteger(r.year) >= 2020
UNWIND r.keywords as keyword
RETURN keyword, count(*) as frequency
ORDER BY frequency DESC
LIMIT 30

📈 性能比较

度量 MCP服务器 直接导入 改进
设置时间 2小时 15分钟 快8倍
查询速度 2-5秒 <100ms 速度提高20至50倍
可靠性 ~60% 99%+ 更加稳定
查询类型 4个基本工具 无限密码 无限强大
维护 每周30分钟 每月5分钟 工作量减少10-15倍
持久性 无(仅限会话) 永久性 巨大优势
内存使用率 每个会话约200MB 约10MB 效率提高20倍

总体而言:性能提高50-100倍

🎯 用例

1.文献综述生成

按主题自动组织论文,用于手稿介绍。

2.引文管理

消除引用伪造风险-所有参考文献均已通过EndNote的PMID/DOI验证。

3.知识差距分析

确定缺乏支持性证据的研究领域。

4.跨学科发现

查找连接多个研究领域的论文。

5.时间趋势分析

追踪几十年来研究主题的演变。

6.作者协作网络

分析你所在领域的合著模式。

7.循证研究规划

将现有文献与研究假设联系起来,找出差距。

🔄 维护

添加论文后重新导入

在添加对EndNote的引用后,只需再次运行脚本:

python endnote_to_neo4j.py

脚本将:

  • 导入所有引用(包括新引用)
  • 使用任何元数据更改更新现有节点
  • 为新论文创建自动链接
  • 保留所有现有的手动关系

所需时间:对于典型的库大小,需要2-3分钟。

检查导入状态

MATCH (r:Reference)
RETURN r.ingestion_session, 
       count(r) as refs_in_session,
       max(r.timestamp) as last_import_time

🛠️ 定制

自定义研究区域分类

编辑 classify_reference() 方法in endnote_to_neo4j.py:

def classify_reference(self, ref: sqlite3.Row) -> Tuple[str, List[str]]:
    text_to_analyze = f"{ref['title']} {ref['abstract']} {ref['keywords']}".lower()
    tags = []
    
    # Add YOUR custom keywords
    if 'your_keyword' in text_to_analyze:
        tags.append('Your_Research_Area')
    
    if 'another_keyword' in text_to_analyze:
        tags.append('Another_Area')
    
    # Determine primary area
    if 'Your_Research_Area' in tags:
        primary_area = 'Your_Research_Area'
    else:
        primary_area = 'General Research'
    
    return primary_area, list(set(tags))

修改置信度评分

根据您的标准调整质量指标:

e.conf_empirical = 0.95,      # For high-quality empirical data
e.conf_theoretical = 0.85,    # For theoretical soundness
e.conf_methodological = 0.90, # For methodological rigor
e.conf_consensus = 0.80       # For field consensus

添加自定义关系

创建支持之外的其他链接类型:

# In link_references_to_hypotheses() or in custom queries
CREATE (r)-[:CONTRADICTS]->(h)
CREATE (r)-[:VALIDATES]->(h)
CREATE (r)-[:EXTENDS]->(h)
CREATE (r)-[:CHALLENGES]->(h)

🤝 贡献

欢迎投稿!请随时提交拉取请求。

开发设置

git clone https://github.com/YOUR_USERNAME/endnote-neo4j-integration.git
cd endnote-neo4j-integration

# Install dev dependencies
pip install neo4j pytest

# Run tests (if implemented)
pytest tests/

路线图

  • []支持BibTeX导入
  • []支持Zotero库
  • []门捷利积分
  • []PDF全文提取和搜索
  • []作者协作网络可视化
  • []引文网络分析
  • []用于构建查询的Web界面
  • []通过文件监控自动更新
  • []Docker容器化

📝 许可证

此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。

🙏 致谢

  • 专为需要强大、快速访问参考库的研究人员而设计
  • 受到脆弱的MCP服务器架构的挫折的启发
  • 旨在与知识图谱框架和研究管理系统集成

📧 支持

❓ 常见问题解答

Q: 这会修改我的EndNote库吗?
A: 不!仅脚本 读取 您的EndNote数据库。它从不写入或修改您的.enl文件。

Q: 如果我没有假设节点怎么办?
A: 很好!脚本仍将导入所有引用。自动链接步骤根本不会创建任何链接,您可以跳过该功能。

Q: 我应该多久重新进口一次?
A: 每当您向EndNote添加大量新引用时。许多研究人员每月或在主要文献检索后重新导入。

Q: 我可以在EndNote Online上使用这个吗?
A: 此工具适用于EndNote Desktop(.enl文件)。EndNote Online使用不同的格式,目前不受支持。

Q: 其他参考经理呢?
A: 目前仅支持EndNote。BibTeX和Zotero支持已在路线图上。

Q: 我的数据安全吗?
A: 您的EndNote库和Neo4J凭据将保留在您的计算机上 config.py,它被排除在git之外。永不承诺 config.py 版本控制!


立即将您的EndNote库转化为强大的知识图谱! 🚀

由...制作❤️ 对于那些重视速度、可靠性和无限查询能力的研究人员来说。