I've never tried to do something like this with the API but it should be possible. I would probably recommend not using SparqlView
implementations unless the criteria for what data can be seen by each user is only expressible as a SPARQL query, a SparqlView
is fairly expensive in memory terms since it takes a copy of the original data and is not currently a direct view over the underlying data (theoretically this is possible but would require a lot more coding and would trade off lower memory usage for performance).
From what you have described I would suggest the best approach might be to use a custom ISparqlDataset
implementation, likely deriving from the decorator WrapperDataset
. This way you can intercept all the calls that SPARQL queries will make and restrict exactly what each instance is able to retrieve. This way you can have a single store which is the underlying data and a wrapper for each user which provides their view onto that data.
If you do this one thing you will want to be careful of is thread safety, if the underlying dataset you will be wrapping does not implement IThreadSafeDataset
then you will need to ensure that all your wrappers override the Lock
property and use a shared lock as otherwise you could have problems.