added multiple descriptions for arup

This commit is contained in:
Enrico Ottonello 2021-04-02 12:46:07 +02:00
parent a3cb6201dc
commit 5682cc4bd2
3 changed files with 34 additions and 3 deletions

View File

@ -7,6 +7,7 @@ import java.util.ArrayList;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
@ -124,7 +125,14 @@ public class ResourceManager {
if (!map.hasExternalReference()){ if (!map.hasExternalReference()){
Method setField = c.getMethod("set" + map.getClass_field(), Class.forName(map.getElement_type())); Method setField = c.getMethod("set" + map.getClass_field(), Class.forName(map.getElement_type()));
setField.invoke(class_instance, getFieldValue(values.get(0))); if (map.getClass_field().equals("Description")) {
setField.invoke(class_instance, values.stream().map(value -> {
return getFieldValue(value);
}).collect(Collectors.joining(" \n")));
}
else {
setField.invoke(class_instance, getFieldValue(values.get(0)));
}
} }
else{ else{
if(propertiesMap.get(map.getExternal_reference()).getClass_type().equals("prototype")){ if(propertiesMap.get(map.getExternal_reference()).getClass_type().equals("prototype")){

View File

@ -537,6 +537,20 @@ WHERE {
?record aocat:is_about ?document . ?record aocat:is_about ?document .
}; };
PREFIX aocat: <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
INSERT {
GRAPH <https://ariadne-infrastructure.eu/api_________::ariadne_plus::amcr::oai> {
?record aocat:has_creator ?creator .
}
}
USING <https://ariadne-infrastructure.eu/api_________::ariadne_plus::amcr::oai>
WHERE {
?record aocat:is_about ?about .
?about rdf:type aocat:AO_Document .
?about aocat:has_creator ?creator .
};
PREFIX aocat: <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/> PREFIX aocat: <https://www.ariadne-infrastructure.eu/resource/ao/cat/1.1/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX skos: <http://www.w3.org/2004/02/skos/core#>

View File

@ -32,7 +32,6 @@ public class GraphDbReaderAndESIndexTest {
private RunSPARQLQueryService runSPQRLQuery; private RunSPARQLQueryService runSPQRLQuery;
@Test @Test
@Ignore
public void uploadAMCRFieldworkTest() throws Exception { public void uploadAMCRFieldworkTest() throws Exception {
boolean isRecord = true; boolean isRecord = true;
String recordId = "https://ariadne-infrastructure.eu/aocat/Resource/AMCR/E61E0F4E-268F-39E4-8EDB-A431AFC505AA"; String recordId = "https://ariadne-infrastructure.eu/aocat/Resource/AMCR/E61E0F4E-268F-39E4-8EDB-A431AFC505AA";
@ -42,7 +41,6 @@ public class GraphDbReaderAndESIndexTest {
} }
@Test @Test
@Ignore
public void uploadAMCRDocumentTest() throws Exception { public void uploadAMCRDocumentTest() throws Exception {
boolean isRecord = true; boolean isRecord = true;
String recordId = "https://ariadne-infrastructure.eu/aocat/Collection/AMCR/FC59581D-DC3A-31DA-922A-98DE764F3D76"; String recordId = "https://ariadne-infrastructure.eu/aocat/Collection/AMCR/FC59581D-DC3A-31DA-922A-98DE764F3D76";
@ -61,6 +59,16 @@ public class GraphDbReaderAndESIndexTest {
readAndIndexTest(isRecord, recordId, datasource, collectionId); readAndIndexTest(isRecord, recordId, datasource, collectionId);
} }
@Test
@Ignore
public void uploadAMCRIndividualFindTest() throws Exception {
boolean isRecord = true;
String recordId = "https://ariadne-infrastructure.eu/aocat/Resource/AMCR/98D717C4-410F-35C6-8072-FABA7686B4A3";
String datasource = "amcr";
String collectionId = "oai";
readAndIndexTest(isRecord, recordId, datasource, collectionId);
}
@Test @Test
@Ignore @Ignore
public void uploadADSRecordTest() throws Exception { public void uploadADSRecordTest() throws Exception {
@ -122,6 +130,7 @@ public class GraphDbReaderAndESIndexTest {
} }
@Test @Test
@Ignore
public void uploadADSArchivesBoundingBoxTest() throws Exception { public void uploadADSArchivesBoundingBoxTest() throws Exception {
boolean isRecord = true; boolean isRecord = true;
String recordId = "https://ariadne-infrastructure.eu/aocat/Resource/90D1C95D-E249-3E74-92D9-B58FDF690CC7"; String recordId = "https://ariadne-infrastructure.eu/aocat/Resource/90D1C95D-E249-3E74-92D9-B58FDF690CC7";