From 220c6be6dbc8b2f6cbc16d5e986bc8ba76a8f9f7 Mon Sep 17 00:00:00 2001 From: Enrico Ottonello Date: Fri, 24 Jul 2020 13:15:27 +0200 Subject: [PATCH] report returned to wf node --- .../eu/dnetlib/ariadneplus/graphdb/GraphDBClient.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dnet-ariadneplus-graphdb-publisher/src/main/java/eu/dnetlib/ariadneplus/graphdb/GraphDBClient.java b/dnet-ariadneplus-graphdb-publisher/src/main/java/eu/dnetlib/ariadneplus/graphdb/GraphDBClient.java index ddcfe51..40312b4 100644 --- a/dnet-ariadneplus-graphdb-publisher/src/main/java/eu/dnetlib/ariadneplus/graphdb/GraphDBClient.java +++ b/dnet-ariadneplus-graphdb-publisher/src/main/java/eu/dnetlib/ariadneplus/graphdb/GraphDBClient.java @@ -334,6 +334,8 @@ public class GraphDBClient { } public String indexOnES(String datasource, String collectionId) throws AriadnePlusPublisherException { + String recordsIndexReport = ""; + String collectionIndexReport = ""; try { log.info("Start indexing from "+ datasource + " " + collectionId); runSPQRLQuery.setupConnection( getWriterUser(), getWriterPwd(), this.graphDBServerUrl, getRepository()); @@ -344,16 +346,16 @@ public class GraphDBClient { final ClassPathResource queryTemplateResource = new ClassPathResource("eu/dnetlib/ariadneplus/sparql/read_record_data_template.sparql"); String queryTemplate = IOUtils.toString(queryTemplateResource.getInputStream(), StandardCharsets.UTF_8.name()); boolean isCollection = false; - runSPQRLQuery.executeMultipleQueryGraph(queryTemplate, recordIds, datasource, collectionId, isCollection); + recordsIndexReport = runSPQRLQuery.executeMultipleQueryGraph(queryTemplate, recordIds, datasource, collectionId, isCollection); List collectionResourceId = runSPQRLQuery.selectCollectionId(datasource, collectionId); final ClassPathResource selectCollectionTemplateRes = new ClassPathResource("eu/dnetlib/ariadneplus/sparql/read_collection_data_template.sparql"); String selectCollectionTemplate = IOUtils.toString(selectCollectionTemplateRes.getInputStream(), StandardCharsets.UTF_8.name()); isCollection = true; - runSPQRLQuery.executeMultipleQueryGraph(selectCollectionTemplate, collectionResourceId, datasource, collectionId, isCollection); + collectionIndexReport = runSPQRLQuery.executeMultipleQueryGraph(selectCollectionTemplate, collectionResourceId, datasource, collectionId, isCollection); }catch(Throwable e){ log.error(e); throw new AriadnePlusPublisherException(e); } - return "ok"; + return "Records: ".concat(recordsIndexReport).concat(" Collection: ").concat(collectionIndexReport); } }