Skip to content

Commit ecd5be6

Browse files
sbooeshaghiclaude
andcommitted
Add abstract support to manuscript metadata
- Add manuscript_abstract column to submission table schema - Update load_cllm_data.py to extract abstract from metadata.json - Add abstract field to ManuscriptMetadata model - Update db_queries to fetch and return abstract 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 98d52f2 commit ecd5be6

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

app/db_queries.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def get_manuscript_detail(
132132

133133
# Get submission metadata
134134
cursor.execute("""
135-
SELECT id, manuscript_doi, manuscript_title, manuscript_pub_date, created_at
135+
SELECT id, manuscript_doi, manuscript_title, manuscript_pub_date, manuscript_abstract, created_at
136136
FROM submission
137137
WHERE id = ?
138138
""", (manuscript_id,))
@@ -146,7 +146,8 @@ def get_manuscript_detail(
146146
doi=row[1],
147147
title=row[2],
148148
pub_date=row[3],
149-
created_at=row[4]
149+
abstract=row[4],
150+
created_at=row[5]
150151
)
151152

152153
# Get summary stats with status and agreement counts (NEW: submission/content model)

app/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ class ManuscriptMetadata(BaseModel):
9898
doi: Optional[str] = None # manuscript_doi field
9999
title: Optional[str] = None # manuscript_title field
100100
pub_date: Optional[str] = None # manuscript_pub_date field
101+
abstract: Optional[str] = None # manuscript_abstract field
101102
created_at: str
102103

103104

app/schema.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
manuscript_title TEXT,
1717
manuscript_doi TEXT,
1818
manuscript_pub_date TEXT,
19+
manuscript_abstract TEXT,
1920
status TEXT NOT NULL,
2021
created_at TIMESTAMP NOT NULL,
2122
updated_at TIMESTAMP NOT NULL

load_cllm_data.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ def load_cllm_export(db_path: str, json_path: str) -> str:
4343
submission = data['submission']
4444
submission_id = submission['id']
4545

46-
# Use metadata file for title, DOI, and pub_date if available
46+
# Use metadata file for title, DOI, pub_date, and abstract if available
4747
title = metadata.get('title') or submission.get('manuscript_title')
4848
doi = metadata.get('doi') or submission.get('manuscript_doi')
4949
pub_date = metadata.get('pub_date')
50+
abstract = metadata.get('abstract')
5051

5152
# If title still not found, extract from manuscript content
5253
if not title:
@@ -59,14 +60,15 @@ def load_cllm_export(db_path: str, json_path: str) -> str:
5960
# 1. INSERT SUBMISSION
6061
# ====================================================================
6162
cursor.execute("""
62-
INSERT INTO submission (id, user_id, manuscript_title, manuscript_doi, manuscript_pub_date, status, created_at, updated_at)
63-
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
63+
INSERT INTO submission (id, user_id, manuscript_title, manuscript_doi, manuscript_pub_date, manuscript_abstract, status, created_at, updated_at)
64+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
6465
""", (
6566
submission_id,
6667
submission.get('user_id'),
6768
title,
6869
doi,
6970
pub_date,
71+
abstract,
7072
submission['status'],
7173
submission['created_at'],
7274
submission['updated_at']

0 commit comments

Comments
 (0)