Skip to content

Add JSON-LD API endpoints for Glosses and Manuscripts#95

Draft
Copilot wants to merge 5 commits intomainfrom
copilot/serve-linked-data-endpoint
Draft

Add JSON-LD API endpoints for Glosses and Manuscripts#95
Copilot wants to merge 5 commits intomainfrom
copilot/serve-linked-data-endpoint

Conversation

Copy link
Copy Markdown

Copilot AI commented Jan 6, 2026

Implements Linked Data endpoints to expose Glosses and Manuscripts as proper JSON-LD, satisfying the MVP requirement that "every Gloss and Witness must have a URI that resolves to a JSON-LD representation."

Changes

API Routes (src/app/api/)

  • GET /api/glosses - Returns ItemList of all glosses
  • GET /api/glosses/[id] - Returns individual gloss
  • GET /api/manuscripts - Returns ItemList of all manuscripts
  • GET /api/manuscripts/[id] - Returns individual manuscript

JSON-LD Conversion (src/lib/jsonld.ts)

  • Maps processed data to schema.org vocabulary (Comment for glosses, Manuscript for manuscripts)
  • Custom gog: namespace for domain properties (canonicalReference, originLocal, etc.)
  • Proper @context, @type, @id annotations with Content-Type: application/ld+json

Configuration (next.config.mjs)

  • Removed output: 'export' to enable API routes (incompatible with static export)
  • Routes marked dynamic = 'force-dynamic' for fresh data on each request

Example Response

{
  "@context": {
    "@vocab": "http://schema.org/",
    "gog": "https://galleryofglosses.org/terms/"
  },
  "@type": "Comment",
  "@id": "https://store.rerum.io/v1/id/610c54de...",
  "name": "Gloss title",
  "text": "Gloss content",
  "inLanguage": "la",
  "gog:canonicalReference": "Matthew 5:1",
  "keywords": ["theme1", "theme2"]
}

Documentation

Added API.md documenting endpoints, vocabularies, and usage examples.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • fonts.googleapis.com
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/Gallery-of-Glosses/Gallery-of-Glosses/node_modules/next/dist/compiled/jest-worker/processChild.js (dns block)
  • store.rerum.io
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/Gallery-of-Glosses/Gallery-of-Glosses/node_modules/next/dist/server/lib/start-server.js (dns block)
  • tinymatt.rerum.io
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/Gallery-of-Glosses/Gallery-of-Glosses/node_modules/next/dist/server/lib/start-server.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Serve Linked Data</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)

@cubap https://github.com/CenterForDigitalHumanities/Gallery-of-Glosses/wiki/Access-and-Permissions @cubap just to be sure that we have an endpoint for all the Manuscripts and Glosses at a minimum that results in a proper JSON-LD

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits January 6, 2026 21:27
Co-authored-by: cubap <1119165+cubap@users.noreply.github.com>
Co-authored-by: cubap <1119165+cubap@users.noreply.github.com>
Co-authored-by: cubap <1119165+cubap@users.noreply.github.com>
Co-authored-by: cubap <1119165+cubap@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement endpoint for serving linked data Add JSON-LD API endpoints for Glosses and Manuscripts Jan 6, 2026
Copilot AI requested a review from cubap January 6, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Serve Linked Data

2 participants