-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch_openalex.py
More file actions
91 lines (86 loc) · 4.15 KB
/
Copy pathsearch_openalex.py
File metadata and controls
91 lines (86 loc) · 4.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/usr/bin/env python3
"""Comprehensive OpenAlex search for NeKo-PIGNN literature review."""
import urllib.request
import urllib.parse
import json
import time
def search_openalex(query, per_page=25):
"""Search OpenAlex API."""
url = f'https://api.openalex.org/works?filter=title_and_abstract.search:{urllib.parse.quote(query)}&sort=publication_date:desc&per_page={per_page}'
req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0 (research bot)'})
with urllib.request.urlopen(req, timeout=30) as resp:
return json.loads(resp.read().decode('utf-8'))
def extract_papers(data, min_year=2024):
"""Extract relevant paper info from OpenAlex response."""
papers = []
for r in data.get('results', []):
year = r.get('publication_year', 0)
if year < min_year:
continue
title = r.get('title', 'No title')
date = r.get('publication_date', str(year))
doi = r.get('doi', '')
authors = []
for a in r.get('authorships', []):
author = a.get('author', {})
authors.append(author.get('display_name', '?'))
loc = r.get('primary_location', {})
source = loc.get('source', {})
journal = source.get('display_name', '')
is_oa = r.get('open_access', {}).get('is_oa', False)
cited_by = r.get('cited_by_count', 0)
papers.append({
'title': title,
'date': date,
'year': year,
'doi': doi,
'authors': authors,
'journal': journal,
'is_oa': is_oa,
'cited_by': cited_by,
'url': loc.get('landing_page_url', '')
})
return papers
def print_papers(papers, label):
print(f"\n{'='*80}")
print(f"📚 {label} ({len(papers)} papers)")
print(f"{'='*80}")
if not papers:
print(" (no results)")
return
for i, p in enumerate(papers, 1):
print(f"\n [{i}] [{p['year']}-{p['date'][5:10] if p['date'] else '??'}] {p['title'][:140]}")
print(f" Journal: {p['journal'][:60]}")
print(f" Authors: {', '.join(p['authors'][:4])}{' et al.' if len(p['authors']) > 4 else ''}")
print(f" DOI: {p['doi']}")
print(f" Cited: {p['cited_by']} | OA: {p['is_oa']}")
QUERIES = [
# Core queries for NeKo-PIGNN literature
("neural+koopman+operator+wildfire+propagation", "Neural Koopman + Wildfire Propagation"),
("physics+informed+graph+neural+network+wildfire+spread", "PI-GNN + Wildfire Spread"),
("koopman+operator+graph+neural+network+dynamics", "Koopman + GNN + Dynamics"),
("digital+twin+wildfire+deep+learning+prediction", "Digital Twin Wildfire DL"),
("GOES+ABI+wildfire+detection+deep+learning+2025", "GOES ABI Fire Detection 2025+"),
("wildfire+propagation+graph+attention+network+2025", "Graph Attention Wildfire 2025+"),
("unsupervised+wildfire+detection+satellite+imagery", "Unsupervised Wildfire Satellite Detection"),
("Rothermel+deep+learning+neural+network", "Rothermel + Deep Learning"),
("wildfire+caatinga+cerrado+machine+learning", "Wildfire Caatinga Cerrado ML"),
("brazil+wildfire+deep+learning+satellite+detection+2025", "Brazil Wildfire DL Satellite"),
("neural+koopman+physics+informed+neural+network", "Neural Koopman + PINN"),
("wildfire+spread+neural+ode+graph", "Wildfire + Neural ODE + Graph"),
("hybrid+physics+data+driven+wildfire+propagation+model", "Hybrid Physics-ML Wildfire"),
("GOES-19+satellite+fire+detection+thermal", "GOES-19 Fire Detection"),
("wildfire+edge+computing+real+time+detection", "Edge AI Real-time Wildfire"),
("knowledge+distillation+wildfire+detection+satellite", "Knowledge Distillation Wildfire"),
("explainable+AI+wildfire+prediction+spread", "XAI Wildfire Prediction"),
]
for query, label in QUERIES:
try:
data = search_openalex(query, per_page=15)
papers = extract_papers(data, min_year=2024)
# Print only 2025-2026 papers
recent = [p for p in papers if p['year'] >= 2025]
print_papers(recent if recent else papers[:5], label)
time.sleep(0.3)
except Exception as e:
print(f"\n⚠️ Error for '{label}': {e}")