Skip to content

Commit

Permalink
Call getDatasetAccessor() instead of super
Browse files Browse the repository at this point in the history
  • Loading branch information
namedgraph committed Oct 19, 2023
1 parent 5a5d74d commit d814f2f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/main/java/com/atomgraph/linkeddatahub/resource/graph/Item.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,12 @@ public Response post(Model model, @QueryParam("default") @DefaultValue("false")
// container/item (graph) resource is already skolemized, skolemize the rest of the model
new Skolemizer(getURI().toString()).apply(model);

return super.post(model, false, getURI());
// is this implemented correctly? The specification is not very clear.
if (log.isDebugEnabled()) log.debug("POST Model to named graph with URI: {} Did it already exist? {}", getURI(), existingGraph);
getDatasetAccessor().add(getURI().toString(), model);

if (existingGraph) return Response.ok().build();
else return Response.created(getURI()).build();
}

@Override
Expand Down Expand Up @@ -191,7 +196,11 @@ public Response put(Model model, @QueryParam("default") @DefaultValue("false") B

new Skolemizer(getURI().toString()).apply(model);

return super.put(model, false, getURI());
if (log.isDebugEnabled()) log.debug("PUT Model to named graph with URI: {} Did it already exist? {}", getURI(), existingGraph);
getDatasetAccessor().putModel(getURI().toString(), model);

if (existingGraph) return Response.ok().build();
else return Response.created(getURI()).build();
}

/**
Expand Down

0 comments on commit d814f2f

Please sign in to comment.