Search in sources :

Example 1 with Created

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

the class EnablingElementsBreakdownClassifierTest method testAnalyzeForElements.

@Test
void testAnalyzeForElements() {
    // Create some objects.
    final EnablingElementsClassifier classifier = new EnablingElementsClassifier();
    final String link = "link";
    final Map<String, Set<Class<? extends AboutType>>> contextualObjectMap = Collections.singletonMap(link, EnumSet.allOf(ContextualClassGroup.class).stream().map(ContextualClassGroup::getContextualClass).collect(Collectors.toSet()));
    // Create proxy with Created and a HasMet.
    final Created created = new Created();
    created.setString(link);
    created.setResource(new Resource());
    created.getResource().setResource(link);
    final HasMet hasMet = new HasMet();
    hasMet.setResource(link);
    final ProxyType proxy = new ProxyType();
    proxy.setChoiceList(Collections.singletonList(new Choice()));
    proxy.getChoiceList().get(0).setCreated(created);
    proxy.setHasMetList(Collections.singletonList(hasMet));
    final List<ProxyType> proxies = Collections.singletonList(proxy);
    // Test for some queries that the answer is the same as calling the enum directly. The enum
    // itself is tested in its own unit test class.
    assertEquals(EnablingElement.EDM_HAS_MET.analyze(proxies, contextualObjectMap), classifier.analyzeForElement(EnablingElement.EDM_HAS_MET, proxies, contextualObjectMap));
    assertEquals(EnablingElement.DCTERMS_CREATED.analyze(proxies, contextualObjectMap), classifier.analyzeForElement(EnablingElement.DCTERMS_CREATED, proxies, contextualObjectMap));
    assertEquals(EnablingElement.DCTERMS_ISSUED.analyze(proxies, contextualObjectMap), classifier.analyzeForElement(EnablingElement.DCTERMS_ISSUED, proxies, contextualObjectMap));
}
Also used : HashSet(java.util.HashSet) EnumSet(java.util.EnumSet) Set(java.util.Set) Choice(eu.europeana.metis.schema.jibx.EuropeanaType.Choice) Resource(eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource) HasMet(eu.europeana.metis.schema.jibx.HasMet) ProxyType(eu.europeana.metis.schema.jibx.ProxyType) Created(eu.europeana.metis.schema.jibx.Created) Test(org.junit.jupiter.api.Test)

Example 2 with Created

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

the class MetisRecordParserTest method testExtractedFieldValuesForEnrichment.

