27 transform cascara to json ld#100
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds JSON-LD export support, canonicalizes JSON-LD output, and refactors package caching so imported packages can persist across sessions.
Changes:
- Adds a central JSON-LD export dispatcher, key sorting, package graph/context JSON-LD transforms, and file-writing support.
- Reworks package cache usage from
usePackageCachetoPackageCachewith localStorage persistence. - Updates metamodel fixtures/tests for
cas:Icon→cas:iconand expands JSON-LD roundtrip coverage.
Reviewed changes
Copilot reviewed 34 out of 38 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
src/common/export/jsonld/getJSONLD.ts |
Adds central JSON-LD export dispatcher and package graph filtering. |
src/common/lib/helpers.ts |
Adds canonical JSON-LD key sorting helper. |
src/common/lib/platform-independence.ts |
Adds cross-platform PLI.writeFile() support. |
src/common/lib/messages.ts |
Adds/renumbers package validation and file-write messages. |
src/common/lib/mvf.ts |
Updates JSON-LD/XML vocabulary mappings for graph, icon, and unit. |
src/common/import/jsonld/import-jsonld.ts |
Uses new validation message code. |
src/common/schema/pig/ts/pig-metaclasses.ts |
Adds JSON-LD export transforms and adjusts datatype/default handling. |
src/common/schema/pig/ts/pig-package-constraints.ts |
Updates constraint documentation comments. |
src/common/schema/pig/ts/platform-independence.ts |
Adds an empty placeholder file. |
src/common/schema/README.md |
Adds brief schema folder documentation. |
src/stores/packageCache.ts |
Removes old package cache store. |
src/stores/package-cache.ts |
Adds persistent package cache store API. |
src/plugins/export/jsonld/export-jsonld.vue |
Replaces placeholder export dialog with JSON-LD export workflow. |
src/plugins/export/jsonld/README.md |
Adds JSON-LD export plugin documentation. |
src/plugins/import/xml/import-xml.vue |
Updates imports to use the new package cache API. |
src/plugins/import/reqif/import-reqif.vue |
Updates imports to use the new package cache API. |
src/plugins/import/jsonld/import-jsonld.vue |
Updates imports to use the new package cache API. |
src/components/PageDocument.vue |
Reads packages through the persistent cache. |
src/examples/writeFile-example.ts |
Adds examples for PLI.writeFile(). |
tests/unit/pig-metaclasses.spec.ts |
Updates JSON-LD @type expectations. |
tests/unit/pig-metaclasses-xml.spec.ts |
Updates XML tests for lowercase cas:icon. |
tests/unit/pig-metaclasses-jsonld.spec.ts |
Adds JSON-LD export roundtrip assertions. |
tests/data/XML/21/Project 'Very Simple Model (FMC) with Requirements'.cas.xml |
Removes cas:Icon property definition/references. |
tests/data/XML/11/Alice.cas.xml |
Removes cas:Icon property definition/references. |
tests/data/XML/05/Project 'Requirement with Enumerated Property'.cas.xml |
Removes cas:Icon property definition/references. |
tests/data/TTL/11/Alice.cas.ttl |
Updates TTL metamodel links and removes icon shape. |
tests/data/TTL/05/Project 'Requirement with Enumerated Property'.cas.ttl |
Renames cas:Icon to cas:icon. |
tests/data/JSON-LD/27/Dimmer - Semantically Integrated Specification (2021-01-28).cas.jsonld |
Renames JSON-LD icon fields. |
tests/data/JSON-LD/21/Project 'Very Simple Model (FMC) with Requirements'.cas.jsonld |
Renames JSON-LD icon fields. |
tests/data/JSON-LD/05/Project 'Requirement with Enumerated Property'.cas.jsonld |
Renames JSON-LD icon fields. |
public/assets/jsonld/Entity.json |
Updates schema property from cas:Icon to cas:icon. |
public/assets/jsonld/Relationship.json |
Updates schema property from cas:Icon to cas:icon. |
public/assets/index.html |
Adds heading IDs and updates wording. |
public/.htaccess |
Expands rewrite and cache-control configuration. |
public/assets/.htaccess |
Adds asset cache-control configuration. |
public/assets/xslt/ReqIF-to-CAS.sef.json |
Regenerates compiled ReqIF XSLT artifact. |
src/build-info.ts |
Regenerates build metadata. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Agent-Logs-Url: https://github.com/GfSE/CASCaDE-Reference-Implementation/sessions/0063e9f8-cdc2-4fce-80f5-88fd9e5cf4b3 Co-authored-by: odungern <8947971+odungern@users.noreply.github.com>
- improved normalizeId() as a consequence - added a test-case for id normalization
csaenz-psg
left a comment
There was a problem hiding this comment.
The code looks good although there are a lot of changes in this one merge request. These branches should remain small. If the Id --> id change could have been its own branch, that should be done separately. Otherwise, make sure the copilot doesn't delete old files and generating new files like with packageChache.ts.
@csaenz-psg: I agree that fewer changes in a branch are preferrable to minimize merging problems. However, what to do in this situation where all the changes have already been applied? Can't separate commits a-posteriori, or can we? |
The latest commits finalize the write-to-file-as-jsonld.