Search in sources :

Example 1 with BitRate

use of eu.europeana.metis.schema.jibx.BitRate in project metis-framework by europeana.

the class DereferenceUtilsTest method testWebResourceListExtractedValues.

@Test
void testWebResourceListExtractedValues() {
    RDF rdf = new RDF();
    ProxyType proxy = new ProxyType();
    ArrayList<ProxyType> proxyList = new ArrayList<>();
    proxyList.add(proxy);
    rdf.setProxyList(proxyList);
    WebResourceType webResource = new WebResourceType();
    Created created = new Created();
    Resource resource1 = new Resource();
    resource1.setResource("http://dummy1.dum");
    created.setResource(resource1);
    ArrayList<Created> createdList = new ArrayList<>();
    createdList.add(created);
    webResource.setCreatedList(createdList);
    Extent extent = new Extent();
    Resource resource2 = new Resource();
    resource2.setResource("http://dummy2.dum");
    extent.setResource(resource2);
    ArrayList<Extent> extentList = new ArrayList<>();
    extentList.add(extent);
    webResource.setExtentList(extentList);
    Format format = new Format();
    ResourceOrLiteralType.Resource resource3 = new ResourceOrLiteralType.Resource();
    resource3.setResource("http://dummy3.dum");
    format.setResource(resource3);
    ArrayList<Format> formatList = new ArrayList<>();
    formatList.add(format);
    webResource.setFormatList(formatList);
    HasPart hasPart = new HasPart();
    Resource resource4 = new Resource();
    resource4.setResource("http://dummy4.dum");
    hasPart.setResource(resource4);
    ArrayList<HasPart> hasPartList = new ArrayList<>();
    hasPartList.add(hasPart);
    webResource.setHasPartList(hasPartList);
    IsFormatOf isFormatOf = new IsFormatOf();
    Resource resource5 = new Resource();
    resource5.setResource("http://dummy5.dum");
    isFormatOf.setResource(resource5);
    ArrayList<IsFormatOf> isFormatOfList = new ArrayList<>();
    isFormatOfList.add(isFormatOf);
    webResource.setIsFormatOfList(isFormatOfList);
    Issued issued = new Issued();
    Resource resource6 = new Resource();
    resource6.setResource("http://dummy6.dum");
    issued.setResource(resource6);
    ArrayList<Issued> issuedList = new ArrayList<>();
    issuedList.add(issued);
    webResource.setIssuedList(issuedList);
    // Should be rejected
    BitRate bitRate = new BitRate();
    bitRate.setDatatype("Data Type");
    webResource.setBitRate(bitRate);
    ArrayList<WebResourceType> webResourceList = new ArrayList<>();
    webResourceList.add(webResource);
    rdf.setWebResourceList(webResourceList);
    Set<String> result = DereferenceUtils.extractReferencesForDereferencing(rdf);
    assertNotNull(result);
    assertEquals(5, result.size());
    assertTrue(result.contains("http://dummy1.dum"));
    assertTrue(result.contains("http://dummy2.dum"));
    assertTrue(result.contains("http://dummy3.dum"));
    assertTrue(result.contains("http://dummy5.dum"));
    assertTrue(result.contains("http://dummy6.dum"));
}
Also used : WebResourceType(eu.europeana.metis.schema.jibx.WebResourceType) Extent(eu.europeana.metis.schema.jibx.Extent) ArrayList(java.util.ArrayList) Resource(eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource) Resource(eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource) HasPart(eu.europeana.metis.schema.jibx.HasPart) Created(eu.europeana.metis.schema.jibx.Created) HasFormat(eu.europeana.metis.schema.jibx.HasFormat) Format(eu.europeana.metis.schema.jibx.Format) IsFormatOf(eu.europeana.metis.schema.jibx.IsFormatOf) RDF(eu.europeana.metis.schema.jibx.RDF) Issued(eu.europeana.metis.schema.jibx.Issued) ProxyType(eu.europeana.metis.schema.jibx.ProxyType) ResourceOrLiteralType(eu.europeana.metis.schema.jibx.ResourceOrLiteralType) BitRate(eu.europeana.metis.schema.jibx.BitRate) Test(org.junit.jupiter.api.Test)

Aggregations

BitRate (eu.europeana.metis.schema.jibx.BitRate)1 Created (eu.europeana.metis.schema.jibx.Created)1 Extent (eu.europeana.metis.schema.jibx.Extent)1 Format (eu.europeana.metis.schema.jibx.Format)1 HasFormat (eu.europeana.metis.schema.jibx.HasFormat)1 HasPart (eu.europeana.metis.schema.jibx.HasPart)1 IsFormatOf (eu.europeana.metis.schema.jibx.IsFormatOf)1 Issued (eu.europeana.metis.schema.jibx.Issued)1 ProxyType (eu.europeana.metis.schema.jibx.ProxyType)1 RDF (eu.europeana.metis.schema.jibx.RDF)1 ResourceOrLiteralType (eu.europeana.metis.schema.jibx.ResourceOrLiteralType)1 Resource (eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource)1 WebResourceType (eu.europeana.metis.schema.jibx.WebResourceType)1 ArrayList (java.util.ArrayList)1 Test (org.junit.jupiter.api.Test)1