Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,096 changes: 1,096 additions & 0 deletions dspace-oai/src/test/java/org/dspace/xoai/tests/stylesheets/CcmmXslTest.java

Large diffs are not rendered by default.

64 changes: 64 additions & 0 deletions dspace-oai/src/test/resources/xoai-ccmm-academic-licence-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

The contents of this file are subject to the license and copyright
detailed in the LICENSE and NOTICE files at the root of the source
tree and available online at

http://www.dspace.org/license/

-->
<!--
An ACA (academic use) item. DSpace computed open.access from the bitstream policies, but the
download is gated behind the CLARIN identity form, so the feed must not call it open.
-->
<metadata xmlns="http://www.lyncode.com/xoai">
<element name="dc">
<element name="date">
<element name="issued">
<element name="none">
<field name="value">2018-06-01</field>
</element>
</element>
</element>
<element name="rights">
<element name="none">
<field name="value">CLARIN ACA End-User Licence Agreement</field>
</element>
<element name="label">
<element name="none">
<field name="value">ACA</field>
</element>
</element>
</element>
<element name="title">
<element name="none">
<field name="value">An Academic Use Corpus</field>
</element>
</element>
</element>
<element name="bundles">
<element name="bundle">
<field name="name">ORIGINAL</field>
<element name="bitstreams">
<element name="bitstream">
<field name="name">corpus.zip</field>
<field name="format">application/zip</field>
<field name="size">4096</field>
<field name="url">https://lindat.mff.cuni.cz/repository/bitstream/1/3/corpus.zip</field>
</element>
</element>
</element>
</element>
<element name="others">
<field name="handle">11234/1-9</field>
<field name="identifier">oai:lindat.mff.cuni.cz:11234/1-9</field>
<element name="access-status">
<field name="value">open.access</field>
</element>
</element>
<element name="repository">
<field name="name">LINDAT/CLARIAH-CZ</field>
<field name="url">https://lindat.mff.cuni.cz/repository/</field>
</element>
</metadata>
69 changes: 69 additions & 0 deletions dspace-oai/src/test/resources/xoai-ccmm-approximate-date-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

The contents of this file are subject to the license and copyright
detailed in the LICENSE and NOTICE files at the root of the source
tree and available online at

http://www.dspace.org/license/

-->
<!--
XOAI metadata XML exercising the CLARIN-DSpace approximate-date convention:
dc.date.issued is the literal "0000" ("exact date unknown") and the real
information lives in local.approximateDate.issued.
-->
<metadata xmlns="http://www.lyncode.com/xoai" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.lyncode.com/xoai http://www.lyncode.com/xsd/xoai.xsd">
<element name="dc">
<element name="title">
<element name="none">
<field name="value">Film professionals 1</field>
</element>
</element>
<element name="identifier">
<element name="uri">
<element name="none">
<field name="value">http://hdl.handle.net/20.500.12801/3901034-01</field>
</element>
</element>
</element>
<element name="date">
<element name="issued">
<element name="none">
<field name="value">0000</field>
</element>
</element>
<element name="accessioned">
<element name="none">
<field name="value">2021-03-08T12:00:00Z</field>
</element>
</element>
</element>
<element name="subject">
<element name="none">
<field name="value">oral history</field>
</element>
</element>
</element>
<element name="local">
<element name="approximateDate">
<element name="issued">
<element name="none">
<field name="value">cca 1930-1950</field>
</element>
</element>
</element>
</element>
<element name="others">
<field name="handle">20.500.12801/3901034-01</field>
<field name="identifier">oai:lindat.mff.cuni.cz:20.500.12801/3901034-01</field>
<field name="lastModifyDate">2025-01-01 00:00:00.000</field>
<element name="access-status">
<field name="value">restricted</field>
</element>
</element>
<element name="repository">
<field name="name">LINDAT/CLARIAH-CZ</field>
</element>
</metadata>
65 changes: 65 additions & 0 deletions dspace-oai/src/test/resources/xoai-ccmm-clarin-access-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

The contents of this file are subject to the license and copyright
detailed in the LICENSE and NOTICE files at the root of the source
tree and available online at

http://www.dspace.org/license/

-->
<!--
A CLARIN item whose real downloadability disagrees with others/access-status: the licence is
PUB and the file is fetched anonymously, while DefaultAccessStatusHelper called it restricted.
-->
<metadata xmlns="http://www.lyncode.com/xoai">
<element name="dc">
<element name="date">
<element name="issued">
<element name="none">
<field name="value">2019-01-01</field>
</element>
</element>
</element>
<element name="rights">
<element name="none">
<field name="value">Creative Commons - Attribution-NonCommercial-NoDerivatives 4.0 International</field>
</element>
<element name="label">
<element name="none">
<field name="value">PUB</field>
</element>
</element>
</element>
<element name="title">
<element name="none">
<field name="value">A Publicly Licensed Film</field>
</element>
</element>
</element>
<element name="bundles">
<element name="bundle">
<field name="name">ORIGINAL</field>
<element name="bitstreams">
<element name="bitstream">
<field name="name">film.mp4</field>
<field name="format">video/mp4</field>
<field name="size">1048576</field>
<field name="url">https://lindat.mff.cuni.cz/repository/bitstream/1/2/film.mp4</field>
</element>
</element>
</element>
</element>
<element name="others">
<field name="handle">20.500.12801/1-2</field>
<field name="identifier">oai:lindat.mff.cuni.cz:20.500.12801/1-2</field>
<!-- DSpace computed this from the primary bitstream policies; the file downloads anyway -->
<element name="access-status">
<field name="value">restricted</field>
</element>
</element>
<element name="repository">
<field name="name">LINDAT/CLARIAH-CZ</field>
<field name="url">https://lindat.mff.cuni.cz/repository/</field>
</element>
</metadata>
50 changes: 50 additions & 0 deletions dspace-oai/src/test/resources/xoai-ccmm-date-shapes-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

