Skip to content

Commit

Permalink
add support for teiCorpus to RDF conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianrahtz committed Oct 3, 2013
1 parent 75e6ff6 commit 37c9cec
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion rdf/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
default: build compile

build:
saxon -o:rdf.expanded -s:rdf.odd -xsl:/usr/share/xml/tei/stylesheet/odds2/odd2odd.xsl
saxon -o:rdf.expanded -s:rdf.odd -xsl:/usr/share/xml/tei/stylesheet/odds/odd2odd.xsl

compile:
saxon rdf.expanded make-acdc.xsl > tei2rdf.xsl
Expand Down
3 changes: 3 additions & 0 deletions rdf/crm.odd
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
<elementSpec ident="TEI" mode="change">
<equiv filter="crm.xsl" mimeType="text/xsl" name="TEI"/>
</elementSpec>
<elementSpec ident="teiCorpus" mode="change">
<equiv filter="crm.xsl" mimeType="text/xsl" name="TEI"/>
</elementSpec>

<elementSpec ident="title" mode="change">
<equiv filter="crm.xsl" mimeType="text/xsl" name="E35"
Expand Down
14 changes: 7 additions & 7 deletions rdf/crm.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
<xsl:template name="E31">
<E31_Document xmlns="http://purl.org/NET/crm-owl#"
rdf:about="{tei:makeID(.,'id')}">
<xsl:apply-templates select="parent::TEI/teiHeader/fileDesc"/>
<xsl:apply-templates select="parent::TEI/teiHeader/fileDesc|parent::teiCorous/teiHeader/fileDesc"/>
</E31_Document>
<xsl:apply-templates/>
</xsl:template>
Expand Down Expand Up @@ -557,9 +557,9 @@
<xsl:variable name="baseid">
<xsl:choose>
<xsl:when
test="ancestor::TEI/teiHeader/fileDesc/publicationStmt/idno[starts-with(.,'http')]">
test="(ancestor::TEI|ancestor::teiCorpus)/teiHeader/fileDesc/publicationStmt/idno[starts-with(.,'http')]">
<xsl:value-of
select="ancestor::TEI/teiHeader/fileDesc/publicationStmt/idno[starts-with(.,'http')][1]"/>
select="(ancestor::TEI|ancestor::teiCorpus)/teiHeader/fileDesc/publicationStmt/idno[starts-with(.,'http')][1]"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
Expand All @@ -575,8 +575,8 @@
<xsl:value-of select="@xml:id"/>
</xsl:when>
<xsl:when
test="ancestor::TEI/teiHeader/fileDesc/publicationStmt/idno">
<xsl:value-of select="ancestor::TEI/teiHeader/fileDesc/publicationStmt/idno[1]"/>
test="(ancestor::TEI|ancestor::teiCorpus)/teiHeader/fileDesc/publicationStmt/idno">
<xsl:value-of select="(ancestor::TEI|ancestor::teiCorpus)/teiHeader/fileDesc/publicationStmt/idno[1]"/>
</xsl:when>
<xsl:otherwise>
<xsl:number level="any"/>
Expand All @@ -588,9 +588,9 @@
<xsl:variable name="baseurl">
<xsl:choose>
<xsl:when
test="ancestor::TEI/teiHeader/fileDesc/publicationStmt/idno[contains(.,'/id/')]">
test="(ancestor::TEI|ancestor::teiCorpus)/teiHeader/fileDesc/publicationStmt/idno[contains(.,'/id/')]">
<xsl:analyze-string
select="ancestor::TEI/teiHeader/fileDesc/publicationStmt/idno[contains(.,'/id/')][1]"
select="(ancestor::TEI|ancestor::teiCorpus)/teiHeader/fileDesc/publicationStmt/idno[contains(.,'/id/')][1]"
regex="(.*)/id/[^/]+">
<xsl:matching-substring>
<xsl:value-of select="regex-group(1)"/>
Expand Down
3 changes: 3 additions & 0 deletions rdf/tei2rdf.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
<XSL:template match="title">
<XSL:call-template name="E35"/>
</XSL:template>
<XSL:template match="teiCorpus">
<XSL:call-template name="TEI"/>
</XSL:template>
<XSL:template match="fileDesc">
<XSL:call-template name="F24"/>
</XSL:template>
Expand Down

0 comments on commit 37c9cec

Please sign in to comment.