CommunitySolidServer icon indicating copy to clipboard operation
CommunitySolidServer copied to clipboard

Handle unknown identifier when converting data

Open joachimvh opened this issue 4 years ago • 0 comments

As discussed in https://github.com/solid/community-server/pull/279#discussion_r509135299.

It can happen that a RepresentationConverter is called before the ResourceIdentifier of a resource is known, even though it is required as input parameter. In most cases this is not going to be relevant, but it is an issue if the representation is for example a turtle document containing <> and no base iri has been set in the document.

We could use some sort of dummy URI constant of which it is known that it needs to be replaced with the identifier once that one is known. This would require string matching though, since we can have URIs relative to the base (e.g., <#id>).

Another solution would be to somehow call ahead to the store and ask what the identifier would be if this resource would be created.

This is mostly relevant for the sparql store (and other future stores that do not support binary input), since the file and memory store will just store the original turtle, thereby avoiding this problem.

joachimvh avatar Oct 30 '20 14:10 joachimvh