Skip to content

Commit

Permalink
issue #75: add tag 950
Browse files Browse the repository at this point in the history
  • Loading branch information
pkiraly committed Dec 8, 2020
1 parent df80fa0 commit 710603d
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
### Added

- British Library tags: 039, 091, 509, 539, 590, 591, 592, 594, 595, 596, 597, 598, 599,
690, 692, 852$a (code list), 859, 909, 916, 917, 945
690, 692, 852$a (code list), 859, 909, 916, 917, 945, 950
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
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;

/**
* Library of Congress Subject (Cross-Reference)
*/
public class Tag950 extends DataFieldDefinition {

private static Tag950 uniqueInstance;

private Tag950() {
initialize();
postCreation();
}

public static Tag950 getInstance() {
if (uniqueInstance == null)
uniqueInstance = new Tag950();
return uniqueInstance;
}

private void initialize() {

tag = "950";
label = "Library of Congress Subject (Cross-Reference)";
mqTag = "locSubjectCrossReference";
cardinality = Cardinality.Repeatable;
// descriptionUrl = "https://www.loc.gov/marc/bibliographic/bd037.html";
// setCompilanceLevels("O");

ind1 = new Indicator();

ind2 = new Indicator();

setSubfieldsWithCardinality(
"a", "Topical term or geographic name entry element", "R",
"s", "See/See also", "R",
"x", "Subject or form subdivision", "R",
"y", "Chronological subdivision", "R",
"z", "Geographic subdivision", "R"
);

getSubfield("a").setMqTag("topicalTerm");
getSubfield("s").setMqTag("see");
getSubfield("x").setMqTag("subject");
getSubfield("y").setMqTag("chronological");
getSubfield("z").setMqTag("geographic");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package de.gwdg.metadataqa.marc.definition.tags.bltags;

import de.gwdg.metadataqa.marc.DataField;
import org.junit.Test;

public class Tag950Test extends BLTagTest {

public Tag950Test() {
super(Tag950.getInstance());
}

@Test
public void testValidFields() {
validField(new DataField(tag, " ", " ", "a", "Mudia (Indic people)",
"s", "See",
"a", "Muria (Indic people)"));
validField(new DataField(tag, " ", " ", "a", "Yanadi (Indic people)",
"s", "See also",
"a", "Nakkala (Indic people)"));
validField(new DataField(tag, " ", " ", "a", "Ethiopian-Italian War, 1935-1936",
"s", "See",
"a", "Italo-Ethiopian War, 1935-1936"));
validField(new DataField(tag, " ", " ", "a", "Italy",
"x", "History",
"y", "War in Ethiopia, 1935-1936",
"s", "See",
"a", "Italo-Ethiopian War, 1935-1936"));
validField(new DataField(tag, " ", " ", "a", "African Americans",
"s", "See",
"a", "Afro-Americans"));
validField(new DataField(tag, " ", " ", "a", "Black Americans",
"s", "See",
"a", "Afro-Americans"));
validField(new DataField(tag, " ", " ", "a", "Colored people (United States)",
"s", "See",
"a", "Afro-Americans"));
validField(new DataField(tag, " ", " ", "a", "Arabs",
"x", "History",
"y", "622-1517",
"s", "See",
"a", "Islamic Empire"));
validField(new DataField(tag, " ", " ", "a", "Kuchipudi Bharatam",
"s", "See",
"a", "Kuchipudi (Dance)"));
validField(new DataField(tag, " ", " ", "a", "Dance",
"z", "India",
"s", "See also",
"a", "Bharata natyam; Kathak (Dance); Kuchipudi (Dance); Odissi dance"));
}

@Test
public void testInvalidFields() {
invalidField("2", "a", "Priority processing");
invalidField("b", "Priority processing");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void testListTag() {
List<Class<? extends DataFieldDefinition>> tags = MarcTagLister.listTags();
assertNotNull(tags);
assertNotEquals(0, tags.size());
assertEquals(343, tags.size());
assertEquals(344, tags.size());
assertEquals("Tag010", tags.get(0).getSimpleName());
Map<String, Integer> versionCounter = new HashMap<>();
Map<MarcVersion, Integer> versionCounter2 = new HashMap<>();
Expand Down

0 comments on commit 710603d

Please sign in to comment.