Skip to content

Commit

Permalink
update v2.0.1; handling inline- and blockquotes in fixtures xsl; fixe…
Browse files Browse the repository at this point in the history
…d werk api url; added field_anmerkung_intern as noteStmt
  • Loading branch information
linxOD committed Aug 29, 2022
1 parent 3b1a30a commit 31c8166
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion freud_api_crawler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__author__ = """Peter Andorfer"""
__email__ = '[email protected]'
__version__ = '2.0.0'
__version__ = '2.0.1'
6 changes: 3 additions & 3 deletions freud_api_crawler/fixtures/make_tei.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@
<hi><xsl:attribute name="rendition"><xsl:value-of select="concat('#', ./@class)"/></xsl:attribute><xsl:apply-templates/></hi>
</xsl:template>
<xsl:template match="tei:span[@class='inlinequote']">
<q><xsl:attribute name="type">inlinequote</xsl:attribute><xsl:apply-templates/></q>
<quote><xsl:attribute name="type">inlinequote</xsl:attribute><xsl:apply-templates/></quote>
</xsl:template>
<xsl:template match="tei:span[@class='blockquote']">
<q><xsl:attribute name="type">blockquote</xsl:attribute><xsl:apply-templates/></q>
<cit><quote><xsl:attribute name="type">blockquote</xsl:attribute><xsl:apply-templates/></quote></cit>
</xsl:template>
<xsl:template match="tei:em">
<hi><xsl:attribute name="rendition">#em</xsl:attribute><xsl:apply-templates/></hi>
Expand All @@ -165,7 +165,7 @@
####################
-->
<xsl:template match="tei:blockquote">
<q><xsl:attribute name="type">blockquote</xsl:attribute><xsl:apply-templates/></q>
<cit><quote><xsl:attribute name="type">blockquote</xsl:attribute><xsl:apply-templates/></quote></cit>
</xsl:template>

</xsl:stylesheet>
7 changes: 6 additions & 1 deletion freud_api_crawler/freud_api_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,11 @@ def get_man_json_dump(self, lmt=True, dmp=False):
json_dump["url"] = f"{self.endpoint}{man_type}/{self.manifestation_id}"
json_dump['man_title'] = self.md__title
json_dump['signature'] = self.manifestation_signatur
try:
json_dump['note_i'] = self.manifestation['data']['attributes']['field_anmerkung_intern_']['processed']
except (KeyError, TypeError):
json_dump['note_i'] = None
print("No 'note intern' found!")
try:
s_title_t = self.manifestation['data']['attributes']['field_shorttitle']
json_dump['man_shorttitle'] = escape(s_title_t['value'])
Expand Down Expand Up @@ -538,7 +543,7 @@ def get_man_json_dump(self, lmt=True, dmp=False):
json_dump["work"] = {}
json_dump["work"]["id"] = f"bibl__{self.werk['id']}"
json_dump["work"]["title"] = escape(self.werk['attributes']['title'])
json_dump["work"]["url"] = f"{self.endpoint}werk/{self.werk['id']}"
json_dump["work"]["url"] = f"{self.endpoint}node/werk/{self.werk['id']}"
json_dump["work"]["browser_url"] = f"{self.browser}{self.werk_folder}"
# publication level 1
init_methods = {
Expand Down
7 changes: 7 additions & 0 deletions freud_api_crawler/templates/tei.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@
</licence>
</availability>
</publicationStmt>
{% if man.note_i %}
<notesStmt>
<note type="comment_intern">
{{ man.note_i }}
</note>
</notesStmt>
{% endif %}
<sourceDesc>
<biblStruct xml:id="guiding_manifestation">
{% if man.type == "Monographie" or man.type == "Werkausgabe" or man.type == "Periodikum (Heft)" or man.type == "Periodikum (Jahrgang)" or man.type == "Periodiukum" %}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@
test_suite='tests',
tests_require=test_requirements,
url='https://github.com/acdh-oeaw/freud_api_crawler',
version='2.0.0',
version='2.0.1',
zip_safe=False,
)

0 comments on commit 31c8166

Please sign in to comment.