There are two functions exposed from acp_ess_2, one named getResourcePolicyAll() and the other named getPolicyUrlAll(). 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, while getResourcePolicyAll() returns empty array.
To Reproduce
Create a resource with the .acr file as pasted below
Call these two functions respectively at the resource
Minimal reproduction
The template says to use a CodeSandBox, however the provided one is empty, and I cannot figure out how to use it easily. Because the issue is straightforward, I'm providing the .acr file.
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) and policy/.
The function getResourcePolicyAll() calls policy#getPolicyUrlAll() (i.e. control#getPolicyUrlAll()) while acp_ess_2.getPolicyUrlAll() is reexported from src/acp/policy/getPolicyUrlAll.ts#getPolicyUrlAll().
It feels to me like an incomplete transition from one (code) organization to another.
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 functiongetResourcePolicyAll()
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