$npx -y skills add QSong-github/DrugClaw --skill unid3UniD3 is a multi-knowledge-graph built from 150,000+ PubMed articles, stored as 6 GraphML files. It supports drug-disease matching, effectiveness assessment, and drug-target analysis.
| 1 | # UniD3 - Drug Discovery Knowledge Graph |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | UniD3 is a multi-knowledge-graph built from 150,000+ PubMed articles, stored as 6 GraphML files. It supports drug-disease matching, effectiveness assessment, and drug-target analysis. |
| 6 | |
| 7 | - **Source**: https://github.com/QSong-github/UniD3 |
| 8 | - **Local path**: `resources_metadata/drug_knowledgebase/UniD3` |
| 9 | - **Format**: GraphML (6 files, e.g. `UniD3_L1T1.graphml`) |
| 10 | - **Dependency**: `networkx` |
| 11 | |
| 12 | ## Node Schema |
| 13 | |
| 14 | Each node contains: |
| 15 | |
| 16 | | Field | Description | |
| 17 | |-------|-------------| |
| 18 | | `entity` | Node name (e.g. `RESPIRATORY DISEASES`) | |
| 19 | | `entity_type` | Type label (e.g. `DISEASE`, `DRUG`, `GENE`, `HOST`, `BIOLOGICAL PROCESS`) | |
| 20 | | `description` | Free-text description from PubMed articles | |
| 21 | | `source_id` | Chunk ID linking back to source article | |
| 22 | |
| 23 | ## Edge Schema |
| 24 | |
| 25 | Each edge contains: |
| 26 | |
| 27 | | Field | Description | |
| 28 | |-------|-------------| |
| 29 | | `source` / `target` | Connected entity names | |
| 30 | | `weight` | Relation strength (float) | |
| 31 | | `description` | Relationship description | |
| 32 | | `keywords` | Associated keywords | |
| 33 | | `source_id` | Source chunk ID | |
| 34 | |
| 35 | ## API Reference |
| 36 | |
| 37 | ### `list_graphs() → list[str]` |
| 38 | |
| 39 | Return names of all 6 GraphML files. |
| 40 | |
| 41 | ```python |
| 42 | from UniD3 import list_graphs |
| 43 | list_graphs() |
| 44 | # → ["UniD3_L1T1", "UniD3_L1T2", "UniD3_L2T1", ...] |
| 45 | ``` |
| 46 | |
| 47 | ### `query_entities(entities, graph_names=None) → list[dict]` |
| 48 | |
| 49 | Look up one or more entities by name (case-insensitive). |
| 50 | |
| 51 | ```python |
| 52 | from UniD3 import query_entities |
| 53 | |
| 54 | # Single entity |
| 55 | query_entities("RESPIRATORY DISEASES") |
| 56 | |
| 57 | # Multiple entities |
| 58 | query_entities(["CALVES", "INFLAMMATION MODULATION"]) |
| 59 | |
| 60 | # Restrict to specific graph |
| 61 | query_entities("CALVES", graph_names=["UniD3_L1T1"]) |
| 62 | ``` |
| 63 | |
| 64 | **Returns** list of dicts: `{entity, entity_type, description, source_id, graph}` |
| 65 | |
| 66 | ### `get_neighbors(entity, graph_names=None) → list[dict]` |
| 67 | |
| 68 | Get all direct neighbors and connecting edge info for an entity. |
| 69 | |
| 70 | ```python |
| 71 | from UniD3 import get_neighbors |
| 72 | get_neighbors("CALVES") |
| 73 | ``` |
| 74 | |
| 75 | **Returns** list of dicts: `{graph, neighbor: {entity, entity_type, description, source_id}, edge: {source, target, weight, description, keywords, source_id}}` |
| 76 | |
| 77 | ### `search_by_type(entity_type, graph_names=None, limit=50) → list[dict]` |
| 78 | |
| 79 | Filter entities by type. |
| 80 | |
| 81 | ```python |
| 82 | from UniD3 import search_by_type |
| 83 | search_by_type("DISEASE", limit=10) |
| 84 | search_by_type("DRUG", graph_names=["UniD3_L1T1"]) |
| 85 | ``` |
| 86 | |
| 87 | ### `search_by_keyword(keyword, graph_names=None, limit=50) → list[dict]` |
| 88 | |
| 89 | Substring match over entity names and descriptions. |
| 90 | |
| 91 | ```python |
| 92 | from UniD3 import search_by_keyword |
| 93 | search_by_keyword("inflammation") |
| 94 | search_by_keyword("cancer", limit=20) |
| 95 | ``` |
| 96 | |
| 97 | ## Typical Workflow |
| 98 | |
| 99 | ```python |
| 100 | from UniD3 import query_entities, get_neighbors, search_by_type |
| 101 | |
| 102 | # Step 1: Find a drug entity |
| 103 | hits = query_entities("ASPIRIN") |
| 104 | |
| 105 | # Step 2: Explore its neighborhood (related diseases, targets, etc.) |
| 106 | neighbors = get_neighbors("ASPIRIN") |
| 107 | |
| 108 | # Step 3: Filter neighbors by type |
| 109 | diseases = [n for n in neighbors if n["neighbor"]["entity_type"] == "DISEASE"] |
| 110 | ``` |