From 61abf9b51edb7f59a57b90bf0b49db740e8f1a11 Mon Sep 17 00:00:00 2001 From: Enrico Ottonello Date: Mon, 6 Sep 2021 16:39:19 +0200 Subject: [PATCH] fix native period informations for collection --- .../sparql/read_collection_data_template.sparql | 11 ++++++++--- .../ariadneplus/GraphDbReaderAndESIndexTest.java | 10 ++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/read_collection_data_template.sparql b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/read_collection_data_template.sparql index e74a01a..865042a 100644 --- a/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/read_collection_data_template.sparql +++ b/dnet-ariadneplus-graphdb-publisher/src/main/resources/eu/dnetlib/ariadneplus/sparql/read_collection_data_template.sparql @@ -112,15 +112,20 @@ where { optional { graph { %record aocat:has_temporal_coverage ?temporalNative . - ?temporalNative aocat:has_native_period / skos:prefLabel ?temporalNativePeriodName . - } - graph { + ?temporalNative aocat:has_native_period ?p . + ?p skos:prefLabel | rdfs:label ?temporalNativePeriodName . optional { ?temporalNative aocat:from ?temporalNativeFrom . ?temporalNative aocat:until ?temporalNativeUntil . } } } + } + } + + { + select * + where { graph { optional { %record aocat:has_temporal_coverage ?temporal . diff --git a/dnet-ariadneplus-graphdb-publisher/test/java/eu/dnetlib/ariadneplus/GraphDbReaderAndESIndexTest.java b/dnet-ariadneplus-graphdb-publisher/test/java/eu/dnetlib/ariadneplus/GraphDbReaderAndESIndexTest.java index 56afa53..618946b 100644 --- a/dnet-ariadneplus-graphdb-publisher/test/java/eu/dnetlib/ariadneplus/GraphDbReaderAndESIndexTest.java +++ b/dnet-ariadneplus-graphdb-publisher/test/java/eu/dnetlib/ariadneplus/GraphDbReaderAndESIndexTest.java @@ -271,6 +271,16 @@ public class GraphDbReaderAndESIndexTest { readAndIndexTest(isRecord, recordId, datasource, collectionId); } + @Test +// @Ignore + public void uploadINFNTest() throws Exception { + boolean isRecord = false; + String recordId = "https://ariadne-infrastructure.eu/aocat/Collection/INFN/5AE70226-82A9-3B06-9E25-8FB71B64C51C"; + String datasource = "infn"; + String collectionId = "firenze"; + readAndIndexTest(isRecord, recordId, datasource, collectionId); + } + private void readAndIndexTest(boolean isRecord, String recordId, String datasource, String collectionId) throws Exception { final ClassPathResource resource = new ClassPathResource("application.properties"); Properties appProps = new Properties();