Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 25 additions & 3 deletions claude-plugin/skills/patent-fetch/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ MATCH (p:Patent) RETURN p.title, p.abstract_text
|--------------|------------------|
| Assignee, owner, applicant | `p.assignee` |
| Legal status, status, expired/active | `p.legal_status` |
| Claims, what is claimed | `p.claims` |
| Claims, what is claimed | `MATCH (p:Patent)-[:claims]->(c:claims) RETURN c.number, c.text` |
| Description, details, specification | `p.description` |
| Filing date, application date | `p.filing_date` |
| Publication date | `p.publication_date` |
| Priority date | `p.priority_date` |
| Everything, full details | `p.title, p.abstract_text, p.description, p.assignee, p.filing_date, p.publication_date, p.priority_date, p.legal_status, p.claims` |
| Everything, full details | `p.title, p.abstract_text, p.description, p.assignee, p.filing_date, p.publication_date, p.priority_date, p.legal_status` (claims: use relationship query) |

**Example queries based on user request:**

Expand All @@ -67,14 +67,36 @@ User: "What's the legal status of US9152718B2?"
→ Include legal_status: `MATCH (p:Patent) RETURN p.title, p.legal_status`

User: "Get full details for US9152718B2"
→ Include everything: `MATCH (p:Patent) RETURN p.title, p.abstract_text, p.description, p.assignee, p.filing_date, p.publication_date, p.priority_date, p.legal_status, p.claims`
→ Include everything: `MATCH (p:Patent) RETURN p.title, p.abstract_text, p.description, p.assignee, p.filing_date, p.publication_date, p.priority_date, p.legal_status`

User: "What are the claims for US9152718B2?"
→ Use relationship: `MATCH (p:Patent)-[:claims]->(c:claims) RETURN c.number, c.text ORDER BY c.number`

## Important Notes

- The `output_file` returned by fetch_patent is for debugging purposes only
- **Always use `execute_cypher` to access patent data** - do not use the Read tool on the output_file
- The dataset is automatically loaded into memory for efficient querying

## Graph Structure

Patent data is loaded as a graph with the following structure:

- **Patent node** (`:Patent`) - Main patent with id, title, abstract_text, etc.
- **Array fields become relationships**:
- `(:Patent)-[:claims]->(:claims)` - Claim nodes with number, text
- `(:Patent)-[:description_paragraphs]->(:description_paragraphs)` - Description nodes
- `(:Patent)-[:images]->(:images)` - Image nodes

**Accessing claims via relationship:**
```cypher
# Get all claim numbers and texts
MATCH (p:Patent)-[:claims]->(c:claims) RETURN c.number, c.text

# Get claims for a specific patent
MATCH (p:Patent)-[:claims]->(c:claims) WHERE p.id = 'US9152718B2' RETURN c.number, c.text ORDER BY c.number
```

## Parameters

- `patent_id` (string, required): Patent ID (e.g., "US9152718B2", "JP2023-123456-A")
Expand Down
2 changes: 1 addition & 1 deletion src/mcp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ impl PatentHandler {
) -> Option<String> {
// Try to create engine from the provided JSON
let engine_result = if let Some(label) = root_label {
CypherEngine::from_json_auto_as_root_with_label(json, label)
CypherEngine::from_json_with_label(json, label)
} else {
CypherEngine::from_json_auto(json)
};
Expand Down
Loading