-
Notifications
You must be signed in to change notification settings - Fork 54
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
Policy Constraint leftOperand
does not match registered functions
#616
Comments
The issue appears to be We'll look into a solution for handling this. |
Further info: if the ODRL context is added to the parent Bottom line: we will need to explain not to do this and also deal with some of these common cases. For example, issuing a warning if certain expansions are encountered. |
Also, given the way |
Yeah that was an oversight on my part. One solution should be we auto-register this stuff |
I did a PR to address this in #713 Basically i've registered the functions also in the namespaced version with namespace So in the @yurimssilva example that would reflect in {
"@context": {
"@vocab": "https://w3id.org/edc/v0.0.1/ns/",
"tx" : "https://w3id.org/tractusx/v0.0.1/ns/"
},
"@type": "PolicyDefinition",
"@id": "{{policy-id'}}",
"policy": {
"@context": "http://www.w3.org/ns/odrl.jsonld",
"permission": {
"action": "use",
"constraint": {
"leftOperand": "tx:Dismantler",
"operator": "eq",
"rightOperand": "active"
}
}
}
} wdyt? I also did some more in this PR in order to simplify the policy creation by drafting to context. So basically users could express their policy in this way by using aliases in the contexts. {
"@context": [
"https://w3id.org/edc/v0.0.1",
"https://w3id.org/tractusx/edc/v0.0.1",
"http://www.w3.org/ns/odrl.jsonld"
],
"@type": "PolicyDefinitionRequest",
"@id": "${POLICY_ID}",
"policy": {
"@type": "Set",
"permission": [
{
"action": "use",
"constraint": [
{
"leftOperand": "Dismantler",
"operator": "eq",
"rightOperand": "active"
}
]
}
]
}
}
|
Description
The Policy Constraint
leftOperand
does not match the registered functions.Consider the following
Policy
example:The value of
leftOperand
will be expanded to:Eventually, it will be deserialized to
Constraint.leftOperand
as"https://w3id.org/edc/v0.0.1/ns/Dismantler"
. However, this value does not match the registered value of"Dismantler"
in theRuleBindingRegistry
. As a result, theConstraint
is being filtered out from the Policy.To resolve this issue, you can take one of the following approaches:
"https://w3id.org/edc/v0.0.1/ns/Dismantler"
.leftOperand
as a primitive@value
instead of a unique instance identifier. For example:It will be deserialized to
Constraint.leftOperand
"Dismantler", matching the function key.The same registering pattern is followed by all the other functions, except
inForceDate
, which is registered with the EDC namespace prefix (https://w3id.org/edc/v0.0.1/ns/inForceDate).Context Informations
The text was updated successfully, but these errors were encountered: