Components.js
Components.js copied to clipboard
Support type-scoped context for external references
Issue type:
- :heavy_plus_sign: Feature request
Description:
Wasn't sure how to clearly phrase accurately, or if this is something that can be solved. The problem is that type-scoped context only work in blocks where the @type key is present. For example: I define an instance in a file such as:
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^0.0.0/components/context.jsonld",
"@graph": [
{
"comment": "Supports default Solid behaviour on any kind of data accessor.",
"@id": "urn:solid-server:default:ResourceStore_DataAccessor",
"@type": "DataAccessorBasedStore",
"identifierStrategy": { "@id": "urn:solid-server:default:IdentifierStrategy" },
"auxiliaryStrategy": { "@id": "urn:solid-server:default:AuxiliaryStrategy" }
}
]
}
In another file I then want to import this class and link it to a data accessor like this:
{
"@id": "urn:solid-server:default:ResourceStore_DataAccessor",
"accessor": {
"@id": "urn:solid-server:default:MemoryDataAccessor"
}
}
This doesn't work though: Components.js will error here that the accessor predicate is not defined since I guess the type-scoped context doesn't work there since the type field is set somewhere else. Would be nice if there was some way to also make it work there.
Thanks for the suggestion!
Since type-scoped contexts work on syntax-level within a single document, they are not aware of data coming from other documents.
I get what you want, but I'm not sure myself how to achieve it in a JSON-LD-compliant manner.