Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add json-ld module #2653

Merged
merged 5 commits into from
Mar 30, 2023

Conversation

ronjaquensel
Copy link
Contributor

What this PR changes/adds

Adds an extension that provides an ObjectMapper for working with JSON-LD and utility functions for expanding and compacting JSON-LD structures.

Why it does that

JSON-LD support is required for the dataspace protocol implementation.

Further notes

Transformers that handle the mapping between EDC model and JSON-LD will be added in a separate PR.

Linked Issue(s)

Relates #2474

Checklist

  • added appropriate tests?
  • performed checkstyle check locally?
  • added/updated copyright headers?
  • documented public classes/methods?
  • added/updated relevant documentation?
  • assigned appropriate label? (exclude from changelog with label no-changelog)
  • formatted title correctly? (take a look at the CONTRIBUTING and Etiquette for pull requests for details)

@ronjaquensel ronjaquensel added the enhancement New feature or request label Mar 29, 2023
@ronjaquensel ronjaquensel temporarily deployed to Azure-dev March 29, 2023 12:52 — with GitHub Actions Inactive
@ronjaquensel ronjaquensel mentioned this pull request Mar 29, 2023
7 tasks
@ronjaquensel ronjaquensel added the dataspace-protocol related to the dataspace protocol label Mar 29, 2023
}
};
mapper.registerModule(module);
mapper.registerSubtypes(AtomicConstraint.class, LiteralExpression.class);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this subtypes registration shouldn't happen in this module

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where should it happen then? I think the only other option would be for every extension using this mapper to register them itself.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They can be registered in a module lower or higher, depending on where we want to deserialize them. For example, in the IDS transformer module for JSON-LD or in core module if we want them registered against the default context.

Copy link
Member

@ndr-brt ndr-brt Mar 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This registration is the link between json-ld and the policy model classes, I think they will stay better where the json-ld to policy transformers are.

Copy link
Contributor

@jimmarino jimmarino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left two comments. After those are resolved, LGTM.

}
};
mapper.registerModule(module);
mapper.registerSubtypes(AtomicConstraint.class, LiteralExpression.class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They can be registered in a module lower or higher, depending on where we want to deserialize them. For example, in the IDS transformer module for JSON-LD or in core module if we want them registered against the default context.

@ronjaquensel ronjaquensel temporarily deployed to Azure-dev March 30, 2023 07:16 — with GitHub Actions Inactive
@codecov-commenter
Copy link

Codecov Report

Patch coverage: 32.00% and project coverage change: -0.16 ⚠️

Comparison is base (8a5bf0f) 64.52% compared to head (0062352) 64.36%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2653      +/-   ##
==========================================
- Coverage   64.52%   64.36%   -0.16%     
==========================================
  Files         891      894       +3     
  Lines       18276    18344      +68     
  Branches     1087     1097      +10     
==========================================
+ Hits        11792    11807      +15     
- Misses       6050     6096      +46     
- Partials      434      441       +7     
Impacted Files Coverage Δ
...n/java/org/eclipse/edc/jsonld/JsonLdExtension.java 0.00% <0.00%> (ø)
...in/java/org/eclipse/edc/jsonld/JsonLdKeywords.java 0.00% <0.00%> (ø)
...n/java/org/eclipse/edc/jsonld/util/JsonLdUtil.java 66.66% <66.66%> (ø)

... and 12 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ronjaquensel ronjaquensel merged commit 3f2fe88 into eclipse-edc:main Mar 30, 2023
@ronjaquensel ronjaquensel deleted the feat/json-ld-module branch March 30, 2023 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dataspace-protocol related to the dataspace protocol enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants