Closed michielbdejong closed 4 years ago
The interface of TripleStore on page 4 seems very narrow.
Indeed; only methods relevant to LDP are shown.
It is expected that TripleStore
implements more interfaces, which can be useful for queries. But they don't matter at this point.
indexing quads and performing queries over them (
DataSet.match
in rdf.js) would probably have to be implemented a second time inside AclBasedAuthorizer?
At the first level, yes. But this is on purpose, since AclBasedAuthorizer
needs to work with ResourceStore
in general, so also file-based systems like FileSystemStore
that do not have native query interfaces.
At the second level, nothing stops us from building a subclass of AclBasedAuthorizer
that has an optimization for when the ResourceStore
does implement a more expressive interface.
Again, good reason for managing complexity by having dedicated components. Then at runtime, a more specific AclBasedAuthorizer
implementation can be chosen without impacting any other component.
There's an additional solution path: ResourceStore
enables a decorator pattern such that RepresentationConvertingStore
can be put in front of another ResourceStore
and then to arbitrary conversions.
This was intended for forward conversion as follows. Given a source that only supports raw triple streams, and a request for JSON-LD, then a RepresentationConvertingStore
would make a request to that source and use an convertor to transform it into JSON-LD.
However, we could also perform the reverse operation: AclBasedAuthorizer
could indicate its preference for raw triples, and RepresentationConvertingStore
would then perform any conversion needed.
So then we have a stream of triples, on which the ACL operations are easy to perform. We can just use Comunica to perform the SPARQL query directly on the stream.
Resolving this for now; can be reopened if new concerns arrive.
The interface of TripleStore on page 4 seems very narrow. In particular, indexing quads and performing queries over them (
DataSet.match
in rdf.js) would probably have to be implemented a second time inside AclBasedAuthorizer?