Skip to content
Snippets Groups Projects
Commit f933b7da authored by philip.roeggla's avatar philip.roeggla
Browse files

markers

parent 20451347
Branches
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@ from travelogues_extraction.getrecords.session import RecordRetriever
from travelogues_extraction.getrecords.acnumber_extractor import extract_ac_from_series
from travelogues_extraction.dataextractors.dataextractors.simple import VolltextAndBarcode, Ausgabe, Verlagsort, \
VerlegerDrucker, Erscheinungsjahr, ErscheinungsjahrSortierform, Kollation, Illustrationen, Format, Anmerkungen, \
Sprache, OriginalSprache, BemerkungenZurSprache, Standardnummer, ArtDesInhalts, Inhalt
Sprache, OriginalSprache, BemerkungenZurSprache, Standardnummer, ArtDesInhalts, Inhalt, Marker
from travelogues_extraction.dataextractors.dataextractors.index import IndexSetter
......@@ -44,6 +44,7 @@ async def test_volltext_and_barcode_and_ausgabe_and_verlagsort_and_verleger_druc
bemerkungenZurSprache = BemerkungenZurSprache(target_dataframe)
artDesInhalts = ArtDesInhalts(target_dataframe)
inhalt = Inhalt(target_dataframe)
marker = Marker(target_dataframe)
index = 0
stop = 3
......@@ -108,6 +109,7 @@ async def test_volltext_and_barcode_and_ausgabe_and_verlagsort_and_verleger_druc
await bemerkungenZurSprache.write(record)
await artDesInhalts.write(record)
await inhalt.write(record)
await marker.write(record)
assert target_dataframe.shape[0] == index + 1
assert target_dataframe.iat[index, 1].__class__ is str
......@@ -213,6 +215,10 @@ async def test_volltext_and_barcode_and_ausgabe_and_verlagsort_and_verleger_druc
assert inhalt_list[0][0].isalpha()
assert inhalt_list[1][0].isalpha()
markers = target_dataframe.at[record.ac_number, marker.column].split(marker.join_string)
assert len(markers) > 0
assert any([m.startswith('Travel') for m in markers])
index += 1
if index == stop:
break
......
......@@ -37,7 +37,7 @@ class FromAlmaOutputToExcel:
VerlegerNormiertGNDID, DruckerGNDID, Erscheinungsjahr, ErscheinungsjahrSortierform, Kollation, Illustrationen,
Format, Anmerkungen, Sprache, OriginalSprache, BemerkungenZurSprache, Standardnummer, WeitereVerfasserGNDID,
HerausgeberGNDID, ÜbersetzerGNDID, BeiträgerGNDID, WeitereBeteiligteGNDID, IllustratorenGNDID, WidmenderGNDID,
WidmungsempfängerGNDID, ArtDesInhalts, Inhalt, WerkeInRelation, Schlagworte
WidmungsempfängerGNDID, ArtDesInhalts, Inhalt, WerkeInRelation, Schlagworte, Marker
]
def __init__(self, alma_output: str, target_output: str, slice: slice):
......
......@@ -194,6 +194,9 @@ class Inhalt(AbstractXpathJoinDirectlyToColumn):
)
class Marker(AbstractXpathJoinDirectlyToColumn):
column = 'Marker'
xpath = lxmletree.XPath('./marc:datafield[@tag="980" and @ind1="0" and @ind2=" "]/marc:subfield[@code="a"]', namespaces=namespaces)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment