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

adjust urn regex #2035

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 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
4 changes: 2 additions & 2 deletions src/main/resources/alma/fix/identifiers.fix
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ end
# 856 - Electronic Location and Access (R) - Subfield: $u (R) $3 (NR)
# 1. Indicator: 4 = HTTP
do list(path:"8564?", "var":"$i")
if all_match("$i.u", "^http[s]?:\\/\\/nbn-resolving.(de|org)\\/(.*)")
if all_match("$i.u", "^.*[/=]urn:nbn.*")
copy_field("$i.u", "urn[].$append")
replace_all("urn[].$last", "^http[s]?:\\/\\/nbn-resolving.(de|org)\\/(.*)", "$2")
replace_all("urn[].$last", "(^http.+)(urn:.+$)", "$2")
end
end

Expand Down
163 changes: 163 additions & 0 deletions src/test/resources/alma-fix/990198125850206441.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
{
"@context" : "http://lobid.org/resources/context.jsonld",
"id" : "http://lobid.org/resources/990198125850206441#!",
"type" : [ "BibliographicResource", "Book" ],
"medium" : [ {
"label" : "Datenträger",
"id" : "http://rdaregistry.info/termList/RDAMediaType/1003"
}, {
"label" : "Online-Ressource",
"id" : "http://rdaregistry.info/termList/RDACarrierType/1018"
} ],
"title" : "Zur Geschichte und Kunde des ehemaligen Nahe-Gaues",
"almaMmsId" : "990198125850206441",
"urn" : [ "urn:nbn:de:bvb:12-bsb10020200-9" ],
"hbzId" : "HT017749938",
"deprecatedUri" : "http://lobid.org/resources/HT017749938#!",
"oclcNumber" : [ "162593822" ],
"publication" : [ {
"startDate" : "1853",
"type" : [ "PublicationEvent" ],
"location" : [ "Birkenfeld" ],
"publishedBy" : [ "Kittsteiner" ]
} ],
"describedBy" : {
"id" : "http://lobid.org/resources/990198125850206441",
"label" : "Webseite der hbz-Ressource 990198125850206441",
"type" : [ "BibliographicDescription" ],
"inDataset" : {
"id" : "http://lobid.org/resources/dataset#!",
"label" : "lobid-resources – Der hbz-Verbundkatalog als Linked Open Data"
},
"resultOf" : {
"type" : [ "CreateAction" ],
"endTime" : "0000-00-00T00:00:00",
"instrument" : {
"id" : "https://github.com/hbz/lobid-resources",
"type" : [ "SoftwareApplication" ],
"label" : "Software lobid-resources"
},
"object" : {
"id" : "https://lobid.org/marcxml/990198125850206441",
"dateCreated" : "2021-04-05",
"dateModified" : "2022-06-04",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990198125850206441 im Exportformat MARC21 XML",
"inDataset" : {
"id" : "https://datahub.io/dataset/hbz_unioncatalog",
"label" : "hbz_unioncatalog"
},
"sourceOrganization" : {
"id" : "http://lobid.org/organisations/DE-929#!",
"label" : "Landesbibliothekszentrum Rheinland-Pfalz / Rheinische Landesbibliothek"
},
"provider" : {
"id" : "http://lobid.org/organisations/DE-605#!",
"label" : "hbz - Hochschulbibliothekszentrum des Landes Nordrhein-Westfalen"
},
"modifiedBy" : [ {
"id" : "http://lobid.org/organisations/DE-605#!",
"label" : "hbz - Hochschulbibliothekszentrum des Landes Nordrhein-Westfalen"
} ]
}
},
"license" : [ {
"id" : "http://creativecommons.org/publicdomain/zero/1.0",
"label" : "Creative Commons-Lizenz CC0 1.0 Universal"
} ]
},
"sameAs" : [ {
"id" : "https://hub.culturegraph.org/resource/(DE-605)990198125850206441",
"label" : "Culturegraph Ressource"
}, {
"id" : "http://worldcat.org/oclc/162593822",
"label" : "OCLC Ressource"
}, {
"id" : "https://nbn-resolving.de/urn:nbn:de:bvb:12-bsb10020200-9",
"label" : "urn:nbn:de:bvb:12-bsb10020200-9"
} ],
"fulltextOnline" : [ {
"id" : "https://nbn-resolving.de/urn:nbn:de:bvb:12-bsb10020200-9",
"label" : "URN-Link"
} ],
"inCollection" : [ {
"id" : "https://nrw.digibib.net/search/hbzvk/",
"label" : "DigiBib hbz Verbundkatalog",
"type" : [ "Collection" ]
}, {
"id" : "http://lobid.org/organisations/DE-655#!",
"label" : "hbz - Hochschulbibliothekszentrum des Landes Nordrhein-Westfalen, Netzwerkzone",
"type" : [ "Collection" ]
} ],
"language" : [ {
"id" : "http://id.loc.gov/vocabulary/iso639-2/ger",
"label" : "Deutsch"
} ],
"extent" : "IV, 166 S., 1 Taf. 8\"",
"note" : [ "In Fraktur" ],
"subject" : [ {
"notation" : "130",
"type" : [ "Concept" ],
"id" : "https://w3id.org/lobid/rpb2#n130",
"label" : "Landeskunde Region Koblenz",
"source" : {
"id" : "https://w3id.org/lobid/rpb2",
"label" : "LBZ-Notationen"
}
}, {
"notation" : "140",
"type" : [ "Concept" ],
"id" : "https://w3id.org/lobid/rpb2#n140",
"label" : "Pflichtexemplar Region Koblenz",
"source" : {
"id" : "https://w3id.org/lobid/rpb2",
"label" : "LBZ-Notationen"
}
}, {
"notation" : "330",
"type" : [ "Concept" ],
"id" : "https://w3id.org/lobid/rpb2#n330",
"label" : "Geschichte",
"source" : {
"id" : "https://w3id.org/lobid/rpb2",
"label" : "LBZ-Notationen"
}
}, {
"type" : [ "ComplexSubject" ],
"label" : "Nahegau | Geschichte",
"componentList" : [ {
"type" : [ "PlaceOrGeographicName" ],
"label" : "Nahegau",
"source" : {
"label" : "Gemeinsame Normdatei (GND)",
"id" : "https://d-nb.info/gnd/7749153-1"
},
"id" : "https://d-nb.info/gnd/4580132-0",
"gndIdentifier" : "4580132-0"
}, {
"type" : [ "SubjectHeading" ],
"label" : "Geschichte"
} ]
} ],
"subjectslabels" : [ "Nahegau", "Geschichte" ],
"bibliographicLevel" : {
"label" : "Monograph/Item",
"id" : "https://www.loc.gov/marc/bibliographic/bdleader.html#Monograph_Item"
},
"responsibilityStatement" : [ "von Auctionsverwalter Leyser in Oberstein" ],
"contribution" : [ {
"agent" : {
"gndIdentifier" : "1034937715",
"id" : "https://d-nb.info/gnd/1034937715",
"label" : "Leyser, Johann Jakob",
"type" : [ "Person" ],
"dateOfBirth" : "1799",
"dateOfDeath" : "1867"
},
"role" : {
"id" : "http://id.loc.gov/vocabulary/relators/aut",
"label" : "Autor/in"
},
"type" : [ "Contribution" ]
} ]
}
141 changes: 141 additions & 0 deletions src/test/resources/alma-fix/990198125850206441.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<?xml version="1.0" encoding="UTF-8"?>
<record>
<leader>01332nmm#a2200349#c#4500</leader>
<controlfield tag="005">20181005112700.0</controlfield>
<controlfield tag="007">cr#|||||||||||</controlfield>
<controlfield tag="008">130826|1853####xx######o##|########ger#c</controlfield>
<controlfield tag="003">DE-605</controlfield>
<controlfield tag="001">990198125850206441</controlfield>
<datafield tag="016" ind1="7" ind2=" ">
<subfield code="a">162593822</subfield>
<subfield code="2">OCoLC</subfield>
</datafield>
<datafield tag="035" ind1=" " ind2=" ">
<subfield code="a">(DE-605)HT017749938</subfield>
</datafield>
<datafield tag="040" ind1=" " ind2=" ">
<subfield code="c">DE-605</subfield>
<subfield code="a">929</subfield>
<subfield code="b">ger</subfield>
<subfield code="e">rakwb</subfield>
<subfield code="d">DE-605</subfield>
</datafield>
<datafield tag="041" ind1=" " ind2=" ">
<subfield code="a">ger</subfield>
</datafield>
<datafield tag="044" ind1=" " ind2=" ">
<subfield code="c">XA-DXDE</subfield>
</datafield>
<datafield tag="084" ind1=" " ind2=" ">
<subfield code="a">130</subfield>
<subfield code="2">rpb</subfield>
</datafield>
<datafield tag="084" ind1=" " ind2=" ">
<subfield code="a">140</subfield>
<subfield code="2">rpb</subfield>
</datafield>
<datafield tag="084" ind1=" " ind2=" ">
<subfield code="a">330</subfield>
<subfield code="2">rpb</subfield>
</datafield>
<datafield tag="100" ind1="1" ind2=" ">
<subfield code="a">Leyser, Johann Jakob</subfield>
<subfield code="d">1799-1867</subfield>
<subfield code="0">(DE-588)1034937715</subfield>
<subfield code="4">aut</subfield>
<subfield code="0">http://d-nb.info/gnd/1034937715</subfield>
<subfield code="0">http://viaf.org/viaf/sourceID/DNB|1034937715</subfield>
<subfield code="B">GND-1034937715</subfield>
</datafield>
<datafield tag="245" ind1="1" ind2="0">
<subfield code="a">Zur Geschichte und Kunde des ehemaligen Nahe-Gaues</subfield>
<subfield code="h">Elektronische Ressource</subfield>
<subfield code="c">von Auctionsverwalter Leyser in Oberstein</subfield>
</datafield>
<datafield tag="264" ind1=" " ind2="1">
<subfield code="a">Birkenfeld</subfield>
<subfield code="b">Kittsteiner</subfield>
<subfield code="c">1853</subfield>
</datafield>
<datafield tag="300" ind1=" " ind2=" ">
<subfield code="a">IV, 166 S., 1 Taf. 8"</subfield>
</datafield>
<datafield tag="689" ind1="0" ind2="0">
<subfield code="a">Nahegau</subfield>
<subfield code="D">g</subfield>
<subfield code="0">(DE-588)4580132-0</subfield>
<subfield code="B">GND-958460078</subfield>
</datafield>
<datafield tag="689" ind1="0" ind2="1">
<subfield code="a">Geschichte</subfield>
<subfield code="A">z</subfield>
</datafield>
<datafield tag="856" ind1="4" ind2=" ">
<subfield code="u">http://www.mdz-nbn-resolving.de/urn/resolver.pl?urn=urn:nbn:de:bvb:12-bsb10020200-9</subfield>
<subfield code="x">Resolving-System</subfield>
<subfield code="z">kostenfrei</subfield>
<subfield code="3">Volltext // 2013 digitalisiert von: Bayerische Staatsbibliothek, München. Exemplar mit der Signatur: München, Bayerische Staatsbibliothek -- Germ.sp. 281 d</subfield>
</datafield>
<datafield tag="964" ind1="0" ind2="s">
<subfield code="F">051</subfield>
<subfield code="A">m|||||||</subfield>
</datafield>
<datafield tag="964" ind1="0" ind2="s">
<subfield code="F">030</subfield>
<subfield code="A">a|1uc||||||17</subfield>
</datafield>
<datafield tag="964" ind1="0" ind2="s">
<subfield code="F">050</subfield>
<subfield code="A">||||||||g|||||</subfield>
</datafield>
<datafield tag="035" ind1=" " ind2=" ">
<subfield code="a">(OCoLC)162593822</subfield>
</datafield>
<datafield tag="035" ind1=" " ind2=" ">
<subfield code="a">(DE-604)159513057</subfield>
</datafield>
<datafield tag="035" ind1=" " ind2=" ">
<subfield code="a">(DE-599)HBZHT017749938</subfield>
</datafield>
<datafield tag="500" ind1=" " ind2=" ">
<subfield code="a">In Fraktur</subfield>
</datafield>
<datafield tag="583" ind1="1" ind2=" ">
<subfield code="a">Archivierung/Langzeitarchivierung gewährleistet</subfield>
<subfield code="f">PERP</subfield>
<subfield code="5">DE-929</subfield>
</datafield>
<datafield tag="MBD" ind1=" " ind2=" ">
<subfield code="M">49HBZ_NETWORK</subfield>
<subfield code="i">990198125850206441</subfield>
<subfield code="n">HBZ Network</subfield>
</datafield>
<datafield tag="MNG" ind1=" " ind2=" ">
<subfield code="c">System</subfield>
<subfield code="f">HBZ</subfield>
<subfield code="i">marc21</subfield>
<subfield code="h">20181005112700.0</subfield>
<subfield code="k">01</subfield>
<subfield code="e">false</subfield>
<subfield code="d">2022-06-04 04:07:14 Europe/Berlin</subfield>
<subfield code="g">019812585-HBZ01</subfield>
<subfield code="j">60</subfield>
<subfield code="a">import</subfield>
<subfield code="b">2021-04-05 19:04:47 Europe/Berlin</subfield>
</datafield>
<datafield tag="GSI" ind1="7" ind2=" ">
<subfield code="a">4580132-0</subfield>
<subfield code="0">http://d-nb.info/gnd/4580132-0</subfield>
<subfield code="2">gnd</subfield>
<subfield code="A">GND</subfield>
<subfield code="B">GND-958460078</subfield>
<subfield code="C">024</subfield>
</datafield>
<datafield tag="GSI" ind1="7" ind2=" ">
<subfield code="a">http://d-nb.info/gnd/1034937715</subfield>
<subfield code="2">uri</subfield>
<subfield code="A">GND</subfield>
<subfield code="B">GND-1034937715</subfield>
<subfield code="C">024</subfield>
</datafield>
</record>
6 changes: 3 additions & 3 deletions web/test/tests/IndexIntegrationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static Collection<Object[]> data() {
{ "spatial.label:Westfalen", /*->*/ 8 },
{ "spatial.label:Westfälen", /*->*/ 8 },
{ "subject.componentList.id:1113670827", /*->*/ 0 },
{ "subject.componentList.type:PlaceOrGeographicName", /*->*/ 22 },
{ "subject.componentList.type:PlaceOrGeographicName", /*->*/ 23 },
{ "publication.location:Berlin", /*->*/ 16 },
{ "subject.notation:914.3", /*->*/ 6 },
{ "subject.notation:914", /*->*/ 0 },
Expand All @@ -66,8 +66,8 @@ public static Collection<Object[]> data() {
{ "publication.startDate:1993", /*->*/ 3 },
{ "publication.location:Berlin AND publication.startDate:1993", /*->*/ 1 },
{ "publication.location:Berlin AND publication.startDate:[1992 TO 2017]", /*->*/ 5 },
{ "inCollection.id:\"http\\://lobid.org/organisations/DE-655#\\!\"", /*->*/ 133 },
{ "inCollection.id:\"https\\://nrw.digibib.net/search/hbzvk/\"", /*->*/ 150 },
{ "inCollection.id:\"http\\://lobid.org/organisations/DE-655#\\!\"", /*->*/ 134 },
{ "inCollection.id:\"https\\://nrw.digibib.net/search/hbzvk/\"", /*->*/ 151 },
{ "inCollection.id:NWBib", /*->*/ 0 },
{ "publication.publishedBy:Quedenfeldt", /*->*/ 2 },
{ "publication.publishedBy:Quedenfeld", /*->*/ 2 },
Expand Down
Loading