The contents of this file are subject to the license and copyright
detailed in the LICENSE and NOTICE files at the root of the source
tree and available online at

http://www.dspace.org/license/

-->
<!--
Date shapes DSpace actually stores, plus two that no format string can parse. Every branch of
FormatDate has to produce a value xs:date accepts, or produce nothing at all.
-->
<metadata xmlns="http://www.lyncode.com/xoai">
<element name="dc">
<element name="date">
<element name="issued">
<element name="none">
<field name="value">2014</field>
</element>
</element>
<element name="accessioned">
<element name="none">
<field name="value">2011-12</field>
<field name="value">no date recorded</field>
</element>
</element>
<element name="available">
<element name="none">
<field name="value">2008-12-01</field>
<field name="value">n.d.</field>
</element>
</element>
</element>
<element name="title">
<element name="none">
<field name="value">Date Shapes</field>
</element>
</element>
</element>
<element name="others">
<field name="handle">123/789</field>
<field name="identifier">oai:repo.example.org:123/789</field>
</element>
<element name="repository">
<field name="name">Example Repository</field>
<field name="url">https://repo.example.org/</field>
</element>
</metadata>
54 changes: 54 additions & 0 deletions dspace-oai/src/test/resources/xoai-ccmm-embargo-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

The contents of this file are subject to the license and copyright
detailed in the LICENSE and NOTICE files at the root of the source
tree and available online at

http://www.dspace.org/license/

-->
<!--
An embargoed item. No CLARIN licence category is present, so others/access-status decides
and has to reach the COAR embargo term rather than the restricted fallback.
-->
<metadata xmlns="http://www.lyncode.com/xoai">
<element name="dc">
<element name="date">
<element name="issued">
<element name="none">
<field name="value">2023-09-01</field>
</element>
</element>
</element>
<element name="title">
<element name="none">
<field name="value">An Embargoed Dataset</field>
</element>
</element>
</element>
<element name="bundles">
<element name="bundle">
<field name="name">ORIGINAL</field>
<element name="bitstreams">
<element name="bitstream">
<field name="name">embargoed.csv</field>
<field name="format">text/csv</field>
<field name="size">512</field>
<field name="url">https://repo.example.org/bitstream/1/5/embargoed.csv</field>
</element>
</element>
</element>
</element>
<element name="others">
<field name="handle">123/999</field>
<field name="identifier">oai:repo.example.org:123/999</field>
<element name="access-status">
<field name="value">embargo</field>
</element>
</element>
<element name="repository">
<field name="name">Example Repository</field>
<field name="url">https://repo.example.org/</field>
</element>
</metadata>
56 changes: 56 additions & 0 deletions dspace-oai/src/test/resources/xoai-ccmm-enumerated-date-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

The contents of this file are subject to the license and copyright
detailed in the LICENSE and NOTICE files at the root of the source
tree and available online at

http://www.dspace.org/license/

-->
<!--
"1920, 1932" enumerates two attested years; it is not a continuous range. The migrated
catalogue blob states the year the resource itself was created.
-->
<metadata xmlns="http://www.lyncode.com/xoai">
<element name="dc">
<element name="date">
<element name="issued">
<element name="none">
<field name="value">0000</field>
</element>
</element>
</element>
<element name="title">
<element name="none">
<field name="value">A Compiled Newsreel</field>
</element>
</element>
</element>
<element name="local">
<element name="approximateDate">
<element name="issued">
<element name="none">
<field name="value">1920, 1932</field>
</element>
</element>
</element>
<element name="additional">
<element name="metadata">
<element name="none">
<field name="value">Nid:2307
Begin year of resource creation (field_year):1787
Readily Available (field_resource_available):Yes</field>
</element>
</element>
</element>
</element>
<element name="others">
<field name="handle">20.500.12801/3-4</field>
<field name="identifier">oai:lindat.mff.cuni.cz:20.500.12801/3-4</field>
</element>
<element name="repository">
<field name="name">LINDAT/CLARIAH-CZ</field>
<field name="url">https://lindat.mff.cuni.cz/repository/</field>
</element>
</metadata>
34 changes: 34 additions & 0 deletions dspace-oai/src/test/resources/xoai-ccmm-minimal-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

The contents of this file are subject to the license and copyright
detailed in the LICENSE and NOTICE files at the root of the source
tree and available online at

http://www.dspace.org/license/

-->
<!--
Minimal XOAI metadata XML for CCMM crosswalk fallback testing.
Missing most DC fields to trigger fallback behavior for required CCMM elements:
- title (missing -> "Untitled")
- publication_year (missing issued/accessioned -> "9999")
- subject (missing -> "unspecified")
- identifier (only others/handle available)
- repository name (missing -> "Unknown Repository")
-->
<metadata xmlns="http://www.lyncode.com/xoai" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.lyncode.com/xoai http://www.lyncode.com/xsd/xoai.xsd">
<element name="dc">
<element name="rights">
<element name="none">
<field name="value">All rights reserved</field>
</element>
</element>
</element>
<element name="others">
<field name="handle">99999/test-1</field>
<field name="identifier">oai:test.repository:99999/test-1</field>
<field name="lastModifyDate">2025-01-01 00:00:00.000</field>
</element>
</metadata>
Loading
Loading