@Test
public void testExtractedFieldValuesForEnrichment() {
    RDF rdf = new RDF();
    ProxyType proxy = new ProxyType();
    ArrayList<Choice> choiceList = new ArrayList<>();
    Choice choice1 = new Choice();
    Creator creator = new Creator();
    creator.setString("Creator");
    Lang language1 = new Lang();
    language1.setLang("English");
    creator.setLang(language1);
    choice1.setCreator(creator);
    choiceList.add(choice1);
    Choice choice2 = new Choice();
    Contributor contributor = new Contributor();
    contributor.setString("Contributor");
    Lang language2 = new Lang();
    language2.setLang("Dutch");
    contributor.setLang(language2);
    choice2.setContributor(contributor);
    choiceList.add(choice2);
    Choice choice3 = new Choice();
    Date date = new Date();
    date.setString("Date");
    Lang language3 = new Lang();
    language3.setLang("German");
    date.setLang(language3);
    choice3.setDate(date);
    choiceList.add(choice3);
    Choice choice4 = new Choice();
    Issued issued = new Issued();
    issued.setString("Issued");
    Lang language4 = new Lang();
    language4.setLang("French");
    issued.setLang(language4);
    choice4.setIssued(issued);
    choiceList.add(choice4);
    Choice choice5 = new Choice();
    Created created = new Created();
    created.setString("Created");
    Lang language5 = new Lang();
    language5.setLang("Italian");
    created.setLang(language5);
    choice5.setCreated(created);
    choiceList.add(choice5);
    Choice choice6 = new Choice();
    Coverage coverage = new Coverage();
    coverage.setString("Coverage");
    Lang language6 = new Lang();
    language6.setLang("Spanish");
    coverage.setLang(language6);
    choice6.setCoverage(coverage);
    choiceList.add(choice6);
    Choice choice7 = new Choice();
    Temporal temporal = new Temporal();
    temporal.setString("Temporal");
    Lang language7 = new Lang();
    language7.setLang("Polish");
    temporal.setLang(language7);
    choice7.setTemporal(temporal);
    choiceList.add(choice7);
    Choice choice8 = new Choice();
    Type type = new Type();
    type.setString("Type");
    Lang language8 = new Lang();
    language8.setLang("Romanian");
    type.setLang(language8);
    choice8.setType(type);
    choiceList.add(choice8);
    Choice choice9 = new Choice();
    Spatial spatial = new Spatial();
    spatial.setString("Spatial");
    Lang language9 = new Lang();
    language9.setLang("Greek");
    spatial.setLang(language9);
    choice9.setSpatial(spatial);
    choiceList.add(choice9);
    Choice choice10 = new Choice();
    Subject subject = new Subject();
    subject.setString("Subject");
    Lang language10 = new Lang();
    language10.setLang("Bulgarian");
    subject.setLang(language10);
    choice10.setSubject(subject);
    choiceList.add(choice10);
    // Should be rejected
    Choice choice11 = new Choice();
    Extent extent = new Extent();
    extent.setString("Extent");
    Lang language11 = new Lang();
    language11.setLang("Ukrainian");
    extent.setLang(language11);
    choice11.setExtent(extent);
    choiceList.add(choice11);
    proxy.setChoiceList(choiceList);
    ArrayList<ProxyType> proxyList = new ArrayList<>();
    proxyList.add(proxy);
    // Should be rejected
    ProxyType proxyEuropeana = new ProxyType();
    EuropeanaProxy europeanaProxy = new EuropeanaProxy();
    europeanaProxy.setEuropeanaProxy(true);
    proxyEuropeana.setEuropeanaProxy(europeanaProxy);
    proxyList.add(proxyEuropeana);
    rdf.setProxyList(proxyList);
    Set<SearchTermContext> result = new MetisRecordParser().parseSearchTerms(rdf);
    assertNotNull(result);
    assertEquals(10, result.size());
    ArrayList<String> resultProcessed = new ArrayList<>();
    for (SearchTermContext searchValue : result) {
        resultProcessed.add(searchValue.getTextValue() + "|" + searchValue.getLanguage());
    }
    assertTrue(resultProcessed.contains("Creator|English"));
    assertTrue(resultProcessed.contains("Contributor|Dutch"));
    assertTrue(resultProcessed.contains("Date|German"));
    assertTrue(resultProcessed.contains("Issued|French"));
    assertTrue(resultProcessed.contains("Created|Italian"));
    assertTrue(resultProcessed.contains("Coverage|Spanish"));
    assertTrue(resultProcessed.contains("Temporal|Polish"));
    assertTrue(resultProcessed.contains("Type|Romanian"));
    assertTrue(resultProcessed.contains("Spatial|Greek"));
    assertTrue(resultProcessed.contains("Subject|Bulgarian"));
}
Also used : Choice(eu.europeana.metis.schema.jibx.EuropeanaType.Choice) Extent(eu.europeana.metis.schema.jibx.Extent) ArrayList(java.util.ArrayList) Contributor(eu.europeana.metis.schema.jibx.Contributor) Lang(eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Lang) Coverage(eu.europeana.metis.schema.jibx.Coverage) Creator(eu.europeana.metis.schema.jibx.Creator) Date(eu.europeana.metis.schema.jibx.Date) Subject(eu.europeana.metis.schema.jibx.Subject) EuropeanaProxy(eu.europeana.metis.schema.jibx.EuropeanaProxy) Created(eu.europeana.metis.schema.jibx.Created) SearchTermContext(eu.europeana.enrichment.api.internal.SearchTermContext) Type(eu.europeana.metis.schema.jibx.Type) EuropeanaAggregationType(eu.europeana.metis.schema.jibx.EuropeanaAggregationType) ProxyType(eu.europeana.metis.schema.jibx.ProxyType) Temporal(eu.europeana.metis.schema.jibx.Temporal) RDF(eu.europeana.metis.schema.jibx.RDF) Spatial(eu.europeana.metis.schema.jibx.Spatial) Issued(eu.europeana.metis.schema.jibx.Issued) ProxyType(eu.europeana.metis.schema.jibx.ProxyType) Test(org.junit.jupiter.api.Test)

