Skip to content

Commit 31c8166

Browse files
committed
update v2.0.1; handling inline- and blockquotes in fixtures xsl; fixed werk api url; added field_anmerkung_intern as noteStmt
1 parent 3b1a30a commit 31c8166

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed

freud_api_crawler/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
__author__ = """Peter Andorfer"""
44
__email__ = '[email protected]'
5-
__version__ = '2.0.0'
5+
__version__ = '2.0.1'

freud_api_crawler/fixtures/make_tei.xslt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@
147147
<hi><xsl:attribute name="rendition"><xsl:value-of select="concat('#', ./@class)"/></xsl:attribute><xsl:apply-templates/></hi>
148148
</xsl:template>
149149
<xsl:template match="tei:span[@class='inlinequote']">
150-
<q><xsl:attribute name="type">inlinequote</xsl:attribute><xsl:apply-templates/></q>
150+
<quote><xsl:attribute name="type">inlinequote</xsl:attribute><xsl:apply-templates/></quote>
151151
</xsl:template>
152152
<xsl:template match="tei:span[@class='blockquote']">
153-
<q><xsl:attribute name="type">blockquote</xsl:attribute><xsl:apply-templates/></q>
153+
<cit><quote><xsl:attribute name="type">blockquote</xsl:attribute><xsl:apply-templates/></quote></cit>
154154
</xsl:template>
155155
<xsl:template match="tei:em">
156156
<hi><xsl:attribute name="rendition">#em</xsl:attribute><xsl:apply-templates/></hi>
@@ -165,7 +165,7 @@
165165
####################
166166
-->
167167
<xsl:template match="tei:blockquote">
168-
<q><xsl:attribute name="type">blockquote</xsl:attribute><xsl:apply-templates/></q>
168+
<cit><quote><xsl:attribute name="type">blockquote</xsl:attribute><xsl:apply-templates/></quote></cit>
169169
</xsl:template>
170170

171171
</xsl:stylesheet>

freud_api_crawler/freud_api_crawler.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,11 @@ def get_man_json_dump(self, lmt=True, dmp=False):
424424
json_dump["url"] = f"{self.endpoint}{man_type}/{self.manifestation_id}"
425425
json_dump['man_title'] = self.md__title
426426
json_dump['signature'] = self.manifestation_signatur
427+
try:
428+
json_dump['note_i'] = self.manifestation['data']['attributes']['field_anmerkung_intern_']['processed']
429+
except (KeyError, TypeError):
430+
json_dump['note_i'] = None
431+
print("No 'note intern' found!")
427432
try:
428433
s_title_t = self.manifestation['data']['attributes']['field_shorttitle']
429434
json_dump['man_shorttitle'] = escape(s_title_t['value'])
@@ -538,7 +543,7 @@ def get_man_json_dump(self, lmt=True, dmp=False):
538543
json_dump["work"] = {}
539544
json_dump["work"]["id"] = f"bibl__{self.werk['id']}"
540545
json_dump["work"]["title"] = escape(self.werk['attributes']['title'])
541-
json_dump["work"]["url"] = f"{self.endpoint}werk/{self.werk['id']}"
546+
json_dump["work"]["url"] = f"{self.endpoint}node/werk/{self.werk['id']}"
542547
json_dump["work"]["browser_url"] = f"{self.browser}{self.werk_folder}"
543548
# publication level 1
544549
init_methods = {

freud_api_crawler/templates/tei.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@
7575
</licence>
7676
</availability>
7777
</publicationStmt>
78+
{% if man.note_i %}
79+
<notesStmt>
80+
<note type="comment_intern">
81+
{{ man.note_i }}
82+
</note>
83+
</notesStmt>
84+
{% endif %}
7885
<sourceDesc>
7986
<biblStruct xml:id="guiding_manifestation">
8087
{% if man.type == "Monographie" or man.type == "Werkausgabe" or man.type == "Periodikum (Heft)" or man.type == "Periodikum (Jahrgang)" or man.type == "Periodiukum" %}

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,6 @@
7272
test_suite='tests',
7373
tests_require=test_requirements,
7474
url='https://github.com/acdh-oeaw/freud_api_crawler',
75-
version='2.0.0',
75+
version='2.0.1',
7676
zip_safe=False,
7777
)

0 commit comments

Comments
 (0)