Add JSON-LD generation script with NRP AI support#4
Merged
Conversation
Contributor
Author
JSON-LD Generation WorkflowNew workflow:
What changed:
LLM Services: Gemini (default - uses URL Context Tool to fetch webpage content), NRP, OpenAI, Anthropic Two LLM calls per dataset: Detection + Generation (same service) |
Contributor
Author
GitHub Actions Workflows - Rewrite SummaryRewrote both GitHub Actions workflows to match this repository's structure. The original workflows were copied from
|
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JSON-LD Generation Script for Dataset Webpages
Closes #3
Summary
This PR adds an automated script to generate JSON-LD descriptions for scientific datasets by analyzing their webpages using AI. The script reads dataset information from a CSV file (exported from Google Sheets), fetches webpage content, uses AI to extract metadata, and generates Schema.org-compliant JSON-LD files.
Features
Files Added
scripts/generate_jsonld.py- Main script for JSON-LD generationscripts/requirements.txt- Python dependenciesscripts/README.md- Setup and usage instructionsprompts/dataset-detection-prompt.txt- AI prompt for dataset detectionprompts/jsonld-generation-prompt.txt- AI prompt for JSON-LD generation.env.example- Template for API key configuration.gitignore- Updated to exclude sensitive files and generated outputSetup
Install dependencies:
Configure API key (see
.env.example):cp .env.example .env # Edit .env and add your NRP_API_KEYDownload
datasets.csvfrom the Google Sheet (seescripts/README.mdfor instructions)Testing
Test with a single URL
python scripts/generate_jsonld.py --test-url "http://hydro.iis.u-tokyo.ac.jp/~yamadai/MERIT_DEM/"Test with CSV (limit to 1 dataset)
Process all datasets
Example Output
The script generates JSON-LD files in
data/objects/summoned/generated/with filenames like:MERIT_DEM_956de6b6.jsonldEach file contains Schema.org-compliant JSON-LD with:
Workflow
hasJSONLD?isFALSE,#ERROR!, or emptyError Handling
Notes
--ai-serviceflag needed)data/objects/summoned/generated/(gitignored)