Inconsistent behaviour of getResourcePolicyAll()
and getPolicyUrlAll()
for ACP
#2338
Labels
bug
Something isn't working
Search terms you've used
Bug description
There are two functions exposed from
acp_ess_2
, one namedgetResourcePolicyAll()
and the other namedgetPolicyUrlAll()
. Based on their doc, I expect them to identity the same set of policies, though one returning the policy themselves (as a dataset) and the other result the array of URLs/URIs.However, in my tests, they do not behave this way. In the example below,
getPolicyUrlAll()
returns policies, whilegetResourcePolicyAll()
returns empty array.To Reproduce
Minimal reproduction
Assume the resource locates at
https://MY-SITE/test/test-acr-1/res1.ttl
.Create the following
.acr
file for it: https://gist.github.com/renyuneyun/834eb5ee542e06a2cc3ee1a57712ca3fExpected result
Both return the same set of policies (in different formats)
Actual result
getPolicyUrlAll()
returns policies, whilegetResourcePolicyAll()
returns empty array.Environment
Additional information
When looking into the repo, it seems this is probably related to the fact that the repo contains several (not exactly same) copies of similar-purpose code, under
policy.ts
(,control.ts
) andpolicy/
.The function
getResourcePolicyAll()
callspolicy#getPolicyUrlAll()
(i.e.control#getPolicyUrlAll()
) whileacp_ess_2.getPolicyUrlAll()
is reexported fromsrc/acp/policy/getPolicyUrlAll.ts#getPolicyUrlAll()
.It feels to me like an incomplete transition from one (code) organization to another.
This may be related to #1641
The text was updated successfully, but these errors were encountered: