Commit 5391d1ac authored by ql309megy's avatar ql309megy
Browse files

added json-ld for viaf

parent fa92ddf2
......@@ -101,6 +101,7 @@ module.dptbase.viaf.preferredName.prefix = Pr\u00E4fix
module.dptbase.viaf.preferredName.surname = Nachname
module.dptbase.viaf.preferredName.title = Titel
module.dptbase.viaf.preferredName.validate = Die Eingabe eines Namens ist erforderlich!
module.dptbase.viaf.preferredName.view = Name
module.dptbase.viaf.profession.label = Beruf
module.dptbase.viaf.profession.view = Beruf(e)
module.dptbase.viaf.professionIdentifier.label = Beruf (ID)
......
......@@ -100,6 +100,7 @@ module.dptbase.viaf.preferredName.prefix = prefix
module.dptbase.viaf.preferredName.surname = surname
module.dptbase.viaf.preferredName.title = title
module.dptbase.viaf.preferredName.validate = The input of the name is required!
module.dptbase.viaf.preferredName.view = Name
module.dptbase.viaf.profession.label = Profession
module.dptbase.viaf.profession.view = Profession(s)
module.dptbase.viaf.professionIdentifier.label = Profession (ID)
......
......@@ -91,13 +91,14 @@ module.dptbase.viaf.preferredName.affix = affix
module.dptbase.viaf.preferredName.callname = call name
module.dptbase.viaf.preferredName.firstname = first name
module.dptbase.viaf.preferredName.fullname = full name
module.dptbase.viaf.preferredName.label = Name (*)
module.dptbase.viaf.preferredName.label = Nombre (*)
module.dptbase.viaf.preferredName.numeration = numeration
module.dptbase.viaf.preferredName.peerage = peerage
module.dptbase.viaf.preferredName.prefix = prefix
module.dptbase.viaf.preferredName.surname = surname
module.dptbase.viaf.preferredName.title = title
module.dptbase.viaf.preferredName.validate = The input of the name is required!
module.dptbase.viaf.preferredName.view = Nombre
module.dptbase.viaf.profession.label = Profession
module.dptbase.viaf.profession.view = Profession(s)
module.dptbase.viaf.professionIdentifier.label = Profession (ID)
......
......@@ -100,6 +100,7 @@ module.dptbase.viaf.preferredName.prefix = Pr\u00E9fixe
module.dptbase.viaf.preferredName.surname = Nom de famille
module.dptbase.viaf.preferredName.title = Titre
module.dptbase.viaf.preferredName.validate = La saisie d'un nom est n\u00E9cessaire!
module.dptbase.viaf.preferredName.view = Nom
module.dptbase.viaf.profession.label = Profession
module.dptbase.viaf.profession.view = Profession(s)
module.dptbase.viaf.professionIdentifier.label = Profession (ID)
......
......@@ -77,6 +77,7 @@ module.dptbase.viaf.preferredName.fullname = komplit
module.dptbase.viaf.preferredName.label = Nama (*)
module.dptbase.viaf.preferredName.title = Gelar
module.dptbase.viaf.preferredName.validate = Nama wajib diisi!
module.dptbase.viaf.preferredName.view = Nama
module.dptbase.viaf.profession.label = Profesi
module.dptbase.viaf.profession.view = Profesi-profesi
module.dptbase.viaf.professionIdentifier.label = Profesi (ID)
......
......@@ -85,6 +85,7 @@ module.dptbase.viaf.preferredName.prefix = Prefix
module.dptbase.viaf.preferredName.surname = cognome
module.dptbase.viaf.preferredName.title = titolo
module.dptbase.viaf.preferredName.validate = Inserire il nome!
module.dptbase.viaf.preferredName.view = Nome
module.dptbase.viaf.profession.label = Professione
module.dptbase.viaf.profession.view = Professioni
module.dptbase.viaf.professionIdentifier.label = Professione (ID)
......
......@@ -98,6 +98,7 @@ module.dptbase.viaf.preferredName.prefix = Pr\u00E4fix
module.dptbase.viaf.preferredName.surname = \u59D3
module.dptbase.viaf.preferredName.title = Titel
module.dptbase.viaf.preferredName.validate = Die Eingabe eines namens ist erforderlich!
module.dptbase.viaf.preferredName.view = \u59D3\u540D
module.dptbase.viaf.profession.label = \u8077\u696D
module.dptbase.viaf.profession.view = \u8077\u696D
module.dptbase.viaf.professionIdentifier.label = \u8077\u696D (ID)
......
......@@ -5,6 +5,7 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:gnd="http://d-nb.info/standards/elementset/gnd#"
exclude-result-prefixes="xlink mcr i18n acl encoder" version="1.0">
<xsl:import href="viaf2json_ld.xsl"/>
<xsl:include href="viaf_button_definition.xsl"/>
<xsl:template match="/mycoreobject[contains(@ID,'_viaf_')]" mode="citation" priority="1">
......@@ -118,6 +119,9 @@ function showPNDBeaconResult(result) {
<div class="table-responsive">
<table class="table metadata_table">
<script type="application/ld+json">
<xsl:apply-templates select="." mode="jsonld" />
</script>
<!-- ethnikon -->
......
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:schema="http://schema.org" xmlns:i18n="xalan://org.mycore.services.i18n.MCRTranslation" exclude-result-prefixes="xlink xsl xs schema i18n">
<xsl:import href="jsonld-common.xsl" />
<xsl:output method="text" media-type="application/ld+json" encoding="UTF-8" indent="yes" />
<xsl:param name="WebApplicationBaseURL"/>
<xsl:param name="CurrentLang"/>
<xsl:template match="/mycoreobject[contains(@ID,'_viaf_')]" mode="jsonld" priority="1">
<xsl:variable name="obj_id">
<xsl:value-of select="@ID"/>
</xsl:variable>
<xsl:text>[{
"@context":
{
"schema":"http:\/\/schema.org\/",
"</xsl:text><xsl:value-of select="i18n:translate('module.dptbase.viaf.preferredName.view')" />
<xsl:text>":"schema:name",
"</xsl:text><xsl:value-of select="i18n:translate('module.dptbase.viaf.preferredName.academic')" />
<xsl:text>":"schema:honorificPrefix",
"</xsl:text><xsl:value-of select="i18n:translate('module.dptbase.viaf.preferredName.title')" />
<xsl:text>":"schema:honorificPrefix",
"</xsl:text><xsl:value-of select="i18n:translate('module.dptbase.viaf.preferredName.peerage')" />
<xsl:text>":"schema:honorificPrefix",
"</xsl:text><xsl:value-of select="i18n:translate('module.dptbase.viaf.preferredName.firstname')" />
<xsl:text>":"schema:givenName",
"</xsl:text><xsl:value-of select="i18n:translate('module.dptbase.viaf.preferredName.callname')" />
<xsl:text>":"schema:additionalName",
"</xsl:text><xsl:value-of select="i18n:translate('module.dptbase.viaf.preferredName.surname')" />
<xsl:text>":"schema:familyName",
"</xsl:text><xsl:value-of select="i18n:translate('module.dptbase.viaf.variantName.view')" />
<xsl:text>":"schema:additionalName",
"</xsl:text><xsl:value-of select="i18n:translate('module.dptbase.viaf.sex.view')" />
<xsl:text>":"schema:gender",
"</xsl:text><xsl:value-of select="i18n:translate('module.dptbase.viaf.ethnikon.view')" />
<xsl:text>":"schema:nationality",
"</xsl:text><xsl:value-of select="i18n:translate('module.dptbase.viaf.firstDate.label')" />
<xsl:text>":"schema:birthDate",
"</xsl:text><xsl:value-of select="i18n:translate('module.dptbase.viaf.firstPlace.label')" />
<xsl:text>":"schema:birthPlace",
"</xsl:text><xsl:value-of select="i18n:translate('module.dptbase.viaf.secondDate.label')" />
<xsl:text>":"schema:deathDate",
"</xsl:text><xsl:value-of select="i18n:translate('module.dptbase.viaf.secondPlace.label')" />
<xsl:text>":"schema:deathPlace",
"</xsl:text><xsl:value-of select="i18n:translate('module.dptbase.viaf.profession.view')" />
<xsl:text>":"schema:jobTitle",
"</xsl:text><xsl:value-of select="i18n:translate('module.dptbase.viaf.areaOfActivity.view')" />
<xsl:text>":"schema:workLocation",
"</xsl:text><xsl:value-of select="i18n:translate('module.dptbase.viaf.instMembership.view')" />
<xsl:text>":"schema:memberOf",
"GND-ID":"schema:identifier",
"VIAF-ID":"schema:identifier",
"LCNAF-ID":"schema:identifier",
"TM-Person-ID":"schema:identifier",
"TM-Name-ID":"schema:identifier",
"Other-ID":"schema:identifier"
},
"@type":"schema:Person",
</xsl:text>
<!-- ID -->
<xsl:text>&#xa;"@id":"</xsl:text>
<xsl:value-of select="concat($WebApplicationBaseURL,'receive/',./@ID)"/>
<xsl:text>"</xsl:text>
<!-- fullname -->
<xsl:if test="metadata/def.preferredName/preferredName">
<xsl:text>, &#xa;"</xsl:text>
<xsl:value-of select="i18n:translate('module.dptbase.viaf.preferredName.view')" />
<xsl:text>":"</xsl:text>
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="./metadata/def.preferredName/preferredName/fullname/text()" />
</xsl:call-template>
<xsl:text>"</xsl:text>
</xsl:if>
<!-- academic title -->
<xsl:if test="metadata/def.preferredName/preferredName/academic">
<xsl:text>, &#xa;"</xsl:text>
<xsl:value-of select="i18n:translate('module.dptbase.viaf.preferredName.academic')" />
<xsl:text>":"</xsl:text>
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="./metadata/def.preferredName/preferredName/academic/text()" />
</xsl:call-template>
<xsl:text>"</xsl:text>
</xsl:if>
<!-- honorific title, e.g. "king" -->
<xsl:if test="metadata/def.preferredName/preferredName/title">
<xsl:text>, &#xa;"</xsl:text>
<xsl:value-of select="i18n:translate('module.dptbase.viaf.preferredName.title')" />
<xsl:text>":"</xsl:text>
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="./metadata/def.preferredName/preferredName/title/text()" />
</xsl:call-template>
<xsl:text>"</xsl:text>
</xsl:if>
<!-- peerage -->
<xsl:if test="metadata/def.preferredName/preferredName/peerage">
<xsl:text>, &#xa;"</xsl:text>
<xsl:value-of select="i18n:translate('module.dptbase.viaf.preferredName.peerage')" />
<xsl:text>":"</xsl:text>
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="./metadata/def.preferredName/preferredName/peerage/text()" />
</xsl:call-template>
<xsl:text>"</xsl:text>
</xsl:if>
<!-- first name -->
<xsl:if test="./metadata/def.preferredName/preferredName/firstname">
<xsl:text>, &#xa;"</xsl:text>
<xsl:value-of select="i18n:translate('module.dptbase.viaf.preferredName.firstname')" />
<xsl:text>":"</xsl:text>
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="./metadata/def.preferredName/preferredName/firstname/text()" />
</xsl:call-template>
<xsl:text>"</xsl:text>
</xsl:if>
<!-- callname -->
<xsl:if test="metadata/def.preferredName/preferredName/callname">
<xsl:text>, &#xa;"</xsl:text>
<xsl:value-of select="i18n:translate('module.dptbase.viaf.preferredName.callname')" />
<xsl:text>":"</xsl:text>
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="./metadata/def.preferredName/preferredName/callname/text()" />
</xsl:call-template>
<xsl:text>"</xsl:text>
</xsl:if>
<!-- family name -->
<xsl:if test="metadata/def.preferredName/preferredName/surname">
<xsl:text>, &#xa;"</xsl:text>
<xsl:value-of select="i18n:translate('module.dptbase.viaf.preferredName.surname')" />
<xsl:text>":"</xsl:text>
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="./metadata/def.preferredName/preferredName/surname/text()" />
</xsl:call-template>
<xsl:text>"</xsl:text>
</xsl:if>
<!-- variant name -->
<xsl:if test="metadata/def.variantName/variantName">
<xsl:text>,&#xa;"</xsl:text>
<xsl:value-of select="i18n:translate('module.dptbase.viaf.variantName.view')" />
<xsl:text>":"</xsl:text>
<xsl:for-each select="metadata/def.variantName/variantName/fullname">
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="." />
</xsl:call-template>
<xsl:if test="position()!=last()">
<xsl:text>,&#x20;</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text>"</xsl:text>
</xsl:if>
<!-- sex -->
<xsl:if test="./metadata/def.sex">
<xsl:text>, &#xa;"</xsl:text>
<xsl:value-of select="i18n:translate('module.dptbase.viaf.sex.view')" />
<xsl:text>":"</xsl:text>
<xsl:for-each select="metadata/def.sex/sex">
<xsl:variable name="classid" select="@classid"/>
<xsl:variable name="categid" select="@categid"/>
<xsl:variable name="class" select="document(concat('classification:metadata:0:children:',$classid,':',$categid))/*/categories"/>
<xsl:value-of select="$class/category/label[@xml:lang='de']/@text"/>
</xsl:for-each>
<xsl:text>"</xsl:text>
</xsl:if>
<!-- Ethnikon -->
<xsl:if test="./metadata/def.ethnikon">
<xsl:text>, &#xa;"</xsl:text>
<xsl:value-of select="i18n:translate('module.dptbase.viaf.ethnikon.view')" />
<xsl:text>":["</xsl:text>
<xsl:for-each select="metadata/def.ethnikon/ethnikon">
<xsl:variable name="classid" select="@classid"/>
<xsl:variable name="categid" select="@categid"/>
<xsl:variable name="class" select="document(concat('classification:metadata:0:children:',$classid,':',$categid))/*/categories"/>
<xsl:value-of select="$class/category/label[@xml:lang='de']/@text"/>
<xsl:if test="position()!=last()">
<xsl:text>,&#x20;</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text>"]</xsl:text>
</xsl:if>
<!-- birthdate -->
<xsl:if test="metadata/def.firstDate/firstDate">
<xsl:text>, &#xa;"</xsl:text>
<xsl:value-of select="i18n:translate('module.dptbase.viaf.firstDate.label')" />
<xsl:text>":"</xsl:text>
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="./metadata/def.firstDate/firstDate/text" />
</xsl:call-template>
<xsl:text>"</xsl:text>
</xsl:if>
<!-- birthplace -->
<xsl:if test="metadata/def.firstPlace/firstPlace">
<xsl:text>, &#xa;"</xsl:text>
<xsl:value-of select="i18n:translate('module.dptbase.viaf.firstPlace.label')" />
<xsl:text>":"</xsl:text>
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="./metadata/def.firstPlace/firstPlace/text()" />
</xsl:call-template>
<xsl:text>"</xsl:text>
</xsl:if>
<!-- date of death -->
<xsl:if test="metadata/def.secondDate/secondDate">
<xsl:text>, &#xa;"</xsl:text>
<xsl:value-of select="i18n:translate('module.dptbase.viaf.secondDate.label')" />
<xsl:text>":"</xsl:text>
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="./metadata/def.secondDate/secondDate/text" />
</xsl:call-template>
<xsl:text>"</xsl:text>
</xsl:if>
<!-- place of death -->
<xsl:if test="metadata/def.secondPlace/secondPlace">
<xsl:text>, &#xa;"</xsl:text>
<xsl:value-of select="i18n:translate('module.dptbase.viaf.secondPlace.label')" />
<xsl:text>":"</xsl:text>
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="./metadata/def.secondPlace/secondPlace/text()" />
</xsl:call-template>
<xsl:text>"</xsl:text>
</xsl:if>
<!-- profession -->
<xsl:if test="metadata/def.profession/profession">
<xsl:text>, &#xa;"</xsl:text>
<xsl:value-of select="i18n:translate('module.dptbase.viaf.profession.view')" />
<xsl:text>":"</xsl:text>
<xsl:for-each select="metadata/def.profession/profession">
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="." />
</xsl:call-template>
<xsl:if test="position()!=last()">
<xsl:text>;&#x20;</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text>"</xsl:text>
</xsl:if>
<!-- area of activity -->
<xsl:if test="metadata/def.areaOfActivitiy/areaOfActivity">
<xsl:text>, &#xa;"</xsl:text>
<xsl:value-of select="i18n:translate('module.dptbase.viaf.areaOfActivity.view')" />
<xsl:text>":"</xsl:text>
<xsl:for-each select="metadata/def.areaOfActivity/areaOfActivity">
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="." />
</xsl:call-template>
<xsl:if test="position()!=last()">
<xsl:text>;&#x20;</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text>"</xsl:text>
</xsl:if>
<!-- institutional membership -->
<xsl:if test="metadata/def.instMembership/instMembership">
<xsl:text>, &#xa;"</xsl:text>
<xsl:value-of select="i18n:translate('module.dptbase.viaf.instMembership.view')" />
<xsl:text>":"</xsl:text>
<xsl:for-each select="metadata/def.instMembership/instMembership">
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="." />
</xsl:call-template>
<xsl:if test="position()!=last()">
<xsl:text>;&#x20;</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text>"</xsl:text>
</xsl:if>
<!-- GND-ID -->
<xsl:if test="metadata/def.identifier/identifier[@type='gnd']">
<xsl:text>, &#xa;"GND-ID":{"@type":"schema:PropertyValue","schema:propertyID":"GND-ID","schema:value":"</xsl:text>
<xsl:value-of select="concat('http://d-nb.info/gnd/',metadata/def.identifier/identifier[@type='gnd'])" />
<xsl:text>"}</xsl:text>
</xsl:if>
<!-- VIAF-ID -->
<xsl:if test="metadata/def.identifier/identifier[@type='viaf']">
<xsl:text>, &#xa;"VIAF-ID":{"@type":"schema:PropertyValue","schema:propertyID":"VIAF-ID","schema:value":"</xsl:text>
<xsl:value-of select="concat('http://viaf.org/viaf/',metadata/def.identifier/identifier[@type='viaf'])" />
<xsl:text>"}</xsl:text>
</xsl:if>
<!-- LCNAF-ID -->
<xsl:if test="metadata/def.identifier/identifier[@type='lcnaf']">
<xsl:text>, &#xa;"LCNAF-ID":{"@type":"schema:PropertyValue","schema:propertyID":"LCNAF-ID","schema:value":"</xsl:text>
<xsl:value-of select="concat('http://id.loc.gov/authorities/names/',metadata/def.identifier/identifier[@type='lcnaf'],'.html')" />
<xsl:text>"}</xsl:text>
</xsl:if>
<!-- Trismegistos Person ID -->
<xsl:if test="metadata/def.identifier/identifier[@type='trisperson']">
<xsl:text>, &#xa;"TM-Person-ID":{"@type":"schema:PropertyValue","schema:propertyID":"TM-Person-ID","schema:value":"</xsl:text>
<xsl:value-of select="concat('http://www.trismegistos.org/person/',metadata/def.identifier/identifier[@type='trisperson'])" />
<xsl:text>"}</xsl:text>
</xsl:if>
<!-- Trismegistos Name ID -->
<xsl:if test="metadata/def.identifier/identifier[@type='trisname']">
<xsl:text>, &#xa;"TM-Name-ID":{"@type":"schema:PropertyValue","schema:propertyID":"TM-Name-ID","schema:value":"</xsl:text>
<xsl:value-of select="concat('http://www.trismegistos.org/name/',metadata/def.identifier/identifier[@type='trisname'])" />
<xsl:text>"}</xsl:text>
</xsl:if>
<!-- Other ID -->
<xsl:if test="metadata/def.identifier/identifier[@type='other']">
<xsl:text>, &#xa;"Other-ID":{"@type":"schema:PropertyValue","schema:propertyID":"Other-ID","schema:value":"</xsl:text>
<xsl:value-of select="./metadata/def.identifier/identifier[@type='other']" />
<xsl:text>"}</xsl:text>
</xsl:if>
<xsl:text>}]</xsl:text>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
Markdown is supported
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