use of eu.europeana.enrichment.api.external.model.LabelResource in project metis-framework by europeana.
the class EntityMergeEngineTest method createPlace.
private static Place createPlace() {
Place place = new Place();
place.setAbout("aboutP0");
place.setAlt("123.456");
Label label1 = new Label("labelP1");
Label label2 = new Label("langP2", "labelP2");
place.setAltLabelList(List.of(label1, label2));
LabelResource part1 = new LabelResource("partP1");
place.setHasPartsList(List.of(part1));
LabelResource part2 = new LabelResource("partP2");
place.setIsPartOf(List.of(part2));
place.setLat("12.34");
place.setLon("43.21");
Label label3 = new Label("labelP3");
place.setNotes(List.of(label3));
Label label4 = new Label("langP4", "labelP4");
place.setPrefLabelList(List.of(label4));
Part part3 = new Part("partP3");
Part part4 = new Part("partP4");
place.setSameAs(List.of(part3, part4));
return place;
}
use of eu.europeana.enrichment.api.external.model.LabelResource in project metis-framework by europeana.
the class ItemExtractorUtilsTest method testExtractLabelResourceWithoutValue.
@Test
void testExtractLabelResourceWithoutValue() {
LabelResource label = new LabelResource("lang1", null);
label.setResource("resource1");
ResourceOrLiteralType output = ItemExtractorUtils.extractLabelResource(label, ResourceOrLiteralType::new);
assertNotNull(output);
assertEquals("", output.getString());
assertEquals("lang1", output.getLang().getLang());
assertEquals("resource1", output.getResource().getResource());
}
use of eu.europeana.enrichment.api.external.model.LabelResource in project metis-framework by europeana.
the class EnrichmentControllerTest method getTimespan.
private TimeSpan getTimespan() {
final TimeSpan timespan = new TimeSpan();
timespan.setAbout("http://timespan.org");
List<Label> altLabels = new ArrayList<>();
altLabels.add(new Label("en", "labelEn"));
altLabels.add(new Label("nl", "labelNl"));
timespan.setAltLabelList(altLabels);
timespan.setIsPartOf(List.of(new LabelResource("http://timespan_is_part.org")));
return timespan;
}
use of eu.europeana.enrichment.api.external.model.LabelResource in project metis-framework by europeana.
the class EnrichmentControllerTest method getPlace.
private Place getPlace() {
final Place place = new Place();
place.setAbout("http://place.org");
List<Label> altLabels = new ArrayList<>();
altLabels.add(new Label("en", "labelEn"));
altLabels.add(new Label("nl", "labelNl"));
place.setAltLabelList(altLabels);
place.setIsPartOf(List.of(new LabelResource("http://place_is_part.org")));
return place;
}
use of eu.europeana.enrichment.api.external.model.LabelResource in project metis-framework by europeana.
the class Converter method convertTimespan.
private static TimeSpan convertTimespan(TimespanEnrichmentEntity timespanEnrichmentEntity) {
TimeSpan output = new TimeSpan();
output.setAbout(timespanEnrichmentEntity.getAbout());
output.setPrefLabelList(convert(timespanEnrichmentEntity.getPrefLabel()));
output.setAltLabelList(convert(timespanEnrichmentEntity.getAltLabel()));
output.setBegin(convert(timespanEnrichmentEntity.getBegin()).get(0));
output.setEnd(convert(timespanEnrichmentEntity.getEnd()).get(0));
output.setHasPartsList(convertResourceOrLiteral(timespanEnrichmentEntity.getDctermsHasPart()));
output.setHiddenLabel(convert(timespanEnrichmentEntity.getHiddenLabel()));
output.setNotes(convert(timespanEnrichmentEntity.getNote()));
output.setSameAs(convertToPartsList(timespanEnrichmentEntity.getOwlSameAs()));
if (StringUtils.isNotBlank(timespanEnrichmentEntity.getIsPartOf())) {
output.setIsPartOf(List.of(new LabelResource(timespanEnrichmentEntity.getIsPartOf())));
}
if (StringUtils.isNotBlank(timespanEnrichmentEntity.getIsNextInSequence())) {
output.setIsNextInSequence(new Part(timespanEnrichmentEntity.getIsNextInSequence()));
}
return output;
}
Aggregations