Commit 58bd1ded authored by Steinberg, Jan's avatar Steinberg, Jan

exeley first stage

parent 10694611
......@@ -138,7 +138,6 @@ public class BundlesStreamSourceFactory {
}
return result;
}
public InputStream getExcelInputStreamFromDataString(String data) {
InputStream result = null;
//e.g. data == "excel-database-3" for a lookup in the database org.gesis.dda.wizard.domain.File JPA entity and its byte[] data field
......
......@@ -181,7 +181,11 @@ public class XsltTransformerOaiPmhBundlesStreamSource implements BundlesStreamSo
// --- STEP 1: get XML input
String getRecordXmlDocumentResponseString = client.getRecordString(oaiPmhIdentifier, metadataPrefix);
// try to make exeley data transformable ( & -> & to start with)
// ToDo: find the right location for it!
if ( getRecordXmlDocumentResponseString.contains("identifier=\"oai:exeley.com:10.") ) {
getRecordXmlDocumentResponseString = getRecordXmlDocumentResponseString.replace("&", "&");
}
//LOG.info("--------------------------");
//LOG.info("{}", getRecordXmlDocumentResponseString);
if ( isDeletedRecord(getRecordXmlDocumentResponseString) ) {
......
......@@ -229,6 +229,68 @@ public class XsltTransformerOaiPmhBundlesStreamSourceTest {
assertFalse( metadata.contains( new SimpleMetadatum("dc.language", "ru") ) );
}
@Test
public void getSinglePublicationExeley() throws IOException {
Map<String, String> map = new HashMap<>();
String oaiDcXsltString = IOUtils.toString(
getClass().
getClassLoader().
getResourceAsStream("xslt/exeley-pam-2-xmlbundle.xslt"), StandardCharsets.UTF_8);
map.put("oai_dc", oaiDcXsltString);
XsltTransformerOaiPmhBundlesStreamSource bss = new XsltTransformerOaiPmhBundlesStreamSource("http://www.exeley.com/oai/", map);
Bundle bundle = bss.getBundle("oai:exeley.com:10.21307/joss-2018-001");
LOG.info("{}", bundle);
Set<Metadatum> metadata = bundle.getMetadata();
metadata.stream().map(Object::toString).forEach(LOG::info);
assertTrue( metadata.contains( new SimpleMetadatum("dc.type.stock", "article") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.type.document", "32") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.source.journal", "1439") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.description.pubstatus", "1") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.contributor.author", "Krishna, M.") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.contributor.author", "Bino Paul, G.D.") ) );
assertEquals(2, metadata.stream().filter(m -> m.getKey().equals("dc.contributor.author") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.description.review", "1") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.description.review") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.date.issued", "2018") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.description.abstract", "de", "\"Deutschland ist ein reiches Land\" dieses Bild dürften die meisten Menschen teilen, auch wenn es brüchig wird, wo doch Obdachlose und Bettler_innen in den Innenstädten, Tafeln und Kleiderkammern, Umsonstläden und Lebensmittelausgabestellen für Bedürftige eine andere Wirklichkeit zeigen. In Hamburg ist diese Spanne von Reich und Arm in besonderer Weise prägend.") ) );
// assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.description.abstract") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.issn", "1529-1227") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.url", "https://journals.sub.uni-hamburg.de/hjk/article/view/756/759") ) );
// assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.identifier.url") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.language", "en") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.issue", "1") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.source.issue") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.rights.licence", "16") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.source.issuetopic", "OBEN_UNTEN : Bilder vom Leben der Anderen") ) );
// assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.source.issuetopic") ).count() );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.source.pageinfo", "3-6") ) );
// assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.source.pageinfo") ).count() );
assertTrue( metadata.contains( new SimpleMetadatum("dc.title", "en", "The Structure of Collaboration Networks: An Illustration of Indian Economics") ) );
assertEquals(1, metadata.stream().filter(m -> m.getKey().equals("dc.title") ).count() );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.urn", "urn:nbn:de:gbv:18-8-7560") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.identifier.doi", "https://doi.org/10.21307/joss-2018-001") ) );
assertTrue( metadata.contains( new SimpleMetadatum("internal.dda.reference", "http://www.exeley.com/oai/@@oai:exeley.com:10.21307/joss-2018-001") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.publisher.country", "USA") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("internal.identifier.classoz", "10900") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.classoz", "10900") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("internal.identifier.ddc", "300") ) );
// assertTrue( metadata.contains( new SimpleMetadatum("dc.subject.ddc", "300") ) );
assertTrue( metadata.contains( new SimpleMetadatum("internal.status", "formal und inhaltlich fertig erschlossen") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.other", "Collaboration") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.other", "Structure") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.other", "Networks") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.other", "Degree") ) );
assertTrue( metadata.contains( new SimpleMetadatum("dc.source.other", "Indian economics") ) );
Set<InputStream> fileSet = bundle.getContents();
assertEquals( 1, fileSet.size());
}
@Test
public void getSinglePublicationHjk() throws IOException {
Map<String, String> map = new HashMap<>();
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment