Commit c50bb0ee authored by Silvia Witzig's avatar Silvia Witzig
Browse files

improve persons

parent 9e6eb9cf
......@@ -2,9 +2,6 @@ splitEntity:
- type: skos:Concept
property: skos:prefLabel
delimiter: ";"
- type: rico:Person
property: rico:name
delimiter: ";"
- type: rico:CorporateBody
property: rico:name
delimiter: ";"
......@@ -12,10 +9,6 @@ splitEntity:
property: rico:name
delimiter: ";"
normalizePerson:
splitEntity:
type: rico:Person
property: rico:name
delimiter: ";"
creationRelationName: # only tries to extract a value if a DUMMY-VALUE rico:name is property is present in the relation.
pattern: "\\((?<relation>.+)\\)" # " are necessary to ensure pattern is parsed correctly. Pattern needs to be double escaped!
language: NONE
......
......@@ -48,9 +48,30 @@
<!-- content of typeLabel is transformed to an element name and content of child node is copied to it-->
<xsl:template match="description[@typeLabel] | alternativeTitle[@typeLabel] | subject[@typeLabel] | relation[@typeLabel]">
<xsl:variable name="typeLabel" select="@typeLabel"/>
<xsl:element name="{$typeLabel}">
<xsl:value-of select="child::*"/>
</xsl:element>
<xsl:choose>
<xsl:when test="$typeLabel = 'FeaturedIndividual'">
<xsl:analyze-string select ="replace(child::*, ' ; ', 'x;x')" regex = ";\s">
<xsl:matching-substring/>
<xsl:non-matching-substring>
<xsl:element name="FeaturedIndividual">
<xsl:choose>
<xsl:when test="matches(., ',')">
<xsl:value-of select="replace(concat(substring-after(., ', '), ' ', substring-before(., ', ')), 'x;x', ' ; ')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="replace(., 'x;x', ' ; ')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:non-matching-substring>
</xsl:analyze-string>
</xsl:when>
<xsl:otherwise>
<xsl:element name="{$typeLabel}">
<xsl:value-of select="child::*"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- content of typeLabel is copied as content of the node -->
......
......@@ -16,6 +16,6 @@ normalizePerson:
creationRelationName: # only tries to extract a value if a DUMMY-VALUE rico:name is property is present in the relation.
pattern: "\\((?<relation>.+)\\)" # " are necessary to ensure pattern is parsed correctly. Pattern needs to be double escaped!
language: NONE
nameOrder: "first-to-last" #works for creator, for featuredIndividual it should be last-to-first with nameDelimiter:SPACE
nameOrder: "last-to-first"
singleNameIsLastName: true
nameDelimiter: SPACE
\ No newline at end of file
......@@ -178,7 +178,14 @@
<xsl:when test="child::contactDetails">
<xsl:element name="{$type}Person">
<xsl:element name="name">
<xsl:value-of select="descendant::name"/>
<xsl:choose>
<xsl:when test="descendant::name = 'WILLIAM RITTER'">
<xsl:value-of select="'RITTER WILLIAM'"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="descendant::name"/>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
<xsl:if test="$role">
<xsl:element name="role">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment