use of eu.europeana.metis.schema.jibx.BroadMatch in project metis-framework by europeana.
the class DereferenceUtilsTest method testConceptListExtractedValues.
@Test
void testConceptListExtractedValues() {
RDF rdf = new RDF();
ProxyType proxy = new ProxyType();
ArrayList<ProxyType> proxyList = new ArrayList<>();
proxyList.add(proxy);
rdf.setProxyList(proxyList);
Concept concept = new Concept();
concept.setAbout("http://dummy1.dum");
Choice choice1 = new Choice();
BroadMatch broadMatch = new BroadMatch();
broadMatch.setResource("http://dummy2.dum");
choice1.setBroadMatch(broadMatch);
Choice choice2 = new Choice();
CloseMatch closeMatch = new CloseMatch();
closeMatch.setResource("http://dummy3.dum");
choice2.setCloseMatch(closeMatch);
Choice choice3 = new Choice();
ExactMatch exactMatch = new ExactMatch();
exactMatch.setResource("http://dummy4.dum");
choice3.setExactMatch(exactMatch);
Choice choice4 = new Choice();
NarrowMatch narrowMatch = new NarrowMatch();
narrowMatch.setResource("http://dummy5.dum");
choice4.setNarrowMatch(narrowMatch);
Choice choice5 = new Choice();
RelatedMatch relatedMatch = new RelatedMatch();
relatedMatch.setResource("http://dummy6.dum");
choice5.setRelatedMatch(relatedMatch);
Choice choice6 = new Choice();
Related related = new Related();
related.setResource("http://dummy7.dum");
choice6.setRelated(related);
Choice choice7 = new Choice();
Broader broader = new Broader();
broader.setResource("http://dummy8.dum");
choice7.setBroader(broader);
Choice choice8 = new Choice();
Note note = new Note();
note.setString("Note");
choice8.setNote(note);
ArrayList<Choice> choiceList = new ArrayList<>();
choiceList.add(choice1);
choiceList.add(choice2);
choiceList.add(choice3);
choiceList.add(choice4);
choiceList.add(choice5);
choiceList.add(choice6);
choiceList.add(choice7);
concept.setChoiceList(choiceList);
ArrayList<Concept> conceptList = new ArrayList<>();
conceptList.add(concept);
rdf.setConceptList(conceptList);
Set<String> result = DereferenceUtils.extractReferencesForDereferencing(rdf);
assertNotNull(result);
assertEquals(1, result.size());
assertTrue(result.contains("http://dummy8.dum"));
}
Aggregations