Skip to content

Commit

Permalink
Merge branch '1168-recreateAllHoldings' of https://github.com/hbz/lob…
Browse files Browse the repository at this point in the history
  • Loading branch information
dr0i committed Apr 23, 2021
2 parents cd2879b + 8eac272 commit 1dc2edd
Show file tree
Hide file tree
Showing 22 changed files with 1,736 additions and 117 deletions.
120 changes: 84 additions & 36 deletions src/main/resources/alma/common/item.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?>
<rules xmlns="http://www.culturegraph.org/metamorph">
<entity name="hasItem[]" flushWith="record">

<!-- MBD -->
<entity name="" reset="true" sameEntity="true" flushWith="MBD ">

<combine name="id" value="https://lobid.org/item/${i}">
<data name="i" source="MBD .i"/>
</combine>
<entity name="type[]" sameEntity="true">
<data name="" source="MBD .i">
<constant value="MBD"/>
</data>
</entity>
<entity name="heldBy" sameEntity="true" reset="true">
<data name="id" source="MBD .M">
<lookup in="alma-iz-code-to-isil" />
<compose prefix="http://lobid.org/organisations/" postfix="#!"/>
</data>
<data name="label" source="MBD .M">
<constant value="lobid Organisation"/>
</data>
</entity>
</entity>
<!-- HOL -->
<entity name="" reset="true" sameEntity="true">
<combine name="id" value="https://lobid.org/item/${i}" reset="true" sameEntity="true">
<data name="i" source="HOL .8"/>
</combine>
<entity name="type[]" reset="true" sameEntity="true">
<data name="" source="HOL .8">
<constant value="HOL"/>
</data>
</entity>
<data name="label" source="HOL .8">
<constant value="lobid Bestandsressource"/>
</data>
<entity name="heldBy" reset="true" sameEntity="true">
<data name="id" source="HOL .8">
<regexp match=".*(\d{4})$" format="${1}"/>
<lookup in="alma-institution-code-to-isil" />
<compose prefix="http://lobid.org/organisations/" postfix="#!"/>
</data>
<data name="label" source="HOL .8">
<constant value="lobid Organisation"/>
</data>
</entity>
</entity>
<!-- H52 -->
<entity name="" reset="true" sameEntity="true">
<combine name="id" value="https://lobid.org/item/${i}">
<data name="i" source="H52 .8">
<regexp match=".*(\d{4})$" />
</data>
</combine>
<entity name="type[]" sameEntity="true" reset="true" >
<data name="" source="H52 .8">
<regexp match=".*(\d{4})$" />
<constant value="H52"/>
</data>
</entity>
<data name="label" source="H52 .8">
<regexp match=".*(\d{4})$" />
<constant value="lobid Bestandsressource"/>
</data>
<entity name="heldBy" sameEntity="true" reset="true" >
<data name="id" source="H52 .8">
<regexp match=".*(\d{4})$" format="${1}"/>
<lookup in="alma-institution-code-to-isil" />
<compose prefix="http://lobid.org/organisations/" postfix="#!"/>
</data>
<data name="label" source="H52 .8">
<regexp match=".*(\d{4})$" />
<constant value="lobid Organisation"/>
</data>
</entity>
<data name="callNumber" source="H52 .h" />
<combine name="currentLocation" value="${a} / ${b}" sameEntity="true" reset="true" >
<data name="a" source="H52 .b"/>
<data name="b" source="H52 .c"/>
</combine>
</entity>

<!-- ITM -->
<entity name="" reset="true" sameEntity="true" flushWith="ITM ">
<combine name="id" value="https://lobid.org/item/${i}">
<data name="i" source="ITM .a"/>
</combine>
<entity name="type[]" sameEntity="true">
<data name="" source="ITM .a">
<constant value="Item"/>
<constant value="ITM"/>
</data>
</entity>
<data name="label" source="ITM .a">
Expand Down Expand Up @@ -45,7 +126,7 @@
</combine>
<entity name="type[]" sameEntity="true">
<data name="" source="POR .a">
<constant value="Item"/>
<constant value="POR"/>
</data>
</entity>
<data name="label" source="POR .a">
Expand All @@ -71,7 +152,7 @@
</combine>
<entity name="type[]" sameEntity="true" reset="true">
<data name="" source="POR .A">
<constant value="Item"/>
<constant value="POR"/>
</data>
</entity>
<data name="label" source="POR .A">
Expand All @@ -91,37 +172,4 @@
</entity>
</entity>

