Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alma marc21 xml to lobid json #1094

Merged
merged 24 commits into from
Dec 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/java">
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
Expand All @@ -33,5 +33,25 @@
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="test" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
16 changes: 13 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
<artifactId>metafacture-io</artifactId>
<version>5.1.0</version>
</dependency>
<dependency>
<groupId>org.metafacture</groupId>
<artifactId>metafacture-json</artifactId>
<version>5.1.0</version>
</dependency>
<dependency>
<groupId>org.metafacture</groupId>
<artifactId>metafacture-biblio</artifactId>
Expand Down Expand Up @@ -99,9 +104,9 @@
<version>0.12.5</version>
</dependency>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.4.01</version>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.4.01</version>
</dependency>
<dependency>
<groupId>com.google.gdata</groupId>
Expand Down Expand Up @@ -158,6 +163,11 @@
<artifactId>async-http-client</artifactId>
<version>1.9.33</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
</dependencies>
<build>
<resources>
Expand Down
39 changes: 39 additions & 0 deletions src/main/resources/alma/alma.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<metamorph xmlns="http://www.culturegraph.org/metamorph" xmlns:xi="http://www.w3.org/2001/XInclude" version="1">
<xi:include href="macros.xml"/>
<xi:include href="maps.xml"/>
<rules xmlns="http://www.culturegraph.org/metamorph">
<call-macro name="static-filter" dname="@portfolio" source="POR .a" filter="POR .M" value="$[member]"/>
<!-- <call-macro name="static-filter" dname="@mmsiz" source="MBD .i" filter="MBD .M" value="$[member]"/>-->
<call-macro name="alma-mms-to-isil" dname="@isil" source="001"/>
<call-macro name="alma-mms-to-isil" dname="@isiliz" source="MBD .i"/>
<combine name="@uid" value="(${isil})${id}">
<data name="id" source="@mmsiz"/>
<data name="isil" source="@isiliz"/>
</combine>

<data name="@uid" source="035 .a">
<regexp match="^\($[catalogid]\).*"/>
</data>
<data name="\@context" source="@id">
<constant value="http://lobid.org/resources/context.jsonld"/>
</data>
<data name="@uid" source="981 .a"/>
<!-- SISIS CATKey -->
<!-- <entity name="DateFirst">
<call-macro name="dynamic-filter" dname="date" source="POC .b" filter="@portfolio" value="POC .a"/>
</entity>
<entity name="DateLast">
<call-macro name="dynamic-filter" dname="date" source="POC .c" filter="@portfolio" value="POC .a"/>
</entity>-->
<data name="almaIdMMS" source="001"/>
<!-- <data name="almaIdMMSIZ" source="@mmsiz"/> -->
<data name="almaIdPID" source="@portfolio"/>
</rules>
<xi:include href="common/item.xml"/>
<xi:include href="common/facets.xml"/>
<xi:include href="common/fields.xml"/>
<xi:include href="common/describedBy.xml"/>
<xi:include href="common/titleOther.xml"/>
<xi:include href="common/RSWK.xml"/>
</metamorph>
81 changes: 81 additions & 0 deletions src/main/resources/alma/common/RSWK.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<rules xmlns="http://www.culturegraph.org/metamorph">

<!-- 6xx -->
<entity name="RSWK[]" flushWith="record">
<entity name="" flushWith="600??|6[15][01]??|648??" sameEntity="true">
<if>
<all flushWith="600??|6[15][01]??|648??" sameEntity="true">
<data source="600??.2|6[15][01]??.2|648??.2">
<regexp match="^(gnd|swd)$" />
</data>
</all>
</if>
<data name="subjectTopicName" source="650??.a">
<occurrence only="1" sameEntity="true" />
<replace pattern="\.?$" with="" />
</data>
<data name="subjectGeoName" source="6[105]0??.z|6[15]1??.z|651??.a">
<occurrence only="1" sameEntity="true" />
<replace pattern="\.?$" with="" />
</data>
<data name="subjectChronological" source="6[105]0??.y|6[15]1??.y||648??.a">
<occurrence only="1" sameEntity="true" />
<replace pattern="\.?$" with="" />
</data>
<data name="subjectConference" source="611??.a">
<occurrence only="1" sameEntity="true" />
<replace pattern="\.?$" with="" />
</data>
<data name="subjectCorporateBodyName" source="610??.a">
<occurrence only="1" sameEntity="true" />
<replace pattern="\.?$" with="" />
</data>
<data name="subjectCorporateBodySubUnit" source="610??.b">
<occurrence only="1" sameEntity="true" />
<replace pattern="\.?$" with="" />
</data>
<data name="subjectDate" source="600??.d|611??.d">
<occurrence only="1" sameEntity="true" />
<replace pattern="\s?[:.]?$" with="" />
</data>
<data name="subjectGenre" source="6[105]0??.v|6[15]1??.v">
<occurrence only="1" sameEntity="true" />
<replace pattern="\.?$" with="" />
</data>
<data name="subjectNumbering" source="61[01]??.n">
<occurrence only="1" sameEntity="true" />
<replace pattern="^[(]|\s?[);:]?$" with="" />
</data>
<data name="subjectPersonName" source="600??.a">
<occurrence only="1" sameEntity="true" />
<replace pattern="[,.]?$" with="" />
</data>
<data name="subjectTitleName" source="6[01]0??.t|611??.t">
<occurrence only="1" sameEntity="true" />
<replace pattern="\.?$" with="" />
</data>
<data name="subjectUnit" source="61[10]??.p" >
<occurrence only="1" sameEntity="true" />
<replace pattern="\.?$" with="" />
</data>
<data name="subjectNameAddendum" source="600??.c">
<occurrence only="1" sameEntity="true" />
<replace pattern="^[(]|[.)]?$" with="" />
</data>
<data name="subjectGeoAddendum" source="61[01]??.c">
<occurrence only="1" sameEntity="true" />
<replace pattern="^[(]|[.)]?$" with="" />
</data>

