-
Notifications
You must be signed in to change notification settings - Fork 6
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
Allow component reference as variable value #27
Comments
Not sure if I fully understand this issue. Would the usage of |
So the case came up here: CommunitySolidServer/CommunitySolidServer@7c1f4e9#diff-d8bc980e9e02b5f4b93773be717b9ac4dc6f50d5accc5ec851de40f18622d476R16-R31 The configuration file has: {
"@id": "urn:solid-server:default:variable:store",
"@type": "Variable"
} with the idea that some store will be injected. However, the store to be injected is actually one of the stores defined in that same file (in this case either // Create the internal store
const variables: Record<string, any> = {
'urn:solid-server:default:variable:baseUrl': BASE,
};
const internalStore = await instantiateFromConfig(
'urn:solid-server:default:MemoryResourceStore',
'auth-ldp-handler.json',
variables,
) as ResourceStore;
variables['urn:solid-server:default:variable:store'] = internalStore; // <=== note especially this line
// Create and initialize the HTTP handler and related components
const instances = await instantiateFromConfig(
'urn:solid-server:test:Instances',
'auth-ldp-handler.json',
variables,
) as Record<string, any>; whereas, with an const variables: Record<string, any> = {
'urn:solid-server:default:variable:baseUrl': BASE,
'urn:solid-server:default:variable:store': new IriRef('urn:solid-server:default:MemoryResourceStore'), // <=== this line
};
// Create and initialize the HTTP handler and related components
const instances = await instantiateFromConfig(
'urn:solid-server:test:Instances',
'auth-ldp-handler.json',
variables,
) as Record<string, any>; |
Ah, I understand now. |
I'd like to be able to instantiate a variable with a component reference.
For example, I'd like to instantiate
with
urn:solid-server:default:RoutingResourceStore
defined elsewhere in the configuration file.We might need a special class for that, such as
IriRef
, that we pass as a variable value.(Note that
NamedNode
wouldn't work, because then we would be unable to pass actual named nodes. It has to be a value that would never be used otherwise.)The text was updated successfully, but these errors were encountered: