We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Often a containing object schema will define a Json-Ld @type for a child object, making the latter optional. For example:
@type
{ "@context": "...", "@type": "dspace:ContractOfferMessage", "dspace:offer": { "@type": "odrl:Offer", "@id": "urn:uuid:d526561f-528e-4d5a-ae12-9a9dd9b7a518", "target": "urn:uuid:3dd1add8-4d2d-569e-d634-8394a8836a88" }, }
ContractOfferMessage defines a dspace:offer property that is always of type odrl:Offer. Specifying the @type on the policy is therefore not required.
ContractOfferMessage
dspace:offer
odrl:Offer
We need a way to provide the type context information to child transformers. In the above case, JsonObjectToPolicyTransformer.
JsonObjectToPolicyTransformer.
A general facility should be built into TransformerContext to provide this information generically. This can be done by adding the following methods:
TransformerContext
@Nullable default <T> T getData(String key, Class<T> expectedType) { return null; } @Nullable default <T> T setData(String key, Object data) { return null; } @Nullable default void clearData(String key) { }
JsonLdTransformer will then define a DEFAULT_TYPE constant transformers can use to set, access, and clear type data.
JsonLdTransformer
DEFAULT_TYPE
The text was updated successfully, but these errors were encountered:
Offer
ndr-brt
Successfully merging a pull request may close this issue.
Feature Request
Often a containing object schema will define a Json-Ld
@type
for a child object, making the latter optional. For example:ContractOfferMessage
defines adspace:offer
property that is always of typeodrl:Offer
. Specifying the@type
on the policy is therefore not required.We need a way to provide the type context information to child transformers. In the above case,
JsonObjectToPolicyTransformer.
Solution Proposal
A general facility should be built into
TransformerContext
to provide this information generically. This can be done by adding the following methods:JsonLdTransformer
will then define aDEFAULT_TYPE
constant transformers can use to set, access, and clear type data.The text was updated successfully, but these errors were encountered: