Skip to content

Commit be88fef

Browse files
authored
add metadata type (#64)
1 parent bc78b0d commit be88fef

30 files changed

Lines changed: 215 additions & 131 deletions

docs/architecture.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ The `open_educational_resources` table stores processed OER data with denormaliz
1717
| `id` | UUID | PK | System | Auto-generated primary key |
1818
| `url` | Text | Unique | Both | Resource URL (from `d` tag or file URL) |
1919
| **Educational Metadata** |
20-
| `amb_metadata` | JSONB | - | AMB Event | Complete AMB metadata in structured format |
20+
| `metadata` | JSONB | - | Source Event | Complete metadata in structured format (format depends on source) |
21+
| `metadata_type` | Text | - | Source Event | Type identifier for metadata format (e.g., "amb" for AMB/Nostr sources) |
2122
| `keywords` | JSONB Array | - | AMB Event | Searchable keywords/tags |
2223
| `description` | Text | - | AMB Event | Resource description |
2324
| `audience_uri` | Text | Yes | AMB Event | Target audience URI (e.g., educators, students) |

docs/client-packages-react.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function OerFinder() {
5959
const handleCardClick = useCallback(
6060
(event: CustomEvent<OerCardClickEvent>) => {
6161
const oer = event.detail.oer;
62-
const url = oer.amb_metadata?.id || oer.url;
62+
const url = oer.metadata?.id || oer.url;
6363
if (url) {
6464
window.open(String(url), '_blank', 'noopener,noreferrer');
6565
}

docs/client-packages-svelte.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ The recommended pattern is to slot `<oer-list>` and `<oer-pagination>` inside `<
5858
// Handle card clicks
5959
listElement.addEventListener('card-click', (event: Event) => {
6060
const { oer } = (event as CustomEvent<OerCardClickEvent>).detail;
61-
const url = oer.amb_metadata?.id || oer.url;
61+
const url = oer.metadata?.id || oer.url;
6262
if (url) {
6363
window.open(String(url), '_blank', 'noopener,noreferrer');
6464
}

docs/client-packages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ Here's a complete example showing how to integrate the search, list, and paginat
393393
// Handle card clicks (open resource in new tab)
394394
listElement.addEventListener('card-click', (event) => {
395395
const oer = event.detail.oer;
396-
const url = oer.amb_metadata?.id || oer.url;
396+
const url = oer.metadata?.id || oer.url;
397397
if (url) {
398398
window.open(url, '_blank', 'noopener,noreferrer');
399399
}

openspec/specs/aggregator-server/spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ The application MUST automatically extract OER metadata from kind 30142 (AMB - A
112112
- **WHEN** metadata is extracted
113113
- **THEN** the tag structure is transformed into fully nested JSON
114114
- **AND** all levels of nesting are preserved
115-
- **AND** the nested JSON is stored in the amb_metadata field
115+
- **AND** the nested JSON is stored in the metadata field
116116

117117
#### Scenario: Extract license information
118118
- **GIVEN** an AMB event contains license tags

packages/oer-finder-api-client/dist/generated/schema.d.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ export interface components {
391391
*/
392392
file_mime_type: Record<string, never> | null;
393393
/**
394-
* @description AMB metadata object containing type, name, educational level, language, etc. Note: Additional fields beyond the schema definition may be present.
394+
* @description Metadata object containing type, name, educational level, language, etc. The structure depends on metadata_type. Note: Additional fields beyond the schema definition may be present.
395395
* @example {
396396
* "type": "LearningResource",
397397
* "name": "Introduction to TypeScript",
@@ -402,7 +402,12 @@ export interface components {
402402
* "learningResourceType": "Tutorial"
403403
* }
404404
*/
405-
amb_metadata: components["schemas"]["AmbMetadataSchema"] | null;
405+
metadata: components["schemas"]["AmbMetadataSchema"] | null;
406+
/**
407+
* @description Type of the metadata object (e.g., "amb" for AMB/Allgemeines Metadatenprofil Bildungsressourcen). Determines how to interpret the metadata field.
408+
* @example amb
409+
*/
410+
metadata_type: string | null;
406411
/**
407412
* @description Array of keywords associated with the resource
408413
* @example [

packages/oer-finder-api-client/dist/generated/schema.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/oer-finder-api-client/generated/schema.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ export interface components {
392392
*/
393393
file_mime_type: Record<string, never> | null;
394394
/**
395-
* @description AMB metadata object containing type, name, educational level, language, etc. Note: Additional fields beyond the schema definition may be present.
395+
* @description Metadata object containing type, name, educational level, language, etc. The structure depends on metadata_type. Note: Additional fields beyond the schema definition may be present.
396396
* @example {
397397
* "type": "LearningResource",
398398
* "name": "Introduction to TypeScript",
@@ -403,7 +403,12 @@ export interface components {
403403
* "learningResourceType": "Tutorial"
404404
* }
405405
*/
406-
amb_metadata: components["schemas"]["AmbMetadataSchema"] | null;
406+
metadata: components["schemas"]["AmbMetadataSchema"] | null;
407+
/**
408+
* @description Type of the metadata object (e.g., "amb" for AMB/Allgemeines Metadatenprofil Bildungsressourcen). Determines how to interpret the metadata field.
409+
* @example amb
410+
*/
411+
metadata_type: string | null;
407412
/**
408413
* @description Array of keywords associated with the resource
409414
* @example [

0 commit comments

Comments
 (0)