Example 3 with Created

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

the class EnrichmentUtilsTest method testSetAdditionalDataAllYearFieldValues.

@Test
void testSetAdditionalDataAllYearFieldValues() {
    Choice dateChoice = new Choice();
    Date date = new Date();
    Choice temporalChoice = new Choice();
    Temporal temporal = new Temporal();
    Choice createdChoice = new Choice();
    Created created = new Created();
    Choice issuedChoice = new Choice();
    Issued issued = new Issued();
    date.setString("1990");
    dateChoice.setDate(date);
    temporal.setString("1991");
    temporalChoice.setTemporal(temporal);
    created.setString("1992");
    createdChoice.setCreated(created);
    issued.setString("1993");
    issuedChoice.setIssued(issued);
    ArrayList<Choice> choices = new ArrayList<>();
    choices.add(dateChoice);
    choices.add(temporalChoice);
    choices.add(createdChoice);
    choices.add(issuedChoice);
    PROXY_PROVIDER.setChoiceList(choices);
    ArrayList<ProxyType> proxyList = new ArrayList<>();
    proxyList.add(PROXY_EUROPEANA);
    proxyList.add(PROXY_PROVIDER);
    TEST_RDF.setProxyList(proxyList);
    EnrichmentUtils.setAdditionalData(TEST_RDF);
    ProxyType proxyResult = TEST_RDF.getProxyList().stream().filter(x -> x.getEuropeanaProxy().isEuropeanaProxy()).collect(Collectors.toList()).get(0);
    assertEquals(4, proxyResult.getYearList().size());
    assertEquals("1990", proxyResult.getYearList().get(0).getString());
    assertEquals("1991", proxyResult.getYearList().get(1).getString());
    assertEquals("1992", proxyResult.getYearList().get(2).getString());
    assertEquals("1993", proxyResult.getYearList().get(3).getString());
}
Also used : Choice(eu.europeana.metis.schema.jibx.EuropeanaType.Choice) Temporal(eu.europeana.metis.schema.jibx.Temporal) Issued(eu.europeana.metis.schema.jibx.Issued) ArrayList(java.util.ArrayList) ProxyType(eu.europeana.metis.schema.jibx.ProxyType) Date(eu.europeana.metis.schema.jibx.Date) Created(eu.europeana.metis.schema.jibx.Created) Test(org.junit.jupiter.api.Test)

Example 4 with Created

use of eu.europeana.metis.schema.jibx.Created 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)

Example 5 with Created

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

the class ProxyFieldInputTest method createEuropeanaTermsList.

