Skip to content

Commit

Permalink
Generate MARCXML single file distribution. Fixes #93
Browse files Browse the repository at this point in the history
  • Loading branch information
osma committed Apr 12, 2019
1 parent 8651396 commit 10bf81c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ slices/%-agent-keys.nt: slices/%-merged.nt
slices/%-merged2.nt: slices/%-merged.nt refdata/$$(shell echo $$(*)|sed -e 's/-[0-9X]\+//')-agent-transformations.nt
$(SPARQL) --data $< --data $(word 2,$^) --query sparql/merge.rq --out=NT >$@

merged/%.mrcx: $$(shell ls slices/$$(*)-?????-in.alephseq | sed -e 's/-in.alephseq/-preprocessed.alephseq/')
cat $^ | $(CATMANDU) convert MARC --type ALEPHSEQ to MARC --type XML --pretty 1 --fix scripts/strip-personal-info.fix --fix scripts/preprocess-marc.fix >$@

merged/%-merged.nt: $$(shell ls slices/$$(*)-?????-in.alephseq | sed -e 's/-in.alephseq/-merged2.nt/') refdata/fennica-collection.ttl
$(RIOT) $^ >$@

Expand Down Expand Up @@ -119,12 +122,14 @@ clean:
rm -f slices/*.mrcx
rm -f slices/*.rdf
rm -f slices/*.nt slices/*.log
rm -f merged/*.nt
rm -f merged/*.nt merged/*.mrcx

slice: $(patsubst input/%.alephseq,slices/%.md5,$(wildcard input/*.alephseq))

preprocess: $(patsubst %-in.alephseq,%-preprocessed.alephseq,$(wildcard slices/*-in.alephseq))

marcdist: $(patsubst input/%.alephseq,merged/%.mrcx,$(wildcard input/*.alephseq))

mrcx: $(patsubst %-in.alephseq,%.mrcx,$(wildcard slices/*-in.alephseq))

rdf: $(patsubst %-in.alephseq,%-bf2.rdf,$(wildcard slices/*-in.alephseq))
Expand Down
2 changes: 1 addition & 1 deletion merged/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*.nt
*.hdt
*.hdt.index*

*.mrcx
14 changes: 14 additions & 0 deletions test/10_marc_dist.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bats

load test_helper

setup () {
global_setup
make slice
}

@test "MARC distribution: basic generation" {
rm -f merged/hawking.mrcx
make marcdist
[ -s merged/hawking.mrcx ]
}
File renamed without changes.

0 comments on commit 10bf81c

Please sign in to comment.