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 09040f9..acdd7cc 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 @@ -45,7 +45,7 @@ CONSTRUCT { ?temporalNative aoprop:periodName ?temporalNativePeriodName . ?temporalNative aoprop:from ?temporalFrom . ?temporalNative aoprop:until ?temporalUntil . -?temporalNative aoprop:uri ?temporalNative . +?temporalNative aoprop:uri ?temporalPeriodO . %record aoprop:archeologicalResourceType ?archeologicalResourceType . ?archeologicalResourceType aoprop:name ?archeologicalResourceTypeName . %record aoprop:resourceType ?resourceType . @@ -98,15 +98,22 @@ where { optional { %record aocat:has_landing_page / rdfs:label ?landingPage . } - optional { + + { + select * + where { %record aocat:has_temporal_coverage ?temporalCoverage . ?temporalCoverage aocat:has_native_period ?temporalNative . ?temporalNative skos:prefLabel ?temporalNativePeriodName . optional { - ?temporalCoverage aocat:from ?temporalFrom . - ?temporalCoverage aocat:until ?temporalUntil . + ?temporalCoverage aocat:has_period ?temporalPeriodO . + optional { + ?temporalCoverage aocat:from ?temporalFrom . + ?temporalCoverage aocat:until ?temporalUntil . + } } } + } { select * 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 8a098ba..3bc5c4a 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 @@ -21,7 +21,7 @@ import java.util.Properties; * @author enrico.ottonello * */ -@Ignore +//@Ignore public class GraphDbReaderAndESIndexTest { private RunSPARQLQueryService runSPQRLQuery; @@ -62,12 +62,12 @@ public class GraphDbReaderAndESIndexTest { queryTemplateResource = new ClassPathResource("eu/dnetlib/ariadneplus/sparql/read_record_data_template.sparql"); } else { - recordId = "https://ariadne-infrastructure.eu/aocat/Collection/ADS/371CCB1B-A7B6-3CC8-B341-36049515B47E"; + recordId = "https://ariadne-infrastructure.eu/aocat/Collection/HNM/0F1AF07E-CE63-342C-8E95-11FF1C024BD5"; queryTemplateResource = new ClassPathResource("eu/dnetlib/ariadneplus/sparql/read_collection_data_template.sparql"); } - String datasource = "ads"; - String collectionId = "272_monument"; + String datasource = "hnm"; + String collectionId = "hnmad"; List recordIds = Arrays.asList(recordId); String queryTemplate = IOUtils.toString(queryTemplateResource.getInputStream(), StandardCharsets.UTF_8.name()); if (testRecord) {