<entity name="hasItem[]" flushWith="record">
<if>
<none>
<data source="ITM " />
</none>
</if>
<!-- HOL if no ITM -->
<entity name="" reset="true">
<!--TODO: Introduce filter that allows the entity to have separate objects. sameEntity="true" is the roadblock at the moment but we need it. -->
<combine name="id" value="https://lobid.org/item/${i}" reset="true" sameEntity="true">
<data name="i" source="HOL .8"/>
</combine>
<entity name="type[]" reset="true" sameEntity="true">
<data name="" source="HOL .8">
<constant value="Item"/>
</data>
</entity>
<data name="label" source="HOL .8">
<constant value="lobid Bestandsressource"/>
</data>
<entity name="heldBy" reset="true" sameEntity="true">
<data name="id" source="HOL .8">
<regexp match=".*(\d{4})$" format="${1}"/>
<lookup in="alma-institution-code-to-isil" />
<compose prefix="http://lobid.org/organisations/" postfix="#!"/>
</data>
<data name="label" source="HOL .8">
<constant value="lobid Organisation"/>
</data>
</entity>
</entity>
</entity>

</rules>
2 changes: 2 additions & 0 deletions src/main/resources/alma/maps/alma-iz-code-to-isil.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
<entry name="49HBZ_DUE" value="DE-61"/> <!-- Universitäts- und Landesbibliothek Düsseldorf -->
<entry name="49HBZ_FHA" value="DE-A96"/> <!-- Hochschulbibliothek der Fachhochschule Aachen -->
<entry name="49HBZ_WUP" value="DE-468"/> <!-- Universitätsbibliothek Wuppertal -->
<entry name="49HBZ_UDE" value="DE-468"/> <!-- Universitätsbibliothek Duisburg-Essen -->
<entry name="49HBZ_NETWORK" value="DE-605"/> <!-- hbz -->
</map>
40 changes: 29 additions & 11 deletions src/test/resources/alma/(CKB)2560000000104439.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,70 @@
"otherTitleInformation" : [ "Ein Lehrbuch für Linux- und Unix-Anwender" ],
"responsibilityStatement" : [ "von Christine Wolfinger." ],
"hasItem" : [ {
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-605#!",
"label" : "lobid Organisation"
},
"id" : "https://lobid.org/item/99368090810506441",
"type" : [ "MBD" ]
}, {
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-468#!",
"label" : "lobid Organisation"
},
"id" : "https://lobid.org/item/99203859337206446",
"type" : [ "MBD" ]
}, {
"id" : "https://lobid.org/item/53472085180006441",
"type" : [ "Item" ],
"type" : [ "POR" ],
"label" : "Portfolio",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-A96#!",
"label" : "lobid Organisation"
}
}, {
"id" : "https://lobid.org/item/53472085180006441",
"type" : [ "Item" ],
"type" : [ "POR" ],
"label" : "Portfolio",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-361#!",
"label" : "lobid Organisation"
}
}, {
"id" : "https://lobid.org/item/53472085180006441",
"type" : [ "Item" ],
"type" : [ "POR" ],
"label" : "Portfolio",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-290#!",
"label" : "lobid Organisation"
}
}, {
"id" : "https://lobid.org/item/53472085180006441",
"type" : [ "Item" ],
"type" : [ "POR" ],
"label" : "Portfolio",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-61#!",
"label" : "lobid Organisation"
}
}, {
"id" : "https://lobid.org/item/53472085180006441",
"type" : [ "Item" ],
"label" : "Portfolio"
"type" : [ "POR" ],
"label" : "Portfolio",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-468#!",
"label" : "lobid Organisation"
}
}, {
"id" : "https://lobid.org/item/53472085180006441",
"type" : [ "Item" ],
"type" : [ "POR" ],
"label" : "Portfolio",
"heldBy" : {
"label" : "lobid Organisation",
"id" : "http://lobid.org/organisations/DE-468#!"
"id" : "http://lobid.org/organisations/DE-468#!",
"label" : "lobid Organisation"
}
}, {
"id" : "https://lobid.org/item/53247969310006446",
"type" : [ "Item" ],
"type" : [ "POR" ],
"label" : "Portfolio",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-465#!",
Expand Down Expand Up @@ -111,7 +129,7 @@
},
"resultOf" : {
"type" : [ "CreateAction" ],
"endTime" : "2021-04-16T16:35:00",
"endTime" : "2021-04-23T15:35:12",
"instrument" : {
"id" : "https://github.com/hbz/lobid-resources",
"type" : [ "SoftwareApplication" ],
Expand Down
97 changes: 92 additions & 5 deletions src/test/resources/alma/(DE-605)HT000161712.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,124 @@
"title" : "Handwörterbuch des Volksschulwesens",
"responsibilityStatement" : [ "unter Mitw. zahlr. Schulmänner hrsg. von E. Clausnitzer ..." ],
"hasItem" : [ {
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-605#!",
"label" : "lobid Organisation"
},
"id" : "https://lobid.org/item/990001412590206441",
"type" : [ "MBD" ]
}, {
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-468#!",
"label" : "lobid Organisation"
},
"id" : "https://lobid.org/item/990000382740206447",
"type" : [ "MBD" ]
}, {
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-290#!",
"label" : "lobid Organisation"
},
"id" : "https://lobid.org/item/991000778199706445",
"type" : [ "MBD" ]
}, {
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-361#!",
"label" : "lobid Organisation"
},
"id" : "https://lobid.org/item/991021092879706442",
"type" : [ "MBD" ]
}, {
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-61#!",
"label" : "lobid Organisation"
},
"id" : "https://lobid.org/item/990000278820206443",
"type" : [ "MBD" ]
}, {
"currentLocation" : "W0001 / 05",
"callNumber" : "",
"id" : "https://lobid.org/item/2275702860006447",
"type" : [ "H52" ],
"label" : "lobid Bestandsressource",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-468#!",
"label" : "lobid Organisation"
}
}, {
"id" : "https://lobid.org/item/2275702860006447",
"type" : [ "HOL" ],
"label" : "lobid Bestandsressource",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-468#!",
"label" : "lobid Organisation"
}
}, {
"id" : "https://lobid.org/item/2375702830006447",
"type" : [ "Item" ],
"type" : [ "ITM" ],
"label" : "lobid Bestandsressource",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-468#!",
"label" : "lobid Organisation"
},
"currentLocation" : "W0001 / 05"
}, {
"currentLocation" : "EFB / Freihand",
"callNumber" : "PAA 120/43",
"id" : "https://lobid.org/item/2298238880006445",
"type" : [ "H52" ],
"label" : "lobid Bestandsressource",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-290#!",
"label" : "lobid Organisation"
}
}, {
"id" : "https://lobid.org/item/2298238880006445",
"type" : [ "HOL" ],
"label" : "lobid Bestandsressource",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-290#!",
"label" : "lobid Organisation"
}
}, {
"id" : "https://lobid.org/item/2398238870006445",
"type" : [ "Item" ],
"type" : [ "ITM" ],
"label" : "lobid Bestandsressource",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-290#!",
"label" : "lobid Organisation"
},
"callNumber" : "PAA 120/43",
"currentLocation" : "EFB / Freihand"
}, {
"id" : "https://lobid.org/item/22129577780006442",
"type" : [ "HOL" ],
"label" : "lobid Bestandsressource",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-361#!",
"label" : "lobid Organisation"
}
}, {
"id" : "https://lobid.org/item/23129577770006442",
"type" : [ "Item" ],
"type" : [ "ITM" ],
"label" : "lobid Bestandsressource",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-361#!",
"label" : "lobid Organisation"
},
"callNumber" : "LA076 H2D4V",
"currentLocation" : "UB_BI / 164_Mono"
}, {
"id" : "https://lobid.org/item/22124176570006443",
"type" : [ "HOL" ],
"label" : "lobid Bestandsressource",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-61#!",
"label" : "lobid Organisation"
}
}, {
"id" : "https://lobid.org/item/23124176560006443",
"type" : [ "Item" ],
"type" : [ "ITM" ],
"label" : "lobid Bestandsressource",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-61#!",
Expand Down Expand Up @@ -96,7 +183,7 @@
},
"resultOf" : {
"type" : [ "CreateAction" ],
"endTime" : "2021-04-21T15:51:29",
"endTime" : "2021-04-23T15:35:12",
"instrument" : {
"id" : "https://github.com/hbz/lobid-resources",
"type" : [ "SoftwareApplication" ],
Expand Down
Loading

0 comments on commit 1dc2edd

Please sign in to comment.