-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
131 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
src/main/java/de/gwdg/metadataqa/marc/definition/tags/bltags/TagONX.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
package de.gwdg.metadataqa.marc.definition.tags.bltags; | ||
|
||
import de.gwdg.metadataqa.marc.definition.Cardinality; | ||
import de.gwdg.metadataqa.marc.definition.DataFieldDefinition; | ||
import de.gwdg.metadataqa.marc.definition.Indicator; | ||
import de.gwdg.metadataqa.marc.definition.general.codelist.CountryCodes; | ||
import de.gwdg.metadataqa.marc.definition.general.codelist.LanguageCodes; | ||
|
||
/** | ||
* ONIX Subjects | ||
*/ | ||
public class TagONX extends DataFieldDefinition { | ||
|
||
private static TagONX uniqueInstance; | ||
|
||
private TagONX() { | ||
initialize(); | ||
postCreation(); | ||
} | ||
|
||
public static TagONX getInstance() { | ||
if (uniqueInstance == null) | ||
uniqueInstance = new TagONX(); | ||
return uniqueInstance; | ||
} | ||
|
||
private void initialize() { | ||
|
||
tag = "ONX"; | ||
label = "ONIX Un-Mapped Data"; | ||
mqTag = "OnixUnmappedData"; | ||
cardinality = Cardinality.Nonrepeatable; | ||
// descriptionUrl = "https://www.loc.gov/marc/bibliographic/bd037.html"; | ||
// setCompilanceLevels("O"); | ||
|
||
ind1 = new Indicator(); | ||
|
||
ind2 = new Indicator(); | ||
|
||
setSubfieldsWithCardinality( | ||
"a", "Country of publication code", "NR", | ||
"b", "Language code", "NR", | ||
"c", "Edition type code", "NR" | ||
); | ||
|
||
// TODO: the example use capital letters, the country code list contains small letters | ||
getSubfield("a") | ||
// .setCodeList(CountryCodes.getInstance()) | ||
.setMqTag("country"); | ||
|
||
getSubfield("b") | ||
.setCodeList(LanguageCodes.getInstance()) | ||
.setMqTag("language"); | ||
|
||
// https://www.medra.org/stdoc/onix-codelist-21.htm | ||
getSubfield("c") | ||
.setCodes( | ||
"ABR", "Abridged", | ||
"ADP", "Adapted", | ||
"ALT", "Alternate", | ||
"ANN", "Annotated", | ||
"BLL", "Bilingual edition", | ||
"BRL", "Braille edition", | ||
"CMB", "Combined volume", | ||
"CRI", "Critical", | ||
"CSP", "Coursepack", | ||
"DGO", "Digital original", | ||
"ENL", "Enlarged", | ||
"EXP", "Expurgated", | ||
"FAC", "Facsimile", | ||
"FST", "Festschrift", | ||
"ILL", "Illustrated", | ||
"LTE", "Large type / large print", | ||
"MCP", "Microprint", | ||
"MDT", "Media tie-in", | ||
"MLL", "Multilingual edition", | ||
"NED", "New edition", | ||
"NUM", "Edition with numbered copies", | ||
"PRB", "Prebound edition", | ||
"REV", "Revised", | ||
"SCH", "School edition", | ||
"SMP", "Simplified language edition", | ||
"SPE", "Special edition", | ||
"STU", "Student edition", | ||
"TCH", "Teacher’s edition", | ||
"UBR", "Unabridged", | ||
"ULP", "Ultra large print", | ||
"UXP", "Unexpurgated", | ||
"VAR", "Variorum" | ||
) | ||
.setMqTag("editionType"); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/test/java/de/gwdg/metadataqa/marc/definition/tags/bltags/TagONXTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package de.gwdg.metadataqa.marc.definition.tags.bltags; | ||
|
||
import org.junit.Test; | ||
|
||
public class TagONXTest extends BLTagTest { | ||
|
||
public TagONXTest() { | ||
super(TagONX.getInstance()); | ||
} | ||
|
||
@Test | ||
public void testValidFields() { | ||
validField("a", "AU", "c", "NED"); | ||
} | ||
|
||
@Test | ||
public void testInvalidFields() { | ||
invalidField("1", "a", "1"); | ||
// invalidField("a", "1."); | ||
// invalidField("b", "1"); | ||
invalidField("d", "1"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters