added periodO uri info to retrieved collection data

This commit is contained in:
Enrico Ottonello 2020-10-12 11:04:19 +02:00
parent 0867cf3ab2
commit ab0d99f503
2 changed files with 15 additions and 8 deletions

View File

@ -45,7 +45,7 @@ CONSTRUCT {
?temporalNative aoprop:periodName ?temporalNativePeriodName . ?temporalNative aoprop:periodName ?temporalNativePeriodName .
?temporalNative aoprop:from ?temporalFrom . ?temporalNative aoprop:from ?temporalFrom .
?temporalNative aoprop:until ?temporalUntil . ?temporalNative aoprop:until ?temporalUntil .
?temporalNative aoprop:uri ?temporalNative . ?temporalNative aoprop:uri ?temporalPeriodO .
%record aoprop:archeologicalResourceType ?archeologicalResourceType . %record aoprop:archeologicalResourceType ?archeologicalResourceType .
?archeologicalResourceType aoprop:name ?archeologicalResourceTypeName . ?archeologicalResourceType aoprop:name ?archeologicalResourceTypeName .
%record aoprop:resourceType ?resourceType . %record aoprop:resourceType ?resourceType .
@ -98,15 +98,22 @@ where {
optional { optional {
%record aocat:has_landing_page / rdfs:label ?landingPage . %record aocat:has_landing_page / rdfs:label ?landingPage .
} }
optional {
{
select *
where {
%record aocat:has_temporal_coverage ?temporalCoverage . %record aocat:has_temporal_coverage ?temporalCoverage .
?temporalCoverage aocat:has_native_period ?temporalNative . ?temporalCoverage aocat:has_native_period ?temporalNative .
?temporalNative skos:prefLabel ?temporalNativePeriodName . ?temporalNative skos:prefLabel ?temporalNativePeriodName .
optional { optional {
?temporalCoverage aocat:from ?temporalFrom . ?temporalCoverage aocat:has_period ?temporalPeriodO .
?temporalCoverage aocat:until ?temporalUntil . optional {
?temporalCoverage aocat:from ?temporalFrom .
?temporalCoverage aocat:until ?temporalUntil .
}
} }
} }
}
{ {
select * select *

View File

@ -21,7 +21,7 @@ import java.util.Properties;
* @author enrico.ottonello * @author enrico.ottonello
* *
*/ */
@Ignore //@Ignore
public class GraphDbReaderAndESIndexTest { public class GraphDbReaderAndESIndexTest {
private RunSPARQLQueryService runSPQRLQuery; private RunSPARQLQueryService runSPQRLQuery;
@ -62,12 +62,12 @@ public class GraphDbReaderAndESIndexTest {
queryTemplateResource = new ClassPathResource("eu/dnetlib/ariadneplus/sparql/read_record_data_template.sparql"); queryTemplateResource = new ClassPathResource("eu/dnetlib/ariadneplus/sparql/read_record_data_template.sparql");
} }
else { 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"); queryTemplateResource = new ClassPathResource("eu/dnetlib/ariadneplus/sparql/read_collection_data_template.sparql");
} }
String datasource = "ads"; String datasource = "hnm";
String collectionId = "272_monument"; String collectionId = "hnmad";
List<String> recordIds = Arrays.asList(recordId); List<String> recordIds = Arrays.asList(recordId);
String queryTemplate = IOUtils.toString(queryTemplateResource.getInputStream(), StandardCharsets.UTF_8.name()); String queryTemplate = IOUtils.toString(queryTemplateResource.getInputStream(), StandardCharsets.UTF_8.name());
if (testRecord) { if (testRecord) {