added digitalImage support
This commit is contained in:
parent
6c8c9fcba3
commit
8944977a17
|
@ -86,6 +86,14 @@ public class BulkUpload {
|
|||
}
|
||||
else {
|
||||
ace.setResourceType("dataset");
|
||||
if (ace.getDigitalImage()!=null) {
|
||||
ace.getDigitalImage()
|
||||
.stream()
|
||||
.filter(i -> i.getProviderUri()!=null)
|
||||
.forEach(i -> {
|
||||
i.setPrimary("true");
|
||||
});
|
||||
}
|
||||
if (ace.getSpatial()!=null) {
|
||||
ace.getSpatial()
|
||||
.stream()
|
||||
|
|
|
@ -33,7 +33,7 @@ public class AriadnePlusEntry {
|
|||
private String title;
|
||||
private List<NativePeriod> nativePeriod;
|
||||
private String wasCreated;
|
||||
private DigitalImage digitalImage;
|
||||
private List<DigitalImage> digitalImage;
|
||||
|
||||
private transient String uniqueIsPartOf;
|
||||
private transient String typeURI;
|
||||
|
@ -262,14 +262,6 @@ public class AriadnePlusEntry {
|
|||
this.ariadneSubject = ariadneSubject;
|
||||
}
|
||||
|
||||
public DigitalImage getDigitalImage() {
|
||||
return digitalImage;
|
||||
}
|
||||
|
||||
public void setDigitalImage(DigitalImage digitalImage) {
|
||||
this.digitalImage = digitalImage;
|
||||
}
|
||||
|
||||
public List<NativePeriod> getNativePeriod() {
|
||||
return nativePeriod;
|
||||
}
|
||||
|
@ -302,6 +294,14 @@ public class AriadnePlusEntry {
|
|||
this.is_about = is_about;
|
||||
}
|
||||
|
||||
public List<DigitalImage> getDigitalImage() {
|
||||
return digitalImage;
|
||||
}
|
||||
|
||||
public void setDigitalImage(List<DigitalImage> digitalImage) {
|
||||
this.digitalImage = digitalImage;
|
||||
}
|
||||
|
||||
public String toJson(){
|
||||
return new Gson().toJson(this);
|
||||
}
|
||||
|
|
|
@ -18,6 +18,21 @@ general.classpath=eu.dnetlib.ariadneplus.elasticsearch.model.
|
|||
type.path=https://www.ariadne-infrastructure.eu/property/rdfType
|
||||
exclude.predicates=["https://www.ariadne-infrastructure.eu/property/resourceType", "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", "https://www.ariadne-infrastructure.eu/property/rdfType"]
|
||||
class.map.specifications={\
|
||||
"DigitalImage": {\
|
||||
"class_type": "prototype",\
|
||||
"mappings": {\
|
||||
"https://www.ariadne-infrastructure.eu/property/primaryVisualComponent": {\
|
||||
"class_field": "ProviderUri",\
|
||||
"substring": "no",\
|
||||
"element_type": "java.lang.String"\
|
||||
},\
|
||||
"https://www.ariadne-infrastructure.eu/property/visualComponent": {\
|
||||
"class_field": "AriadneUri",\
|
||||
"substring": "no",\
|
||||
"element_type": "java.lang.String"\
|
||||
}\
|
||||
}\
|
||||
},\
|
||||
"AriadneResource": {\
|
||||
"class_type": "prototype",\
|
||||
"mappings": {\
|
||||
|
@ -395,6 +410,11 @@ class.map.specifications={\
|
|||
"class_field": "Is_about",\
|
||||
"substring": "no",\
|
||||
"external_reference": "AriadneResource"\
|
||||
},\
|
||||
"https://www.ariadne-infrastructure.eu/property/image": {\
|
||||
"class_field": "DigitalImage",\
|
||||
"substring": "no",\
|
||||
"external_reference": "DigitalImage"\
|
||||
}\
|
||||
}\
|
||||
}\
|
||||
|
|
|
@ -93,6 +93,9 @@ CONSTRUCT {
|
|||
%record aoprop:title ?title .
|
||||
%record aoprop:description ?description .
|
||||
%record aoprop:language ?language .
|
||||
%record aoprop:image ?primaryVisualComponent .
|
||||
?primaryVisualComponent aoprop:primaryVisualComponent ?primaryVisualComponent .
|
||||
?primaryVisualComponent aoprop:visualComponent ?visualComponent .
|
||||
}
|
||||
where {
|
||||
graph <https://ariadne-infrastructure.eu/api_________::ariadne_plus::%datasource::%collectionId> {
|
||||
|
@ -121,6 +124,12 @@ where {
|
|||
optional {
|
||||
%record aocat:has_landing_page / rdfs:label ?landingPage .
|
||||
}
|
||||
optional {
|
||||
%record aocat:has_primary_visual_component ?primaryVisualComponent .
|
||||
}
|
||||
optional {
|
||||
%record aocat:has_visual_component ?visualComponent .
|
||||
}
|
||||
}
|
||||
|
||||
optional {
|
||||
|
|
|
@ -243,11 +243,11 @@ public class GraphDbReaderAndESIndexTest {
|
|||
|
||||
@Test
|
||||
// @Ignore
|
||||
public void uploadADSIsAboutTest() throws Exception {
|
||||
public void uploadDIMEDigitalImageTest() throws Exception {
|
||||
boolean isRecord = true;
|
||||
String recordId = "https://ariadne-infrastructure.eu/aocat/Resource/DCDF395A-2CC8-3FC2-B9A5-5A924090DF10";
|
||||
String datasource = "ads";
|
||||
String collectionId = "3";
|
||||
String recordId = "https://ariadne-infrastructure.eu/aocat/Resource/DIME/F9398BD5-DECB-3FF5-8077-D96893D0D0C6";
|
||||
String datasource = "aarhusdime";
|
||||
String collectionId = "test";
|
||||
readAndIndexTest(isRecord, recordId, datasource, collectionId);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue