Search in sources :

Example 1 with BroadMatch

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"));
}
Also used : Concept(eu.europeana.metis.schema.jibx.Concept) RelatedMatch(eu.europeana.metis.schema.jibx.RelatedMatch) Broader(eu.europeana.metis.schema.jibx.Broader) Choice(eu.europeana.metis.schema.jibx.Concept.Choice) CloseMatch(eu.europeana.metis.schema.jibx.CloseMatch) ArrayList(java.util.ArrayList) ExactMatch(eu.europeana.metis.schema.jibx.ExactMatch) Related(eu.europeana.metis.schema.jibx.Related) BroadMatch(eu.europeana.metis.schema.jibx.BroadMatch) RDF(eu.europeana.metis.schema.jibx.RDF) Note(eu.europeana.metis.schema.jibx.Note) ProxyType(eu.europeana.metis.schema.jibx.ProxyType) NarrowMatch(eu.europeana.metis.schema.jibx.NarrowMatch) Test(org.junit.jupiter.api.Test)

Aggregations

BroadMatch (eu.europeana.metis.schema.jibx.BroadMatch)1 Broader (eu.europeana.metis.schema.jibx.Broader)1 CloseMatch (eu.europeana.metis.schema.jibx.CloseMatch)1 Concept (eu.europeana.metis.schema.jibx.Concept)1 Choice (eu.europeana.metis.schema.jibx.Concept.Choice)1 ExactMatch (eu.europeana.metis.schema.jibx.ExactMatch)1 NarrowMatch (eu.europeana.metis.schema.jibx.NarrowMatch)1 Note (eu.europeana.metis.schema.jibx.Note)1 ProxyType (eu.europeana.metis.schema.jibx.ProxyType)1 RDF (eu.europeana.metis.schema.jibx.RDF)1 Related (eu.europeana.metis.schema.jibx.Related)1 RelatedMatch (eu.europeana.metis.schema.jibx.RelatedMatch)1 ArrayList (java.util.ArrayList)1 Test (org.junit.jupiter.api.Test)1