Skip to content

Commit

Permalink
Add rule to make id AND rvk mandatory
Browse files Browse the repository at this point in the history
hbz-Ids will be concatenated into one field delimited by a space.

- shrink unnecessary test data
- update test

See #1058.
  • Loading branch information
dr0i committed Apr 23, 2020
1 parent d12b7a3 commit b39d30f
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 1,747 deletions.
25 changes: 14 additions & 11 deletions src/main/resources/morph-cg-to-es.xml
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<metamorph xmlns="http://www.culturegraph.org/metamorph" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="1">
<!-- Aleph MAB2 XML to RDF - a mapping of the hbz01 catalog to lobid-resources -->
<!-- beware: the sequence of the rules are semantically important! Don't change the order. -->
<!-- Aleph MAB differs from MAB in that: -->
<!-- an indicator2 exists -->
<!-- most fields have a subfield 'a' -->
<!-- => structure of alehp MAB: $field$indicator1$indicator2$subfield -->
<!-- Filters all rda catalogued entries -->
<!-- Filter hbz ids from culturegraph XML. Build a hbzId-rvk concordance -->
<!-- structure of marc xml: $field$indicator1$indicator2$subfield -->
<rules>
<!-- ####################### -->
<!-- ####### Get subject uri of each rda record -->
<!-- ####### Get rvk and hbz id -->
<!-- ####################### -->
<combine name="@rvk" value="${rvk}" >
<data source="084??.a" name="rvk"/>
</combine>
<combine name="@hbzId" value="${id}">
<data source="035??.a" name="id">
<regexp match="^\(DE-605\)(.*)" format="${1}"/>
</data>
</combine>
<combine name="rvk" value="${rvk}" >
<data source="084??.a" name="rvk"/>
<data source="@hbzId"/>
<data source="@rvk" name="rvk"/>
</combine>
<combine name="hbzId" value="${hbzId}">
<concat delimiter=", " name="hbzId" >
<data source="@hbzId"/>
</concat>
<data source="@rvk" />
</combine>
<data source="@hbzId" name="id" />
</rules>
</rules>
</metamorph>
Loading

0 comments on commit b39d30f

Please sign in to comment.