47 lines
1.4 KiB
Markdown
47 lines
1.4 KiB
Markdown
# Quick Reference: Botanical Query Generation
|
|
|
|
## One-Command Execution
|
|
|
|
```bash
|
|
cd /Users/kempersc/apps/glam && python3 scripts/generate_botanical_query_with_exclusions.py
|
|
```
|
|
|
|
## What It Does
|
|
|
|
1. Reads `data/wikidata/GLAMORCUBEPSXHFN/hyponyms_curated.yaml`
|
|
2. Extracts all Q-numbers (currently 1,786)
|
|
3. Generates SPARQL query with FILTER exclusions
|
|
4. Saves query and metadata to `data/wikidata/GLAMORCUBEPSXHFN/B/queries/`
|
|
|
|
## Output Files
|
|
|
|
**Query File**: `botanical_query_updated_<timestamp>.sparql`
|
|
- Ready for copy-paste to https://query.wikidata.org
|
|
|
|
**Metadata File**: `botanical_query_updated_<timestamp>.yaml`
|
|
- Generation statistics and source references
|
|
|
|
## When to Run
|
|
|
|
- After adding new Q-numbers to `hyponyms_curated.yaml`
|
|
- Before executing query on Wikidata Query Service
|
|
- When previous query results need updating
|
|
|
|
## Example Output
|
|
|
|
```
|
|
============================================================
|
|
BOTANICAL QUERY GENERATOR
|
|
============================================================
|
|
Reading Q-numbers from .../hyponyms_curated.yaml
|
|
Extracted 1786 Q-numbers
|
|
Created 36 FILTER chunks
|
|
✅ Wrote query: .../botanical_query_updated_20251116T090734.sparql
|
|
✅ Wrote metadata: .../botanical_query_updated_20251116T090734.yaml
|
|
============================================================
|
|
✅ Query generation complete!
|
|
```
|
|
|
|
## Full Documentation
|
|
|
|
See: `data/wikidata/GLAMORCUBEPSXHFN/B/README_QUERY_GENERATION.md`
|