<entity name="subjectIdentifier[]" flushWith="600??|6[15][01]??|648??" sameEntity="true">
<data name="" source="600??.0|6[15][01]??.0|648??.0" />
</entity>
<entity name="identifierGND[]" flushWith="600??|6[15][01]??|648??" sameEntity="true">
<data name="" source="600??.0|6[15][01]??.0|648??.0">
<regexp match="(?&lt;=\(DE-588\)).*$" />
</data>
</entity>
</entity>
</entity>
</rules>
42 changes: 42 additions & 0 deletions src/main/resources/alma/common/bibliomondo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<rules xmlns="http://www.culturegraph.org/metamorph">

<data source="000" name="Type" />

<entity name="TypeMonograph[]" flushWith="record">
<if>
<data source="007">
<regexp match="^z\|" />
</data>
</if>
<data source="007" name="" >
<constant value="mehrbändiges begrenztes Werk" />
</data>
</entity>

<entity name="DescriptionOfExpression" flushWith="record">
<data source="546??.a" name="description" />
</entity>

<data source="6[013]0??.a|611??.a|648??.a|65[0135]??.a|689??.a" name="@rswk">
<unique />
</data>
<entity name="RSWK[]" flushWith="record">
<entity name="" flushWith="@rswk" reset="true">
<data source="@rswk" name="subjectTopicName" />
</entity>
</entity>

<!-- <entity name="RecordIdentifierSuper" flushWith="773??">
<combine name="recordIdentifierSuper" value="($[isil])${id}">
<data name="id" source="773??.w" />
</combine>
</entity>-->

<entity name="IdentifierLocal" flushWith="record">
<data source="852??.?" name="standardNumber">
<occurrence only="1" />
</data>
</entity>

</rules>
94 changes: 94 additions & 0 deletions src/main/resources/alma/common/describedBy.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<rules xmlns="http://www.culturegraph.org/metamorph">
<!-- 7xx -->
<entity name="describedBy" flushWith="record">
<data name="id" source="@id">
<regexp match="(.*)" format="http://lobid.org/resources/${1}"/>
</data>
<data name="label" source="@id">
<regexp match="(.*)" format="Webseite der hbz-Ressource ${1}"/>
</data>
<entity name="type[]">
<data name="" source="@id">
<constant value="BibliographicDescription"/>
</data>
</entity>
<call-macro name="simplify-date" dname="dateCreated" dsource="MNG .b"/>
<call-macro name="simplify-date" dname="dateModified" dsource="MNG .d"/>
<entity name="inDataset" >
<data name="id" source="@id">
<constant value="http://lobid.org/resources/dataset#!"/>
</data>
<data name="label" source="@id">
<constant value="lobid-resources – Der hbz-Verbundkatalog als Linked Open Data" />
</data>
</entity>
<entity name="resultOf">
<entity name="type[]">
<data name="" source="@id">
<constant value="CreateAction"/>
</data>
</entity>
<data name="endTime" source="@id">
<timestamp format="yyyy-MM-dd'T'HH:mm:ss" timezone="Europe/Berlin"/>
</data>
<entity name="instrument">
<data name="id" source="@id">
<constant value="https://github.com/hbz/lobid-resources"/>
</data>
<entity name="type[]">
<data name="" source="@id">
<constant value="SoftwareApplication"/>
</data>
</entity>
<data name="label" source="@id">
<constant value="Software lobid-resources"/>
</data>
</entity>

<entity name="object">
<data name="id" source="@id">
<regexp match="(.*)" format="http://lobid.org/hbz01/${1}"/>
</data>
<entity name="type[]">
<data name="" source="@id">
<constant value="DataFeedItem"/>
</data>
</entity>
<data name="label" source="@id">
<regexp match="(.*)" format="hbz-Ressource ${1} im Exportformat MARC21 XML"/>
</data>
<entity name="inDataset">
<data name="id" source="@id">
<constant value="https://datahub.io/dataset/hbz_unioncatalog"/>
</data>
<data name="label" source="@id">
<constant value="hbz_unioncatalog"/>
</data>
</entity>
</entity>



</entity>
<entity name="license[]">
<entity name="">
<data name="id" source="@id">
<constant value="http://creativecommons.org/publicdomain/zero/1.0"/>
</data>
<data name="label" source="@id">
<constant value="Creative Commons-Lizenz CC0 1.0 Universal"/>
</data>
</entity>
</entity>
<entity name="sourceOrganization">
<data name="id" source="MNG .g">
<regexp match="(.*)" format="http://lobid.org/organisations/${1}_todo"/>
</data>
<data name="label" source="MNG .g">
<constant value="lobid Organisation"/>
</data>
</entity>

</entity>
</rules>
Loading