private List<EuropeanaType.Choice> createEuropeanaTermsList() {
    List<EuropeanaType.Choice> dctermsList = new ArrayList<>();
    EuropeanaType.Choice choiceAlternative = new EuropeanaType.Choice();
    Alternative alternative = new Alternative();
    alternative.setString("test alternative");
    choiceAlternative.setAlternative(alternative);
    dctermsList.add(choiceAlternative);
    EuropeanaType.Choice choiceConformsTo = new EuropeanaType.Choice();
    ConformsTo conformsTo = new ConformsTo();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource conformsResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    conformsResource.setResource("test conforms to");
    conformsTo.setResource(conformsResource);
    choiceConformsTo.setConformsTo(conformsTo);
    dctermsList.add(choiceConformsTo);
    EuropeanaType.Choice choiceCreated = new EuropeanaType.Choice();
    Created created = new Created();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource createdResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    createdResource.setResource("test created");
    created.setResource(createdResource);
    choiceCreated.setCreated(created);
    dctermsList.add(choiceCreated);
    EuropeanaType.Choice choiceExtent = new EuropeanaType.Choice();
    Extent extent = new Extent();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource extentResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    extentResource.setResource("test extent");
    extent.setResource(extentResource);
    choiceExtent.setExtent(extent);
    dctermsList.add(choiceExtent);
    EuropeanaType.Choice choiceHasFormat = new EuropeanaType.Choice();
    HasFormat hasFormat = new HasFormat();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource choiceHasFormatResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    choiceHasFormatResource.setResource("test hasFormat");
    hasFormat.setResource(choiceHasFormatResource);
    choiceHasFormat.setHasFormat(hasFormat);
    dctermsList.add(choiceHasFormat);
    EuropeanaType.Choice choiceHasPart = new EuropeanaType.Choice();
    HasPart hasPart = new HasPart();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource hasPartResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    hasPartResource.setResource("test hasPart");
    hasPart.setResource(hasPartResource);
    choiceHasPart.setHasPart(hasPart);
    dctermsList.add(choiceHasPart);
    EuropeanaType.Choice choiceHasVersion = new EuropeanaType.Choice();
    HasVersion hasVersion = new HasVersion();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource hasVersionResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    hasVersionResource.setResource("test hasVersion");
    hasVersion.setResource(hasVersionResource);
    choiceHasVersion.setHasVersion(hasVersion);
    dctermsList.add(choiceHasVersion);
    EuropeanaType.Choice choiceIsFormatOf = new EuropeanaType.Choice();
    IsFormatOf isFormatOf = new IsFormatOf();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource isFormatOfResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    isFormatOfResource.setResource("test isFormatOf");
    isFormatOf.setResource(isFormatOfResource);
    choiceIsFormatOf.setIsFormatOf(isFormatOf);
    dctermsList.add(choiceIsFormatOf);
    EuropeanaType.Choice choiceIsPartOf = new EuropeanaType.Choice();
    IsPartOf isPartOf = new IsPartOf();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource isPartOfResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    isPartOfResource.setResource("test isPartOf");
    isPartOf.setResource(isPartOfResource);
    choiceIsPartOf.setIsPartOf(isPartOf);
    dctermsList.add(choiceIsPartOf);
    EuropeanaType.Choice choiceIsReferencedBy = new EuropeanaType.Choice();
    IsReferencedBy isReferencedBy = new IsReferencedBy();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource isReferencedByResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    isReferencedByResource.setResource("test isReferencedBy");
    isReferencedBy.setResource(isReferencedByResource);
    choiceIsReferencedBy.setIsReferencedBy(isReferencedBy);
    dctermsList.add(choiceIsReferencedBy);
    EuropeanaType.Choice choiceIsReplacedBy = new EuropeanaType.Choice();
    IsReplacedBy isReplacedBy = new IsReplacedBy();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource isReplacedByResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    isReplacedByResource.setResource("test isReplacedBy");
    isReplacedBy.setResource(isReplacedByResource);
    choiceIsReplacedBy.setIsReplacedBy(isReplacedBy);
    dctermsList.add(choiceIsReplacedBy);
    EuropeanaType.Choice choiceIsRequiredBy = new EuropeanaType.Choice();
    IsRequiredBy isRequiredBy = new IsRequiredBy();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource isRequiredByResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    isRequiredByResource.setResource("test isRequiredBy");
    isRequiredBy.setResource(isRequiredByResource);
    choiceIsRequiredBy.setIsRequiredBy(isRequiredBy);
    dctermsList.add(choiceIsRequiredBy);
    EuropeanaType.Choice choiceIssued = new EuropeanaType.Choice();
    Issued issued = new Issued();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource issuedResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    issuedResource.setResource("test issued");
    issued.setResource(issuedResource);
    choiceIssued.setIssued(issued);
    dctermsList.add(choiceIssued);
    EuropeanaType.Choice choiceIsVersionOf = new EuropeanaType.Choice();
    IsVersionOf isVersionOf = new IsVersionOf();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource isVersionOfResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    isVersionOfResource.setResource("test isVersionOf");
    isVersionOf.setResource(isVersionOfResource);
    choiceIsVersionOf.setIsVersionOf(isVersionOf);
    dctermsList.add(choiceIsVersionOf);
    EuropeanaType.Choice choiceMedium = new EuropeanaType.Choice();
    Medium medium = new Medium();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource mediumResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    mediumResource.setResource("test medium");
    medium.setResource(mediumResource);
    choiceMedium.setMedium(medium);
    dctermsList.add(choiceMedium);
    EuropeanaType.Choice choiceProvenance = new EuropeanaType.Choice();
    Provenance provenance = new Provenance();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource provenanceResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    provenanceResource.setResource("test provenance");
    provenance.setResource(provenanceResource);
    choiceProvenance.setProvenance(provenance);
    dctermsList.add(choiceProvenance);
    EuropeanaType.Choice choiceReferences = new EuropeanaType.Choice();
    References references = new References();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource referencesResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    referencesResource.setResource("test references");
    references.setResource(referencesResource);
    choiceReferences.setReferences(references);
    dctermsList.add(choiceReferences);
    EuropeanaType.Choice choiceReplaces = new EuropeanaType.Choice();
    Replaces replaces = new Replaces();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource replacesResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    replacesResource.setResource("test replaces");
    replaces.setResource(replacesResource);
    choiceReplaces.setReplaces(replaces);
    dctermsList.add(choiceReplaces);
    EuropeanaType.Choice choiceRequires = new EuropeanaType.Choice();
    Requires requires = new Requires();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource requiresResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    requiresResource.setResource("test requires");
    requires.setResource(requiresResource);
    choiceRequires.setRequires(requires);
    dctermsList.add(choiceRequires);
    EuropeanaType.Choice choiceSpatial = new EuropeanaType.Choice();
    Spatial spatial = new Spatial();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource spatialResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    spatialResource.setResource("test spatial");
    spatial.setResource(spatialResource);
    choiceSpatial.setSpatial(spatial);
    dctermsList.add(choiceSpatial);
    EuropeanaType.Choice choiceTableOfContents = new EuropeanaType.Choice();
    TableOfContents tableOfContents = new TableOfContents();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource tableOfContentsResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    tableOfContentsResource.setResource("test TOC");
    tableOfContents.setResource(tableOfContentsResource);
    choiceTableOfContents.setTableOfContents(tableOfContents);
    dctermsList.add(choiceTableOfContents);
    EuropeanaType.Choice choiceTemporal = new EuropeanaType.Choice();
    Temporal temporal = new Temporal();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource temporalResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    temporalResource.setResource("temporal");
    temporal.setResource(temporalResource);
    choiceTemporal.setTemporal(temporal);
    dctermsList.add(choiceTemporal);
    EuropeanaType.Choice choiceContributor = new EuropeanaType.Choice();
    Contributor contributor = new Contributor();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource contributorResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    contributorResource.setResource("test contributor");
    contributor.setResource(contributorResource);
    choiceContributor.setContributor(contributor);
    dctermsList.add(choiceContributor);
    EuropeanaType.Choice choiceCoverage = new EuropeanaType.Choice();
    Coverage coverage = new Coverage();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource coverageResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    coverageResource.setResource("test coverage");
    coverage.setResource(coverageResource);
    choiceCoverage.setCoverage(coverage);
    dctermsList.add(choiceCoverage);
    EuropeanaType.Choice choiceCreator = new EuropeanaType.Choice();
    Creator creator = new Creator();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource creatorResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    creatorResource.setResource("test creator");
    creator.setResource(creatorResource);
    choiceCreator.setCreator(creator);
    dctermsList.add(choiceCreator);
    EuropeanaType.Choice choiceDate = new EuropeanaType.Choice();
    Date date = new Date();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource dateResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    dateResource.setResource("test date");
    date.setResource(dateResource);
    choiceDate.setDate(date);
    dctermsList.add(choiceDate);
    EuropeanaType.Choice choiceDescription = new EuropeanaType.Choice();
    Description description = new Description();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource descriptionResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    descriptionResource.setResource("test description");
    description.setResource(descriptionResource);
    choiceDescription.setDescription(description);
    dctermsList.add(choiceDescription);
    EuropeanaType.Choice choiceFormat = new EuropeanaType.Choice();
    Format format = new Format();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource formatResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    formatResource.setResource("test format");
    format.setResource(formatResource);
    choiceFormat.setFormat(format);
    dctermsList.add(choiceFormat);
    EuropeanaType.Choice choiceIdentifier = new EuropeanaType.Choice();
    Identifier identifier = new Identifier();
    identifier.setString("test identifier");
    choiceIdentifier.setIdentifier(identifier);
    dctermsList.add(choiceIdentifier);
    EuropeanaType.Choice choiceLanguage = new EuropeanaType.Choice();
    Language language = new Language();
    language.setString("test language");
    choiceLanguage.setLanguage(language);
    dctermsList.add(choiceLanguage);
    EuropeanaType.Choice choicePublisher = new EuropeanaType.Choice();
    Publisher publisher = new Publisher();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource publisherResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    publisherResource.setResource("test publisher");
    publisher.setResource(publisherResource);
    choicePublisher.setPublisher(publisher);
    dctermsList.add(choicePublisher);
    EuropeanaType.Choice choiceRelation = new EuropeanaType.Choice();
    Relation relation = new Relation();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource relationResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    relationResource.setResource("test relation");
    relation.setResource(relationResource);
    choiceRelation.setRelation(relation);
    dctermsList.add(choiceRelation);
    EuropeanaType.Choice choiceRights = new EuropeanaType.Choice();
    Rights rights = new Rights();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource rightsResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    rightsResource.setResource("test rights");
    rights.setResource(rightsResource);
    choiceRights.setRights(rights);
    dctermsList.add(choiceRights);
    EuropeanaType.Choice choiceSource = new EuropeanaType.Choice();
    Source source = new Source();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource sourceResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    sourceResource.setResource("test source");
    source.setResource(sourceResource);
    choiceSource.setSource(source);
    dctermsList.add(choiceSource);
    EuropeanaType.Choice choiceSubject = new EuropeanaType.Choice();
    Subject subject = new Subject();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource subjectResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    subjectResource.setResource("test subject");
    subject.setResource(subjectResource);
    choiceSubject.setSubject(subject);
    dctermsList.add(choiceSubject);
    EuropeanaType.Choice choiceTitle = new EuropeanaType.Choice();
    Title title = new Title();
    title.setString("test title");
    choiceTitle.setTitle(title);
    dctermsList.add(choiceTitle);
    EuropeanaType.Choice choiceType = new EuropeanaType.Choice();
    Type type = new Type();
    eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource typeResource = new eu.europeana.metis.schema.jibx.ResourceOrLiteralType.Resource();
    typeResource.setResource("test type");
    type.setResource(typeResource);
    choiceType.setType(type);
    dctermsList.add(choiceType);
    return dctermsList;
}
Also used : Provenance(eu.europeana.metis.schema.jibx.Provenance) ArrayList(java.util.ArrayList) TableOfContents(eu.europeana.metis.schema.jibx.TableOfContents) Creator(eu.europeana.metis.schema.jibx.Creator) Rights(eu.europeana.metis.schema.jibx.Rights) Identifier(eu.europeana.metis.schema.jibx.Identifier) HasVersion(eu.europeana.metis.schema.jibx.HasVersion) Alternative(eu.europeana.metis.schema.jibx.Alternative) Requires(eu.europeana.metis.schema.jibx.Requires) IsPartOf(eu.europeana.metis.schema.jibx.IsPartOf) IsReplacedBy(eu.europeana.metis.schema.jibx.IsReplacedBy) ConformsTo(eu.europeana.metis.schema.jibx.ConformsTo) Spatial(eu.europeana.metis.schema.jibx.Spatial) Medium(eu.europeana.metis.schema.jibx.Medium) Description(eu.europeana.metis.schema.jibx.Description) EuropeanaType(eu.europeana.metis.schema.jibx.EuropeanaType) Extent(eu.europeana.metis.schema.jibx.Extent) Contributor(eu.europeana.metis.schema.jibx.Contributor) HasPart(eu.europeana.metis.schema.jibx.HasPart) Source(eu.europeana.metis.schema.jibx.Source) Created(eu.europeana.metis.schema.jibx.Created) Relation(eu.europeana.metis.schema.jibx.Relation) HasFormat(eu.europeana.metis.schema.jibx.HasFormat) IsFormatOf(eu.europeana.metis.schema.jibx.IsFormatOf) HasFormat(eu.europeana.metis.schema.jibx.HasFormat) Format(eu.europeana.metis.schema.jibx.Format) Temporal(eu.europeana.metis.schema.jibx.Temporal) Language(eu.europeana.metis.schema.jibx.Language) Issued(eu.europeana.metis.schema.jibx.Issued) Title(eu.europeana.metis.schema.jibx.Title) Coverage(eu.europeana.metis.schema.jibx.Coverage) IsReferencedBy(eu.europeana.metis.schema.jibx.IsReferencedBy) IsRequiredBy(eu.europeana.metis.schema.jibx.IsRequiredBy) Replaces(eu.europeana.metis.schema.jibx.Replaces) Publisher(eu.europeana.metis.schema.jibx.Publisher) IsVersionOf(eu.europeana.metis.schema.jibx.IsVersionOf) Date(eu.europeana.metis.schema.jibx.Date) Subject(eu.europeana.metis.schema.jibx.Subject) EuropeanaType(eu.europeana.metis.schema.jibx.EuropeanaType) Type(eu.europeana.metis.schema.jibx.Type) EdmType(eu.europeana.metis.schema.jibx.EdmType) ProxyType(eu.europeana.metis.schema.jibx.ProxyType) References(eu.europeana.metis.schema.jibx.References)

