Skip to content

Commit

Permalink
skolemize before writing files in postMultipart() and `putMultipart…
Browse files Browse the repository at this point in the history
…()` (files require absolute URIs)
  • Loading branch information
namedgraph committed Oct 19, 2023
1 parent e1bb1e4 commit 8cbabaa
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ public Response postMultipart(FormDataMultiPart multiPart, @QueryParam("default"
final boolean existingGraph = getDatasetAccessor().containsModel(getURI().toString());
if (!existingGraph) throw new NotFoundException("Named graph with URI <" + getURI() + "> not found");

new Skolemizer(getURI().toString()).apply(model); // skolemize before writing files (they require absolute URIs)

int fileCount = writeFiles(model, getFileNameBodyPartMap(multiPart));
if (log.isDebugEnabled()) log.debug("# of files uploaded: {} ", fileCount);

Expand Down Expand Up @@ -322,6 +324,8 @@ public Response putMultipart(FormDataMultiPart multiPart, @QueryParam("default")
if (reader instanceof ValidatingModelProvider validatingModelProvider) model = validatingModelProvider.processRead(model);
if (log.isDebugEnabled()) log.debug("POSTed Model size: {}", model.size());

new Skolemizer(getURI().toString()).apply(model); // skolemize before writing files (they require absolute URIs)

int fileCount = writeFiles(model, getFileNameBodyPartMap(multiPart));
if (log.isDebugEnabled()) log.debug("# of files uploaded: {} ", fileCount);

Expand Down

0 comments on commit 8cbabaa

Please sign in to comment.