Skip to content

Add JSON-LD properties#11

Open
JR-1991 wants to merge 4 commits into
masterfrom
json-ld-types
Open

Add JSON-LD properties#11
JR-1991 wants to merge 4 commits into
masterfrom
json-ld-types

Conversation

@JR-1991
Copy link
Copy Markdown
Member

@JR-1991 JR-1991 commented Oct 19, 2025

This pull request introduces improvements to unit macros by adding default JSON-LD headers and support for additional properties, as well as bringing in new dependencies for UUID and code derivation. The main focus is on enriching the metadata for unit and base unit structures, which will help with serialization and interoperability.

Dependency additions:

  • Added uuid (v1.18.1, with v4 feature) and derivative (v2.2.0) as new dependencies in Cargo.toml to support unique identifiers and code derivation features.

Unit macro enhancements:

  • Updated build_base_unit!, inverse_unit!, ratio_unit!, and simple_unit! macros to include a jsonld field with a default header and an additional_properties field set to None in the generated structs, improving metadata completeness. [1] [2] [3] [4]

Testing improvements:

  • Added assertions in unit macro tests to verify that the additional_properties field is set to None, ensuring the new field is correctly initialized. [1] [2]

Bump uuid dependency from 1.16.0 to 1.18.1 with v4 feature enabled and add the derivative crate version 2.2.0 to Cargo.toml. This updates dependencies for improved functionality and compatibility.
Introduces JSON-LD headers and an additional_properties field to all major structs in the v2 schema for extensibility and semantic web compatibility. Updates macros to populate these fields and adds tests to verify the new behavior.
@JR-1991 JR-1991 self-assigned this Oct 19, 2025
@JR-1991 JR-1991 added the enhancement New feature or request label Oct 19, 2025
Added `..Default::default()` to struct initializations in SBML conversion implementations to ensure all fields are properly initialized. Also refactored default value usage in v2.rs and simplified context term insertions for JSON-LD header functions.
Reformatted all JSON-LD header functions to use multi-line and indented insertions for context terms, improving code readability and maintainability. No functional changes were made; only code style and formatting were updated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant