diff --git a/.classpath b/.classpath index 4b59fcf572..25e7ecd7cf 100644 --- a/.classpath +++ b/.classpath @@ -6,18 +6,18 @@ - + + - + - @@ -33,5 +33,25 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/pom.xml b/pom.xml index 00b76a3d75..d459b2e121 100644 --- a/pom.xml +++ b/pom.xml @@ -18,6 +18,11 @@ metafacture-io 5.1.0 + + org.metafacture + metafacture-json + 5.1.0 + org.metafacture metafacture-biblio @@ -99,9 +104,9 @@ 0.12.5 - xml-apis - xml-apis - 1.4.01 + xml-apis + xml-apis + 1.4.01 com.google.gdata @@ -158,6 +163,11 @@ async-http-client 1.9.33 + + javax.xml.bind + jaxb-api + 2.3.0 + diff --git a/src/main/resources/alma/alma.xml b/src/main/resources/alma/alma.xml new file mode 100644 index 0000000000..03bd427149 --- /dev/null +++ b/src/main/resources/alma/alma.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/alma/common/RSWK.xml b/src/main/resources/alma/common/RSWK.xml new file mode 100644 index 0000000000..0bf5d05a24 --- /dev/null +++ b/src/main/resources/alma/common/RSWK.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/alma/common/bibliomondo.xml b/src/main/resources/alma/common/bibliomondo.xml new file mode 100644 index 0000000000..7e9d78ca3d --- /dev/null +++ b/src/main/resources/alma/common/bibliomondo.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/alma/common/describedBy.xml b/src/main/resources/alma/common/describedBy.xml new file mode 100644 index 0000000000..dbcf5a5cfe --- /dev/null +++ b/src/main/resources/alma/common/describedBy.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/alma/common/facets.xml b/src/main/resources/alma/common/facets.xml new file mode 100644 index 0000000000..021377c1a2 --- /dev/null +++ b/src/main/resources/alma/common/facets.xml @@ -0,0 +1,1153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/alma/common/fields.xml b/src/main/resources/alma/common/fields.xml new file mode 100644 index 0000000000..c0079f800f --- /dev/null +++ b/src/main/resources/alma/common/fields.xml @@ -0,0 +1,726 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/alma/common/item.xml b/src/main/resources/alma/common/item.xml new file mode 100644 index 0000000000..7df170b254 --- /dev/null +++ b/src/main/resources/alma/common/item.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/alma/common/personCreator.xml b/src/main/resources/alma/common/personCreator.xml new file mode 100644 index 0000000000..6e7fca11ea --- /dev/null +++ b/src/main/resources/alma/common/personCreator.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/alma/common/titleOther.xml b/src/main/resources/alma/common/titleOther.xml new file mode 100644 index 0000000000..aacd9f884d --- /dev/null +++ b/src/main/resources/alma/common/titleOther.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/main/resources/alma/macros.xml b/src/main/resources/alma/macros.xml new file mode 100644 index 0000000000..f45222950f --- /dev/null +++ b/src/main/resources/alma/macros.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/alma/maps.xml b/src/main/resources/alma/maps.xml new file mode 100644 index 0000000000..a090aad096 --- /dev/null +++ b/src/main/resources/alma/maps.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/alma/maps/ISO639-2-to-GND.xml b/src/main/resources/alma/maps/ISO639-2-to-GND.xml new file mode 100644 index 0000000000..d1dfe995e1 --- /dev/null +++ b/src/main/resources/alma/maps/ISO639-2-to-GND.xml @@ -0,0 +1,479 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/alma/maps/alma-institution-code-to-isil.xml b/src/main/resources/alma/maps/alma-institution-code-to-isil.xml new file mode 100644 index 0000000000..8abc18b09b --- /dev/null +++ b/src/main/resources/alma/maps/alma-institution-code-to-isil.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/main/resources/schemata/metamorph.xsd b/src/main/resources/schemata/metamorph.xsd index 55331e17a9..16218d5b79 100644 --- a/src/main/resources/schemata/metamorph.xsd +++ b/src/main/resources/schemata/metamorph.xsd @@ -59,6 +59,7 @@ + @@ -68,7 +69,7 @@ - + @@ -100,7 +101,7 @@ - + @@ -207,6 +208,7 @@ customised. + @@ -242,6 +244,7 @@ generated by the all-statement can be customised. + @@ -272,6 +275,20 @@ generated by the all-statement can be customised. + + + + + + + + + + + + + + Concatenates all received literals @@ -286,8 +303,14 @@ generated by the all-statement can be customised. + + + If true values are not appended at the end + of the output string but prepended at its start. + + - + @@ -325,7 +348,7 @@ decreasing order of definition. - + @@ -359,6 +382,7 @@ decreasing order of definition. + @@ -551,11 +575,6 @@ collector. - - - - - @@ -570,6 +589,7 @@ collector. + @@ -584,8 +604,11 @@ collector. + + - + + @@ -603,7 +626,6 @@ collector. - @@ -806,6 +828,15 @@ to Java Regular Expressions. + + + Returns the value only if given string is contained. + + + + + + Filters out dublicate literals @@ -846,6 +877,15 @@ to Java Regular Expressions. + + + Returns value only if given string is not contained. + + + + + + Buffers literals and resleases them on a flush signal. (Used to delay @@ -872,50 +912,47 @@ litereals) - - - - Current timestamp/time. - - - - - - - - - - - Format a date in a specific format. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + Current timestamp/time. + + + + + + + + + + Format a date in a specific format. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets literal value to a constant. diff --git a/src/test/java/UnitTests.java b/src/test/java/UnitTests.java index f35acbc75a..3acfffd2d7 100644 --- a/src/test/java/UnitTests.java +++ b/src/test/java/UnitTests.java @@ -15,7 +15,8 @@ org.lobid.resources.Hbz01MabXml2ElasticsearchLobidTest.class, TestGenerateContext.class, org.lobid.resources.Hbz01MabXmlDeletions2ElasticsearchTest.class, - org.lobid.resources.LocBibframeInstances2ElasticsearchTest.class }) + org.lobid.resources.LocBibframeInstances2ElasticsearchTest.class, + org.lobid.resources.AlmaMarc21XmlToLobidJsonTest.class }) public final class UnitTests { /* Suite class, groups tests via annotation above */ diff --git a/src/test/java/org/lobid/resources/AlmaMarc21XmlToLobidJsonTest.java b/src/test/java/org/lobid/resources/AlmaMarc21XmlToLobidJsonTest.java new file mode 100644 index 0000000000..d1a084b12a --- /dev/null +++ b/src/test/java/org/lobid/resources/AlmaMarc21XmlToLobidJsonTest.java @@ -0,0 +1,120 @@ +/* Copyright 2020 hbz, Pascal Christoph. Licensed under the EPL 2.0*/ + +package org.lobid.resources; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.PrintStream; +import java.util.Arrays; +import java.util.HashMap; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.metafacture.biblio.marc21.MarcXmlHandler; +import org.metafacture.io.FileOpener; +import org.metafacture.io.ObjectStdoutWriter; +import org.metafacture.io.ObjectWriter; +import org.metafacture.json.JsonEncoder; +import org.metafacture.metamorph.Metamorph; +import org.metafacture.xml.XmlDecoder; + +/** + * Test transformations of Alma MARC21 XML catalog data into lobid JSON-LD. + * + * @author Pascal Christoph (dr0i) + * + */ +public final class AlmaMarc21XmlToLobidJsonTest { + + private static final String MORPH = "src/main/resources/alma/alma.xml"; + private static final File DIRECTORY = new File("src/test/resources/alma/"); + private static final String XML = "xml"; + final HashMap morphVariables = new HashMap<>(); + private static boolean GENERATE_TESTDATA = + System.getProperty("generateTestData", "false").equals("true"); + private static final PrintStream ORIG_OUT = System.out; + private static final Logger LOG = + LogManager.getLogger(AlmaMarc21XmlToLobidJsonTest.class); + + /** + * Sets necessary morph variables. + */ + @Before + public void setup() { + morphVariables.put("isil", "DE-632"); + morphVariables.put("member", "DE-605"); + morphVariables.put("catalogid", "DE-605"); + } + + /** + * Cleans a bit up. Sets the System.out to the original PrintStream. + */ + @After + public void cleanup() { + System.setOut(ORIG_OUT); + } + + /** + * Tests files from the test directory, one per one. Ignore the dynamically + * created "endTime". + * + * If the System-Property "generateTestData" is set to true the generated data + * is written into files and thus will act as the new expected data. + */ + @Test + public void transformFiles() { + Arrays.asList(DIRECTORY.listFiles(f -> f.getAbsolutePath().endsWith(XML))) + .forEach(file -> { + JsonEncoder jsonEncoder = new JsonEncoder(); + jsonEncoder.setPrettyPrinting(true); + ObjectMapper mapper = new ObjectMapper(); + final String filenameJson = + file.getAbsolutePath().replaceAll("\\." + XML, "\\.json"); + try { + FileOpener opener = new FileOpener(); + opener.setReceiver(new XmlDecoder()) + .setReceiver(new MarcXmlHandler()) + .setReceiver(new Metamorph(MORPH, morphVariables)) + .setReceiver(jsonEncoder); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + PrintStream ps = new PrintStream(baos); + System.setOut(ps); + if (GENERATE_TESTDATA) { + jsonEncoder.setReceiver(new ObjectWriter<>(filenameJson)); + } else { + jsonEncoder.setReceiver(new ObjectStdoutWriter()); + } + opener.process(file.getAbsolutePath()); + opener.closeStream(); + if (!GENERATE_TESTDATA) { + JsonNode expectedJsonNode = mapper.readTree(new File(filenameJson)); + Object expectedJsonObject = + mapper.readValue(expectedJsonNode.toString(), Object.class); + String expectedJson = mapper.writerWithDefaultPrettyPrinter() + .writeValueAsString(expectedJsonObject); + String actualJson = null; + actualJson = baos.toString(); + LOG.debug(actualJson); + // don't test the dynamically created "endTime", e.g: + // "endTime":"2020-11-30T10:03:42", + assertEquals(expectedJson.replaceFirst("endTime.{25}", ""), + actualJson.substring(0, actualJson.length() - 1) + .replaceFirst("endTime.{25}", "")); + } + } catch (Exception e) { + e.printStackTrace(); + fail(); + } + }); + } +} diff --git a/src/test/resources/alma/HT005207972.json b/src/test/resources/alma/HT005207972.json new file mode 100644 index 0000000000..20b7eb13e6 --- /dev/null +++ b/src/test/resources/alma/HT005207972.json @@ -0,0 +1,127 @@ +{ + "hbzId" : "HT005207972", + "almaIdMMS" : "990021367710206441", + "title" : "Labor economics", + "otherTitleInformation" : [ "wages, employment, and trade unionism" ], + "hasItem" : [ { + "type" : [ "Item" ], + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-605#!", + "label" : "lobid Organisation" + }, + "id" : "https://lobid.org/item/990021367710206441" + }, { + "type" : [ "Item" ], + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-290#!", + "label" : "lobid Organisation" + }, + "id" : "https://lobid.org/item/991003575109706445" + }, { + "type" : [ "Item" ], + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-361#!", + "label" : "lobid Organisation" + }, + "id" : "https://lobid.org/item/991020238039706442" + } ], + "type" : [ "Book", "BibliographicResource" ], + "@context" : "http://lobid.org/resources/context.jsonld", + "id" : "http://lobid.org/resources/HT005207972#!", + "language" : [ { + "label" : "Deutsch", + "id" : "http://id.loc.gov/vocabulary/iso639-2/ger" + } ], + "isbn" : [ "0256018243" ], + "contribution" : [ { + "role" : { + "id" : "http://id.loc.gov/vocabulary/relators/cre", + "label" : "Autor/in" + }, + "type" : [ "Contribution" ], + "agent" : { + "label" : "Marshall, Ray", + "type" : [ "Person" ], + "gndIdentifier" : "110525310", + "id" : "https://d-nb.info/gnd/110525310" + } + }, { + "type" : [ "Contribution" ], + "agent" : { + "label" : "F. Ray Marshall ; Allan M. Cartter ; Allan G. King", + "type" : [ "Person" ] + }, + "role" : { + "id" : "http://id.loc.gov/vocabulary/relators/cre", + "label" : "Autor/in" + } + }, { + "role" : { + "id" : "http://id.loc.gov/vocabulary/relators/cre", + "label" : "Autor/in" + }, + "type" : [ "Contribution" ], + "agent" : { + "label" : "Cartter, Allan Murray", + "type" : [ "Person" ], + "gndIdentifier" : "127022538", + "id" : "https://d-nb.info/gnd/127022538" + } + }, { + "role" : { + "id" : "http://id.loc.gov/vocabulary/relators/cre", + "label" : "Autor/in" + }, + "type" : [ "Contribution" ], + "agent" : { + "label" : "King, Allan G.", + "type" : [ "Person" ], + "gndIdentifier" : "154733512", + "id" : "https://d-nb.info/gnd/154733512" + } + } ], + "edition" : [ "3. ed." ], + "publication" : [ { + "location" : "Homewood, Ill", + "publishedBy" : "Irwin", + "startDate" : "1976", + "type" : [ "PublicationEvent" ] + } ], + "extent" : "XIV, 633 S.", + "describedBy" : { + "sourceOrganization" : { + "id" : "http://lobid.org/organisations/002136771-HBZ01_todo", + "label" : "lobid Organisation" + }, + "dateCreated" : "20200716", + "id" : "http://lobid.org/resources/HT005207972", + "label" : "Webseite der hbz-Ressource HT005207972", + "type" : [ "BibliographicDescription" ], + "inDataset" : { + "id" : "http://lobid.org/resources/dataset#!", + "label" : "lobid-resources – Der hbz-Verbundkatalog als Linked Open Data" + }, + "resultOf" : { + "type" : [ "CreateAction" ], + "endTime" : "2020-12-08T17:36:47", + "instrument" : { + "id" : "https://github.com/hbz/lobid-resources", + "type" : [ "SoftwareApplication" ], + "label" : "Software lobid-resources" + }, + "object" : { + "id" : "http://lobid.org/hbz01/HT005207972", + "type" : [ "DataFeedItem" ], + "label" : "hbz-Ressource HT005207972 im Exportformat MARC21 XML", + "inDataset" : { + "id" : "https://datahub.io/dataset/hbz_unioncatalog", + "label" : "hbz_unioncatalog" + } + } + }, + "license" : [ { + "id" : "http://creativecommons.org/publicdomain/zero/1.0", + "label" : "Creative Commons-Lizenz CC0 1.0 Universal" + } ] + } +} diff --git a/src/test/resources/alma/HT005207972.xml b/src/test/resources/alma/HT005207972.xml new file mode 100644 index 0000000000..7b23e07547 --- /dev/null +++ b/src/test/resources/alma/HT005207972.xml @@ -0,0 +1,203 @@ + + + + 00000nam#a2200000#c#4500 + DE-605 + 20130124165800.0 + tu + 990712|1976####xxu###########|||#|#ger#c + HT005207972 + 990021367710206441 + + HT005207972 + + + (DE-605)HT005207972 + + + (ALEPHCCHBZ)002136771HBZ01 + + + 265495256 + OCoLC + + + 0256018243 + (uri) http://www.isbnsearch.org/isbn/0256018243 + + + (OCoLC)265495256 + (uri) http://www.worldcat.org/oclc/265495256 + + + 361 + ger + 385 + rakwb + + + ger + + + XD-US + + + Marshall, Ray + (DE-588)110525310 + aut + + + Labor economics + wages, employment, and trade unionism + F. Ray Marshall ; Allan M. Cartter ; Allan G. King + + + 3. ed. + + + Homewood, Ill. + Irwin + 1976 + + + XIV, 633 S. + + + Arbeitsökonomie + s + (DE-588)4322126-9 + + + Cartter, Allan Murray + (DE-588)127022538 + aut + + + King, Allan G. + (DE-588)154733512 + aut + + + 030 + a|1uc||||||17 + + + 050 + a||||||||||||| + + + 051 + m||||||| + + + 49HBZ_NETWORK + 990021367710206441 + HBZ Network + + + 49HBZ_UBD + 991003575109706445 + Technische Universitaet Dortmund + + + LOCAL + HBZ + 49HBZ_UBD + + + LOCAL + (DE-290)550572 + 49HBZ_UBD + + + LOCAL + 19990727 + 49HBZ_UBD + + + 49HBZ_BIE + 991020238039706442 + Universität Bielefeld + + + LOCAL + HBZ + 49HBZ_BIE + + + LOCAL + (DE-361)1151740 + 49HBZ_BIE + + + LOCAL + SL300 + SL850.VS + 49HBZ_BIE + + + LOCAL + 20020121 + 49HBZ_BIE + + + ILS + marc21 + 01 + false + 002136771-HBZ01 + 60 + import + 2020-07-16 15:35:10 Europe/Berlin + + + 2020-07-16 13:55:18 + 2237491950006445 + 49HBZ_UBD + false + import + + + 2020-07-16 13:55:18 + 2237491970006445 + 49HBZ_UBD + false + import + + + 2237491950006445 + 2337491940006445 + 1 + ZZZ + 5200/Mars + 20098056 + 49HBZ_UBD + + + 2237491970006445 + 2337491960006445 + 1 + ZZZ + F 29772 + 186573 + 49HBZ_UBD + @ + + + 2020-07-19 21:20:47 + 2249532290006442 + 49HBZ_BIE + false + import + + + 2249532290006442 + 2349532280006442 + 1 + item_08 + SL800 M367(3) + 138_1155937+01 + 49HBZ_BIE + + + diff --git a/src/test/resources/alma/HT012734833.json b/src/test/resources/alma/HT012734833.json new file mode 100644 index 0000000000..d712fbb416 --- /dev/null +++ b/src/test/resources/alma/HT012734833.json @@ -0,0 +1,95 @@ +{ + "hbzId" : "HT012734833", + "almaIdMMS" : "990108873860206441", + "title" : "Behavioural pharmacology", + "hasItem" : [ { + "type" : [ "Item" ], + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-605#!", + "label" : "lobid Organisation" + }, + "id" : "https://lobid.org/item/990108873860206441" + }, { + "type" : [ "Item" ], + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-A96#!", + "label" : "lobid Organisation" + }, + "id" : "https://lobid.org/item/991002245659706444" + }, { + "type" : [ "Item" ], + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-290#!", + "label" : "lobid Organisation" + }, + "id" : "https://lobid.org/item/991000300959706445" + } ], + "medium" : [ { + "id" : "http://rdaregistry.info/termList/RDAMediaType/1003", + "label" : "Datenträger" + }, { + "id" : "http://rdaregistry.info/termList/RDACarrierType/1018", + "label" : "Online-Ressource" + } ], + "type" : [ "Periodical", "BibliographicResource" ], + "@context" : "http://lobid.org/resources/context.jsonld", + "id" : "http://lobid.org/resources/HT012734833#!", + "language" : [ { + "label" : "Englisch", + "id" : "http://id.loc.gov/vocabulary/iso639-2/eng" + } ], + "IdentifierZDB" : [ { + "identifierZDB" : "1500025-4" + } ], + "issn" : [ "14735849" ], + "publication" : [ { + "location" : "Philadelphia, Pa", + "publishedBy" : "Lippincott Williams & Wilkins", + "startDate" : "1989", + "type" : [ "PublicationEvent" ] + } ], + "hasVersion" : [ { + "id" : "http://www.bibliothek.uni-regensburg.de/ezeit/?1500025" + }, { + "id" : "http://journals.lww.com/behaviouralpharm/pages/default.aspx" + }, { + "id" : "http://gateway.ovid.com/ovidweb.cgi?T=JS&NEWS=N&PAGE=toc&SEARCH=00008877-000000000-00000.kc&LINKTYPE=asBody&LINKPOS=1&D=ovft", + "label" : "Deutschlandweit zugänglich" + } ], + "describedBy" : { + "sourceOrganization" : { + "id" : "http://lobid.org/organisations/010887386-HBZ01_todo", + "label" : "lobid Organisation" + }, + "dateCreated" : "20200716", + "id" : "http://lobid.org/resources/HT012734833", + "label" : "Webseite der hbz-Ressource HT012734833", + "type" : [ "BibliographicDescription" ], + "inDataset" : { + "id" : "http://lobid.org/resources/dataset#!", + "label" : "lobid-resources – Der hbz-Verbundkatalog als Linked Open Data" + }, + "resultOf" : { + "type" : [ "CreateAction" ], + "endTime" : "2020-12-08T17:36:48", + "instrument" : { + "id" : "https://github.com/hbz/lobid-resources", + "type" : [ "SoftwareApplication" ], + "label" : "Software lobid-resources" + }, + "object" : { + "id" : "http://lobid.org/hbz01/HT012734833", + "type" : [ "DataFeedItem" ], + "label" : "hbz-Ressource HT012734833 im Exportformat MARC21 XML", + "inDataset" : { + "id" : "https://datahub.io/dataset/hbz_unioncatalog", + "label" : "hbz_unioncatalog" + } + } + }, + "license" : [ { + "id" : "http://creativecommons.org/publicdomain/zero/1.0", + "label" : "Creative Commons-Lizenz CC0 1.0 Universal" + } ] + } +} diff --git a/src/test/resources/alma/HT012734833.xml b/src/test/resources/alma/HT012734833.xml new file mode 100644 index 0000000000..572d2bfff6 --- /dev/null +++ b/src/test/resources/alma/HT012734833.xml @@ -0,0 +1,372 @@ + + + + 00000nms#a2200000#c#4500 + DE-605 + 20191010224400.0 + cr#||||||||||| + 991116m19899999xxu#####o##|########eng#c + HT012734833 + 990108873860206441 + + HT012734833 + + + (DE-605)HT012734833 + + + (ALEPHCCHBZ)010887386HBZ01 + + + 863021596 + OCoLC + + + 019926944 + DE-101b + + + 1500025-4 + DE-600 + + + 1473-5849 + + + 0955-8810 + + + (OCoLC)863021596 + (uri) http://www.worldcat.org/oclc/863021596 + + + (DE-600)1500025-4 + + + (DE-599)ZDB1500025-4 + + + 9000 + ger + DNB + 9999 + + + eng + + + XD-US + + + 15,3 + ssgn + + + PHARM + DE-84 + fid + + + 610 + DE-600 + zdbs + + + nl + + + Behav Pharmacol + din1502 + + + Behavioural pharmacology + Elektronische Ressource + + + Gesehen am 19.11.14 + + + Philadelphia, Pa. + Lippincott Williams & Wilkins + 1989- + + + Online-Ressource + + + 1.1989 - + + + 1.1\x + 1 + 1989 + + + C!URL-Ä(19-11-14) + + + Druckausg. + Behavioural pharmacology + Hagerstown : Lippincott Williams & Wilkins, 1989- + (DE-605)HT004230139 + F:776 + + + http://www.bibliothek.uni-regensburg.de/ezeit/?1500025 + EZB + + + http://journals.lww.com/behaviouralpharm/pages/default.aspx + Verlag + + + http://gateway.ovid.com/ovidweb.cgi?T=JS&NEWS=N&PAGE=toc&SEARCH=00008877-000000000-00000.kc&LINKTYPE=asBody&LINKPOS=1&D=ovft + Verlag; 1.1989 - 15.2004 + Deutschlandweit zugänglich + + + ZDB-1-LWW + + + 030 + a||u|||||||37 + + + 050 + ||||||||g||||| + + + 052 + p||||||a||||||| + + + 058 + cr|||||||||||| + + + 49HBZ_NETWORK + 990108873860206441 + HBZ Network + + + 49HBZ_FHA + 991002245659706444 + Fachhochschule Aachen + + + Druckausg. + Behavioural pharmacology + Hagerstown : Lippincott Williams & Wilkins, 1989- + (DE-605)HT004230139 + F:776 + 49HBZ_FHA + + + LOCAL + HBZ + 49HBZ_FHA + + + LOCAL + (DE-A96)230241 + 49HBZ_FHA + + + LOCAL + 20070907 + 49HBZ_FHA + + + LOCAL + http://www.bibliothek.uni-regensburg.de/ezeit/frontdoor.phtml?id=1500025&bibid=FHBAA + 49HBZ_FHA + + + 49HBZ_UBD + 991000300959706445 + Technische Universitaet Dortmund + + + Druckausg. + Behavioural pharmacology + Hagerstown : Lippincott Williams & Wilkins, 1989- + (DE-605)HT004230139 + F:776 + 49HBZ_UBD + + + LOCAL + HBZ + 49HBZ_UBD + + + LOCAL + (DE-290)1179358 + 49HBZ_UBD + + + LOCAL + 20070519 + 49HBZ_UBD + + + LOCAL + http://www.bibliothek.uni-regensburg.de/ezeit/frontdoor.phtml?id=1500025&bibid=UBDO + 49HBZ_UBD + + + ILS + marc21 + 01 + false + 010887386-HBZ01 + 90 + import + 2020-07-16 14:52:39 Europe/Berlin + + + System + 5333897520006444 + 49HBZ_FHA + static + Deutschlandweit zugänglich + 2020-07-23 14:31:47 Europe/Berlin + 2020-07-23 14:31:42 Europe/Berlin + https://eu04.alma.exlibrisgroup.com/view/uresolver/49HBZ_NETWORK/openurl?u.ignore_date_coverage=true&portfolio_pid=5333897520006444&Force_direct=true + P2E_JOB + 2020-07-23 12:31:42 + false + 5233897530006444 + e?u.ignore_date_coverage=true&rft.mms_id=991002245659706444 + Available + BOOK + 5333897520006444 + + + System + 5333897560006444 + 49HBZ_FHA + static + Deutschlandweit zugänglich + 2020-07-23 14:31:47 Europe/Berlin + 2020-07-23 14:31:42 Europe/Berlin + https://eu04.alma.exlibrisgroup.com/view/uresolver/49HBZ_NETWORK/openurl?u.ignore_date_coverage=true&portfolio_pid=5333897560006444&Force_direct=true + P2E_JOB + 2020-07-23 12:31:42 + false + 5233897570006444 + e?u.ignore_date_coverage=true&rft.mms_id=991002245659706444 + Available + BOOK + 5333897560006444 + + + System + 5333897540006444 + 49HBZ_FHA + static + Deutschlandweit zugänglich + 2020-07-23 14:31:47 Europe/Berlin + 2020-07-23 14:31:42 Europe/Berlin + https://eu04.alma.exlibrisgroup.com/view/uresolver/49HBZ_NETWORK/openurl?u.ignore_date_coverage=true&portfolio_pid=5333897540006444&Force_direct=true + P2E_JOB + 2020-07-23 12:31:42 + false + 5233897550006444 + e?u.ignore_date_coverage=true&rft.mms_id=991002245659706444 + Available + BOOK + 5333897540006444 + + + System + 5333897500006444 + 49HBZ_FHA + static + Deutschlandweit zugänglich + 2020-07-23 14:31:47 Europe/Berlin + 2020-07-23 14:31:42 Europe/Berlin + https://eu04.alma.exlibrisgroup.com/view/uresolver/49HBZ_NETWORK/openurl?u.ignore_date_coverage=true&portfolio_pid=5333897500006444&Force_direct=true + P2E_JOB + 2020-07-23 12:31:42 + false + 5233897510006444 + e?u.ignore_date_coverage=true&rft.mms_id=991002245659706444 + Available + BOOK + 5333897500006444 + + + System + 5375175020006445 + 49HBZ_UBD + static + Deutschlandweit zugänglich + 2020-07-23 13:09:58 Europe/Berlin + 2020-07-23 13:09:49 Europe/Berlin + https://eu04.alma.exlibrisgroup.com/view/uresolver/49HBZ_NETWORK/openurl?u.ignore_date_coverage=true&portfolio_pid=5375175020006445&Force_direct=true + P2E_JOB + 2020-07-23 11:09:49 + false + 5275175090006445 + e?u.ignore_date_coverage=true&rft.mms_id=991000300959706445 + Available + BOOK + 5375175020006445 + + + System + 5375174980006445 + 49HBZ_UBD + static + Deutschlandweit zugänglich + 2020-07-23 13:09:58 Europe/Berlin + 2020-07-23 13:09:49 Europe/Berlin + https://eu04.alma.exlibrisgroup.com/view/uresolver/49HBZ_NETWORK/openurl?u.ignore_date_coverage=true&portfolio_pid=5375174980006445&Force_direct=true + P2E_JOB + 2020-07-23 11:09:49 + false + 5275174990006445 + e?u.ignore_date_coverage=true&rft.mms_id=991000300959706445 + Available + BOOK + 5375174980006445 + + + System + 5375175000006445 + 49HBZ_UBD + static + Deutschlandweit zugänglich + 2020-07-23 13:09:58 Europe/Berlin + 2020-07-23 13:09:49 Europe/Berlin + https://eu04.alma.exlibrisgroup.com/view/uresolver/49HBZ_NETWORK/openurl?u.ignore_date_coverage=true&portfolio_pid=5375175000006445&Force_direct=true + P2E_JOB + 2020-07-23 11:09:49 + false + 5275175010006445 + e?u.ignore_date_coverage=true&rft.mms_id=991000300959706445 + Available + BOOK + 5375175000006445 + + + System + 5375174960006445 + 49HBZ_UBD + static + Deutschlandweit zugänglich + 2020-07-23 13:09:58 Europe/Berlin + 2020-07-23 13:09:49 Europe/Berlin + https://eu04.alma.exlibrisgroup.com/view/uresolver/49HBZ_NETWORK/openurl?u.ignore_date_coverage=true&portfolio_pid=5375174960006445&Force_direct=true + P2E_JOB + 2020-07-23 11:09:49 + false + 5275174970006445 + e?u.ignore_date_coverage=true&rft.mms_id=991000300959706445 + Available + BOOK + 5375174960006445 + + + diff --git a/src/test/resources/alma/KUR00770801.json b/src/test/resources/alma/KUR00770801.json new file mode 100644 index 0000000000..7956dc77f1 --- /dev/null +++ b/src/test/resources/alma/KUR00770801.json @@ -0,0 +1,98 @@ +{ + "hbzId" : "KUR00770801", + "almaIdMMS" : "990042506810206443", + "title" : "Microsoft ADO.NET 4 step by step", + "note" : "Includes index", + "hasItem" : [ { + "type" : [ "Item" ], + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-61#!", + "label" : "lobid Organisation" + }, + "id" : "https://lobid.org/item/990042506810206443" + } ], + "medium" : [ { + "id" : "http://rdaregistry.info/termList/RDAMediaType/1003", + "label" : "Datenträger" + }, { + "id" : "http://rdaregistry.info/termList/RDACarrierType/1018", + "label" : "Online-Ressource" + } ], + "type" : [ "Book", "BibliographicResource" ], + "@context" : "http://lobid.org/resources/context.jsonld", + "id" : "http://lobid.org/resources/ALMA990042506810206443#!", + "language" : [ { + "label" : "Englisch", + "id" : "http://id.loc.gov/vocabulary/iso639-2/eng" + } ], + "isbn" : [ "9780735638884" ], + "contribution" : [ { + "role" : { + "id" : "http://id.loc.gov/vocabulary/relators/cre", + "label" : "Autor/in" + }, + "type" : [ "Contribution" ], + "agent" : { + "label" : "Patrick, Tim", + "type" : [ "Person" ] + } + }, { + "type" : [ "Contribution" ], + "agent" : { + "label" : "Tim Patrick", + "type" : [ "Person" ] + }, + "role" : { + "id" : "http://id.loc.gov/vocabulary/relators/cre", + "label" : "Autor/in" + } + } ], + "publication" : [ { + "location" : "Sebastopol, Calif", + "publishedBy" : "O'Reilly Media", + "startDate" : "2010", + "type" : [ "PublicationEvent" ] + } ], + "extent" : "1 online resource (xxiii, 411 p.) : ill", + "abstract" : [ "Provides tutorials and examples on using ADO.NET 4 to create datacentric applications for Windows and the Web" ], + "hasVersion" : [ { + "label" : "Connect to this resource online", + "id" : "http://proquest.tech.safaribooksonline.de/?uiCode=Duesseldorf&xmlId=9780735656260" + } ], + "describedBy" : { + "sourceOrganization" : { + "id" : "http://lobid.org/organisations/004250681-DUE01_todo", + "label" : "lobid Organisation" + }, + "dateCreated" : "20200701", + "id" : "http://lobid.org/resources/ALMA990042506810206443", + "label" : "Webseite der hbz-Ressource ALMA990042506810206443", + "type" : [ "BibliographicDescription" ], + "inDataset" : { + "id" : "http://lobid.org/resources/dataset#!", + "label" : "lobid-resources – Der hbz-Verbundkatalog als Linked Open Data" + }, + "resultOf" : { + "type" : [ "CreateAction" ], + "endTime" : "2020-12-08T17:36:47", + "instrument" : { + "id" : "https://github.com/hbz/lobid-resources", + "type" : [ "SoftwareApplication" ], + "label" : "Software lobid-resources" + }, + "object" : { + "id" : "http://lobid.org/hbz01/ALMA990042506810206443", + "type" : [ "DataFeedItem" ], + "label" : "hbz-Ressource ALMA990042506810206443 im Exportformat MARC21 XML", + "inDataset" : { + "id" : "https://datahub.io/dataset/hbz_unioncatalog", + "label" : "hbz_unioncatalog" + } + } + }, + "license" : [ { + "id" : "http://creativecommons.org/publicdomain/zero/1.0", + "label" : "Creative Commons-Lizenz CC0 1.0 Universal" + } ] + } +} diff --git a/src/test/resources/alma/KUR00770801.xml b/src/test/resources/alma/KUR00770801.xml new file mode 100644 index 0000000000..9702e070bb --- /dev/null +++ b/src/test/resources/alma/KUR00770801.xml @@ -0,0 +1,97 @@ + + + + 00000nam#a2200000#c#4500 + 20200518164500.0 + cu#||||||||||| + tu + 190923|2010####xx############|||#|#eng#c + KUR00770801 + 990042506810206443 + + KUR00770801 + + + (DE-61)KUR00770801 + + + (Aleph)004250681DUE01 + + + 9780735638884 + (uri) http://www.isbnsearch.org/isbn/9780735638884 + + + eng + + + Patrick, Tim + aut + + + Microsoft ADO.NET 4 step by step + Tim Patrick + + + Sebastopol, Calif. + O'Reilly Media + c2010 + + + 1 online resource (xxiii, 411 p.) + ill + + + txt + + + c + + + cr + + + Includes index + F:501 + + + Provides tutorials and examples on using ADO.NET 4 to create datacentric applications for Windows and the Web + + + Microsoft .NET Framework + + + Database design + + + Object-oriented programming (Computer science) + + + Microsoft LINQ. + + + Connect to this resource online + http://proquest.tech.safaribooksonline.de/?uiCode=Duesseldorf&xmlId=9780735656260 + Zugriff nur im Hochschulnetz der Universität Düsseldorf + + + safari-2019 + LOCAL + + + 49HBZ_DUE + 990042506810206443 + Universität Düsseldorf + + + ILS + marc21 + 01 + false + 004250681-DUE01 + 00 + import + 2020-07-01 12:09:43 Europe/Berlin + + + diff --git a/src/test/resources/output/json/01983/HT019838800.json b/src/test/resources/output/json/01983/HT019838800.json deleted file mode 100644 index 44d665fce4..0000000000 --- a/src/test/resources/output/json/01983/HT019838800.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "@context" : "http://lobid.org/resources/context.jsonld", - "contribution" : [ { - "agent" : { - "altLabel" : "Ziegler, Carina Zell-", - "gndIdentifier" : "1142549178", - "id" : "http://d-nb.info/gnd/1142549178", - "label" : "Zell-Ziegler, Carina", - "type" : [ "Person" ] - }, - "role" : { - "id" : "http://id.loc.gov/vocabulary/relators/cre", - "label" : "Autor/in" - }, - "type" : [ "Contribution" ] - }, { - "agent" : { - "gndIdentifier" : "133468887", - "id" : "http://d-nb.info/gnd/133468887", - "label" : "Förster, Hannah", - "type" : [ "Person" ] - }, - "role" : { - "id" : "http://id.loc.gov/vocabulary/relators/cre", - "label" : "Autor/in" - }, - "type" : [ "Contribution" ] - }, { - "agent" : { - "altLabel" : [ "Deutschland. Environmental Agency", "Deutschland. Division", "Deutschland. Pressestelle", "Deutschland. Federal Environmental Agency", "Deutschland. Arbeitsgruppe Agenda 21 - Nachhaltige Entwicklung", "Deutschland. Working Group Agenda 21 - Sustainable Development", "Environmental Agency. Deutschland", "Umweltbundesamt für Mensch und Umwelt. Deutschland", "Deutschland. Referat Umweltaufklärung", "Deutschland. Vedomstvo po Ochrane Okružajuščej Sredy", "Deutschland. Abteilung Bodenschutz", "German Environmental Protection Agency", "Federalʹnoe Vedomstvo po Ochrane Okružajuščej Sredy. Deutschland", "Deutschland. Umweltbundesamt für Mensch und Umwelt", "Environmental Protection Agency. Deutschland", "Deutschland. Environmental Protection Agency", "Deutschland. Projektgruppe Nährstoffeinträge in der Nordsee", "Federal Environmental Agency. Deutschland", "Vedomstvo po Ochrane Okružajuščej Sredy. Deutschland", "German Environment Agency", "Deutschland. Press Office", "Deutschland. Div.", "Federalny Urza̜d Środowiska. Deutschland", "Deutschland. Umweltbundesamt", "Deutschland. Urza̜d Środowiska", "Umweltbundesamt. Deutschland" ], - "gndIdentifier" : "2116834-9", - "id" : "http://d-nb.info/gnd/2116834-9", - "label" : "Deutschland. Umweltbundesamt", - "type" : [ "CorporateBody" ] - }, - "role" : { - "id" : "http://id.loc.gov/vocabulary/relators/pat", - "label" : "Im Auftrag von" - }, - "type" : [ "Contribution" ] - }, { - "agent" : { - "altLabel" : [ "Deutschland. Environmental Agency", "Deutschland. Division", "Deutschland. Pressestelle", "Deutschland. Federal Environmental Agency", "Deutschland. Arbeitsgruppe Agenda 21 - Nachhaltige Entwicklung", "Deutschland. Working Group Agenda 21 - Sustainable Development", "Environmental Agency. Deutschland", "Umweltbundesamt für Mensch und Umwelt. Deutschland", "Deutschland. Referat Umweltaufklärung", "Deutschland. Vedomstvo po Ochrane Okružajuščej Sredy", "Deutschland. Abteilung Bodenschutz", "German Environmental Protection Agency", "Federalʹnoe Vedomstvo po Ochrane Okružajuščej Sredy. Deutschland", "Deutschland. Umweltbundesamt für Mensch und Umwelt", "Environmental Protection Agency. Deutschland", "Deutschland. Environmental Protection Agency", "Deutschland. Projektgruppe Nährstoffeinträge in der Nordsee", "Federal Environmental Agency. Deutschland", "Vedomstvo po Ochrane Okružajuščej Sredy. Deutschland", "German Environment Agency", "Deutschland. Press Office", "Deutschland. Div.", "Federalny Urza̜d Środowiska. Deutschland", "Deutschland. Umweltbundesamt", "Deutschland. Urza̜d Środowiska", "Umweltbundesamt. Deutschland" ], - "gndIdentifier" : "2116834-9", - "id" : "http://d-nb.info/gnd/2116834-9", - "label" : "Deutschland. Umweltbundesamt", - "type" : [ "CorporateBody" ] - }, - "role" : { - "id" : "http://id.loc.gov/vocabulary/relators/isb", - "label" : "Herausgeber/in" - }, - "type" : [ "Contribution" ] - } ], - "describedBy" : { - "dateCreated" : "20181016", - "dateModified" : "20181018", - "id" : "http://lobid.org/resources/HT019838800", - "inDataset" : { - "id" : "http://lobid.org/resources/dataset#!", - "label" : "lobid-resources – Der hbz-Verbundkatalog als Linked Open Data" - }, - "label" : "Webseite der hbz-Ressource HT019838800", - "license" : [ { - "id" : "http://creativecommons.org/publicdomain/zero/1.0", - "label" : "Creative Commons-Lizenz CC0 1.0 Universal" - } ], - "resultOf" : { - "endTime" : "0001-01-01T00:00:00", - "instrument" : { - "id" : "https://github.com/hbz/lobid-resources", - "label" : "Software lobid-resources", - "type" : [ "SoftwareApplication" ] - }, - "object" : { - "id" : "http://lobid.org/hbz01/HT019838800", - "inDataset" : { - "id" : "https://datahub.io/dataset/hbz_unioncatalog", - "label" : "hbz_unioncatalog" - }, - "label" : "hbz-Ressource HT019838800 im Exportformat MAB2-XML", - "type" : [ "DataFeedItem" ] - }, - "type" : [ "CreateAction" ] - }, - "sourceOrganization" : { - "id" : "http://lobid.org/organisations/DE-98#!", - "label" : "lobid Organisation" - }, - "type" : [ "BibliographicDescription" ] - }, - "doi" : [ "10.4126/FRL01-006410624" ], - "extent" : "1 Online-Ressource (41 Seiten)", - "hasItem" : [ { - "describedBy" : { - "id" : "http://lobid.org/items/HT019838800:DE-98:", - "label" : "lobid Bestandsressource" - }, - "heldBy" : { - "id" : "http://lobid.org/organisations/DE-98", - "label" : "lobid Organisation" - }, - "id" : "http://lobid.org/items/HT019838800:DE-98:#!", - "itemOf" : { - "id" : "http://lobid.org/resources/HT019838800#!", - "label" : "lobid Ressource" - }, - "label" : "lobid Bestandsressource", - "type" : [ "Item" ] - } ], - "hasVersion" : [ { - "id" : "https://repository.publisso.de/resource/frl:6410624", - "label" : "frl:6410624" - } ], - "hbzId" : "HT019838800", - "id" : "http://lobid.org/resources/HT019838800#!", - "inCollection" : [ { - "id" : "http://repository.publisso.de", - "label" : "Fachrepositorium Lebenswissenschaften", - "type" : [ "Collection" ] - } ], - "isPartOf" : [ { - "hasSuperordinate" : [ { - "id" : "http://lobid.org/resources/HT015775916#!", - "label" : "Texte / Umweltbundesamt" - } ], - "numbering" : "2018, 55", - "type" : [ "IsPartOfRelation" ] - } ], - "language" : [ { - "id" : "http://id.loc.gov/vocabulary/iso639-2/deu", - "label" : "Deutsch" - } ], - "medium" : [ { - "id" : "http://rdaregistry.info/termList/RDACarrierType/1018", - "label" : "Online-Ressource" - } ], - "note" : [ "Aus dem Impressum: \"Abschlussdatum: Juli 2018\"", "\"EVUPLAN des Bundesministerium für Wirtschaft und Energie; Forschungskennzahl 37EV 16 124 0\"" ], - "otherTitleInformation" : [ "Relevanz von Suffizienz in der Modellierung, Übersicht über die aktuelle Modellierungspraxis und Ableitung methodischer Empfehlungen : Zwischenbericht zu AP 2.1 „Möglichkeiten der Instrumentierung von Energieverbrauchsreduktion durch Verhaltensänderung“" ], - "publication" : [ { - "location" : "Dessau-Roßlau", - "publishedBy" : "Herausgeber: Umweltbundesamt", - "startDate" : "2018", - "type" : [ "PublicationEvent" ] - } ], - "responsibilityStatement" : [ "von Carina Zell-Ziegler und Dr. Hannah Förster, Öko-Institut e.V., Berlin ; im Auftrag des Umweltbundesamtes" ], - "sameAs" : [ { - "id" : "http://hub.culturegraph.org/resource/HBZ-HT019838800", - "label" : "Culturegraph Ressource" - } ], - "similar" : [ { - "id" : "http://dx.doi.org/10.4126/FRL01-006410624", - "label" : "FRL01-006410624" - } ], - "subject" : [ { - "notation" : "630", - "source" : { - "id" : "http://d-nb.info/gnd/4149423-4", - "label" : "Dewey-Dezimalklassifikation" - } - } ], - "title" : "Mit Suffizienz mehr Klimaschutz modellieren", - "type" : [ "BibliographicResource", "Report", "Book" ] -} \ No newline at end of file diff --git a/src/test/resources/output_api10/json/01722/HT017225272 b/src/test/resources/output_api10/json/01722/HT017225272 deleted file mode 100644 index e3364a454c..0000000000 --- a/src/test/resources/output_api10/json/01722/HT017225272 +++ /dev/null @@ -1,49 +0,0 @@ -{ - "@context" : "http://lobid.org/resources/context.jsonld", - "contributorLabel" : [ "Kindred Dick, Philip", "Dowland, Jack", "Dick, Phillip K.", "Phillips, Richard", "Dick, Philip H.", "Dick, Philip K.", "Dick, Philip Kindred" ], - "creator" : [ { - "id" : "http://d-nb.info/gnd/118678175", - "label" : "118678175", - "preferredName" : "Dick, Philip K.", - "preferredNameForThePerson" : "Dick, Philip K." - } ], - "describedby" : [ { - "id" : "http://lobid.org/resource/HT017225272/about", - "label" : "about", - "primaryTopic" : { - "id" : "http://lobid.org/resource/HT017225272", - "label" : "lobid Ressource" - } - } ], - "exemplar" : [ { - "id" : "http://lobid.org/item/HT017225272:DE-5:", - "label" : "HT017225272:DE-5:" - } ], - "extent" : [ "159 S." ], - "hbzId" : [ "HT017225272" ], - "id" : "http://lobid.org/resource/HT017225272", - "isPrimaryTopicOf" : [ { - "id" : "http://193.30.112.134/F/?func=find-c&ccl_term=IDN%3DHT017225272", - "label" : "?func=find-c&ccl_term=IDN%3DHT017225272" - } ], - "isbn" : [ "0853910812", "9780853910817" ], - "issued" : [ "1969" ], - "language" : [ { - "id" : "http://id.loc.gov/vocabulary/iso639-2/eng", - "label" : "eng" - } ], - "medium" : [ { - "id" : "http://rdvocab.info/termList/RDAproductionMethod/1010", - "label" : "1010" - } ], - "note" : [ "Originally published,Doubleday,1968" ], - "placeOfPublication" : [ "New York" ], - "publicationStatement" : [ "New York; The New American Library; 1969" ], - "publisher" : [ "The New American Library" ], - "sameAs" : [ { - "id" : "http://hub.culturegraph.org/resource/HBZ-HT017225272", - "label" : "HBZ-HT017225272" - } ], - "title" : [ "Do androids dream of electric sheep?" ], - "type" : [ "BibliographicResource", "Book" ] -} \ No newline at end of file diff --git a/src/test/schemas/context.json b/src/test/resources/schemas/context.json similarity index 100% rename from src/test/schemas/context.json rename to src/test/resources/schemas/context.json diff --git a/src/test/schemas/contribution.json b/src/test/resources/schemas/contribution.json similarity index 100% rename from src/test/schemas/contribution.json rename to src/test/resources/schemas/contribution.json diff --git a/src/test/schemas/description.json b/src/test/resources/schemas/description.json similarity index 100% rename from src/test/schemas/description.json rename to src/test/resources/schemas/description.json diff --git a/src/test/schemas/hasItem.json b/src/test/resources/schemas/hasItem.json similarity index 100% rename from src/test/schemas/hasItem.json rename to src/test/resources/schemas/hasItem.json diff --git a/src/test/schemas/id.json b/src/test/resources/schemas/id.json similarity index 100% rename from src/test/schemas/id.json rename to src/test/resources/schemas/id.json diff --git a/src/test/schemas/resource.json b/src/test/resources/schemas/resource.json similarity index 100% rename from src/test/schemas/resource.json rename to src/test/resources/schemas/resource.json diff --git a/src/test/schemas/type.json b/src/test/resources/schemas/type.json similarity index 100% rename from src/test/schemas/type.json rename to src/test/resources/schemas/type.json diff --git a/src/test/resources/validateJsonTestFiles.sh b/src/test/resources/validateJsonTestFiles.sh index 09332c6236..588ae688ca 100644 --- a/src/test/resources/validateJsonTestFiles.sh +++ b/src/test/resources/validateJsonTestFiles.sh @@ -2,9 +2,15 @@ # Description: Tests generated JSON files against schemas # Prerequisites: install 'ajv':$ npm install -g ajv-cli +# old transformation of Aleph data, known to be often invalid: +# DIRECTORY_OF_JSON_TO_VALIDATE="jsonld/" +# new transformation of Alma data: +DIRECTORY_OF_JSON_TO_VALIDATE="alma/" + + for version in "draft"; do echo "Testing version: $version" - ajv test -s ../schemas/resource.json -r "../schemas/*.json" -d "../resources/jsonld/*.json" --valid + ajv test -s schemas/resource.json -r "schemas/*.json" -d "${DIRECTORY_OF_JSON_TO_VALIDATE}/*.json" --invalid 2>&1 done if [ $? -eq 0 ]