Skip to content

Commit

Permalink
Actually use POST instead of PUT when graph already exists...
Browse files Browse the repository at this point in the history
  • Loading branch information
namedgraph committed Oct 30, 2023
1 parent bf177ec commit 702e075
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void rowProcessed(String[] row, ParsingContext context)
}

/**
* Forwards <code>POST</code> request to a graph.
* Creates a graph using <code>PUT</code> if it doesn't exist, otherwise appends data using <code>POST</code>.
*
* @param entity request entity
* @param graphURI the graph URI
Expand All @@ -110,7 +110,7 @@ protected Response add(Entity entity, String graphURI)
{
if (headResponse.getStatus() == Response.Status.OK.getStatusCode()) // POST if graph already exists
{
try (Response cr = getLinkedDataClient().put(URI.create(graphURI), getLinkedDataClient().getReadableMediaTypes(Model.class), entity))
try (Response cr = getLinkedDataClient().post(URI.create(graphURI), getLinkedDataClient().getReadableMediaTypes(Model.class), entity))
{
if (!cr.getStatusInfo().getFamily().equals(Response.Status.Family.SUCCESSFUL))
{
Expand Down

0 comments on commit 702e075

Please sign in to comment.