Skip to content

Commit

Permalink
Cleanup Avram schema files of K10plus and allow updating the schema #291
Browse files Browse the repository at this point in the history
  • Loading branch information
pkiraly committed Nov 6, 2023
1 parent 2b89051 commit 3cf58f8
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void getScores_forMarc() throws IOException, URISyntaxException {

@Test
public void getScores_forPica() throws Exception {
PicaSchemaManager schema = PicaSchemaReader.createSchema(CliTestUtils.getTestResource("pica/k10plus.json"));
PicaSchemaManager schema = PicaSchemaReader.createSchema(CliTestUtils.getTestResource("pica/schema/k10plus.json"));
MarcReader reader = QAMarcReaderFactory.getFileReader(MarcFormat.PICA_PLAIN, CliTestUtils.getTestResource("pica/k10plus-sample.pica"), null);
reader.hasNext();
Record record = reader.next();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void validate() {
}

private DataField getDatafield() {
PicaSchemaManager schema = PicaSchemaReader.createSchema(CliTestUtils.getTestResource("pica/k10plus.json"));
PicaSchemaManager schema = PicaSchemaReader.createSchema(CliTestUtils.getTestResource("pica/schema/k10plus.json"));
MarcReader reader;
try {
reader = QAMarcReaderFactory.getFileReader(MarcFormat.PICA_NORMALIZED, CliTestUtils.getTestResource("pica/pica-with-holdings-info.dat"), null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

public class ValidatorTest {

PicaSchemaManager schema = PicaSchemaReader.createSchema(CliTestUtils.getTestResource("pica/k10plus.json"));
PicaSchemaManager schema = PicaSchemaReader.createSchema(CliTestUtils.getTestResource("pica/schema/k10plus.json"));
Validator validator = new Validator(new ValidatorConfiguration().withSchemaType(SchemaType.PICA));
MarcReader reader;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void setUp() throws Exception {

@Test
public void pica() throws Exception {
PicaSchemaManager schema = PicaSchemaReader.createSchema(CliTestUtils.getTestResource("pica/k10plus.json"));
PicaSchemaManager schema = PicaSchemaReader.createSchema(CliTestUtils.getTestResource("pica/schema/k10plus.json"));
MarcReader reader = QAMarcReaderFactory.getFileReader(MarcFormat.PICA_PLAIN, CliTestUtils.getTestResource("pica/k10plus-sample.pica"), null);
reader.hasNext();
Record record = reader.next();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void testConstructorNullArgument() {

@Test
public void get_pica() throws Exception {
PicaSchemaManager schema = PicaSchemaReader.createSchema(CliTestUtils.getTestResource("pica/k10plus.json"));
PicaSchemaManager schema = PicaSchemaReader.createSchema(CliTestUtils.getTestResource("pica/schema/k10plus.json"));
BibliographicRecord marcRecord = new PicaRecord("u2407796");
marcRecord.addDataField(new DataField(schema.lookup("001B"), null, null, "0", "1999:02-05-18"));
BibSelector selector = BibSelectorFactory.create(marcRecord);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void setUp() throws Exception {

@Test
public void pica() throws Exception {
PicaSchemaManager schema = PicaSchemaReader.createSchema(CliTestUtils.getTestResource("pica/k10plus.json"));
PicaSchemaManager schema = PicaSchemaReader.createSchema(CliTestUtils.getTestResource("pica/schema/k10plus.json"));
MarcReader reader = QAMarcReaderFactory.getFileReader(MarcFormat.PICA_PLAIN, CliTestUtils.getTestResource("pica/k10plus-sample.pica"), null);
reader.hasNext();
Record record = reader.next();
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/de/gwdg/metadataqa/marc/cli/MarcToSolrTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void testVersionSpecificSubfield() {

@Test
public void pica() throws Exception {
PicaSchemaManager schema = PicaSchemaReader.createSchema(CliTestUtils.getTestResource("pica/k10plus.json"));
PicaSchemaManager schema = PicaSchemaReader.createSchema(CliTestUtils.getTestResource("pica/schema/k10plus.json"));
MarcReader reader = QAMarcReaderFactory.getFileReader(MarcFormat.PICA_PLAIN, CliTestUtils.getTestResource("pica/k10plus-sample.pica"), null);
reader.hasNext();
Record record = reader.next();
Expand All @@ -70,7 +70,7 @@ public void pica() throws Exception {

@Test
public void pica_extra() throws Exception {
PicaSchemaManager schema = PicaSchemaReader.createSchema(CliTestUtils.getTestResource("pica/k10plus.json"));
PicaSchemaManager schema = PicaSchemaReader.createSchema(CliTestUtils.getTestResource("pica/schema/k10plus.json"));
MarcReader reader = QAMarcReaderFactory.getFileReader(MarcFormat.PICA_NORMALIZED, CliTestUtils.getTestResource("pica/pica-with-holdings-info.dat"), null);
reader.hasNext();
Record record = reader.next();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

public class PicaRecordTest {

private PicaSchemaManager schema = PicaSchemaReader.createSchema(CliTestUtils.getTestResource("pica/k10plus.json"));
private PicaSchemaManager schema = PicaSchemaReader.createSchema(CliTestUtils.getTestResource("pica/schema/k10plus.json"));

@Test
public void addDataField() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class PicaSchemaManagerTest {

@Before
public void setUp() throws Exception {
schema = PicaSchemaReader.createSchema(getPath("pica/k10plus.json"));
schema = PicaSchemaReader.createSchema(getPath("pica/schema/k10plus.json"));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ public void readTags() {
public void readAvramSchema() {
try {
Map<String, PicaFieldDefinition> schemaDirectory = new HashMap<>();
schemaDirectory.putAll(PicaSchemaReader.create(getPath("pica/pica-schema.json")));
schemaDirectory.putAll(PicaSchemaReader.create(getPath("pica/pica-schema-extra.json")));
schemaDirectory.putAll(PicaSchemaReader.create(getPath("pica/schema/pica-schema.json")));
schemaDirectory.putAll(PicaSchemaReader.create(getPath("pica/schema/pica-schema-extra.json")));

Map<String, Integer> counter = new HashMap<>();
Map<String, List<String>> ppns = new HashMap<>();
Expand Down Expand Up @@ -192,7 +192,7 @@ public void readAvramSchema() {

@Test
public void picaReader() throws IOException, URISyntaxException {
PicaSchemaManager schema = PicaSchemaReader.createSchema(getPath("pica/k10plus.json"));
PicaSchemaManager schema = PicaSchemaReader.createSchema(getPath("pica/schema/k10plus.json"));
String recordFile = FileUtils.getPath("pica/picaplus-sample.txt").toAbsolutePath().toString();
MarcReader reader = new PicaPlainReader(recordFile).setIdField("003@ƒ0").setSubfieldSeparator("ƒ");
int i = 0;
Expand All @@ -207,7 +207,7 @@ public void picaReader() throws IOException, URISyntaxException {

@Test
public void picaReader2() throws IOException, URISyntaxException {
PicaSchemaManager schema = PicaSchemaReader.createSchema(getPath("pica/k10plus.json"));
PicaSchemaManager schema = PicaSchemaReader.createSchema(getPath("pica/schema/k10plus.json"));
String recordFile = FileUtils.getPath("pica/k10plus-sample.pica").toAbsolutePath().toString();
MarcReader reader = new PicaPlainReader(recordFile)
.setIdField("003@$0")
Expand Down Expand Up @@ -241,7 +241,7 @@ private boolean directoryContains(Map<String, PicaFieldDefinition> schemaDirecto

@Test
public void readASchema() {
PicaSchemaManager schema = PicaSchemaReader.createSchema(getPath("pica/k10plus.json"));
PicaSchemaManager schema = PicaSchemaReader.createSchema(getPath("pica/schema/k10plus.json"));
assertEquals(431, schema.size());
PicaFieldDefinition definition = schema.lookup("048H");
assertEquals("048H", definition.getTag());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class PicaXmlReaderTest {

@Test
public void xml() {
PicaSchemaManager schema = PicaSchemaReader.createSchema(CliTestUtils.getTestResource("pica/k10plus.json"));
PicaSchemaManager schema = PicaSchemaReader.createSchema(CliTestUtils.getTestResource("pica/schema/k10plus.json"));
MarcReader reader = null;
try {
reader = QAMarcReaderFactory.getFileReader(MarcFormat.PICA_XML, CliTestUtils.getTestResource("picaxml/pica.xml"), null);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 3cf58f8

Please sign in to comment.