From 702e07521103166eb861d3aaa6e3357d7f71eeee Mon Sep 17 00:00:00 2001 From: Martynas Date: Mon, 30 Oct 2023 01:00:35 +0100 Subject: [PATCH] Actually use `POST` instead of `PUT` when graph already exists... --- .../imports/stream/csv/CSVGraphStoreRowProcessor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/atomgraph/linkeddatahub/imports/stream/csv/CSVGraphStoreRowProcessor.java b/src/main/java/com/atomgraph/linkeddatahub/imports/stream/csv/CSVGraphStoreRowProcessor.java index 088746767..9e244ed6b 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/imports/stream/csv/CSVGraphStoreRowProcessor.java +++ b/src/main/java/com/atomgraph/linkeddatahub/imports/stream/csv/CSVGraphStoreRowProcessor.java @@ -98,7 +98,7 @@ public void rowProcessed(String[] row, ParsingContext context) } /** - * Forwards POST request to a graph. + * Creates a graph using PUT if it doesn't exist, otherwise appends data using POST. * * @param entity request entity * @param graphURI the graph URI @@ -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)) {