Aggregations

Created (eu.europeana.metis.schema.jibx.Created)6 ProxyType (eu.europeana.metis.schema.jibx.ProxyType)5 Issued (eu.europeana.metis.schema.jibx.Issued)4 ArrayList (java.util.ArrayList)4 Date (eu.europeana.metis.schema.jibx.Date)3 Choice (eu.europeana.metis.schema.jibx.EuropeanaType.Choice)3 Extent (eu.europeana.metis.schema.jibx.Extent)3 Test (org.junit.jupiter.api.Test)3 Contributor (eu.europeana.metis.schema.jibx.Contributor)2 Coverage (eu.europeana.metis.schema.jibx.Coverage)2 Creator (eu.europeana.metis.schema.jibx.Creator)2 EuropeanaAggregationType (eu.europeana.metis.schema.jibx.EuropeanaAggregationType)2 Format (eu.europeana.metis.schema.jibx.Format)2 HasFormat (eu.europeana.metis.schema.jibx.HasFormat)2 HasPart (eu.europeana.metis.schema.jibx.HasPart)2 IsFormatOf (eu.europeana.metis.schema.jibx.IsFormatOf)2 RDF (eu.europeana.metis.schema.jibx.RDF)2 Temporal (eu.europeana.metis.schema.jibx.Temporal)2 SearchTermContext (eu.europeana.enrichment.api.internal.SearchTermContext)1 RecordRelatedIndexingException (eu.europeana.indexing.exception.RecordRelatedIndexingException)1