Skip to content
Snippets Groups Projects
Commit 95d8001f authored by Martin de la Iglesia's avatar Martin de la Iglesia
Browse files

TGN-Dateipfad neu. +1 doc-available für GND

parent f23c565f
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Dieses Stylesheet erzeugt aus den TEI/XML-Dateien des Orts- und des Objektregisters eine KML-Datei, die diejenigen Orte und Objekte auflistet und mit dem jeweiligen Register verlinkt, zu denen Geokoordinaten in einer externen Quelle (GeoNames, Getty Thesaurus of Geographic Names, GND, Wikidata) vorhanden sind. Die resultierende KML-Datei kann in den DARIAH Geo-Browser eingebunden werden, um die Punkte auf einer Karte darzustellen: https://hainhofer.hab.de/register/kartenansicht-zum-ortsregister <!-- Dieses Stylesheet erzeugt aus den TEI/XML-Dateien des Orts- und des Objektregisters eine KML-Datei, die diejenigen Orte und Objekte auflistet und mit dem jeweiligen Register verlinkt, zu denen Geokoordinaten in einer externen Quelle (GeoNames, Getty Thesaurus of Geographic Names, GND, Wikidata) vorhanden sind. Die resultierende KML-Datei kann in den DARIAH Geo-Browser eingebunden werden, um die Punkte auf einer Karte darzustellen: https://hainhofer.hab.de/register/kartenansicht-zum-ortsregister
Transformationsdauer via VPN ca. 45 Minuten! --> Transformationsdauer via VPN ca. 45 Minuten! -->
<xsl:stylesheet xmlns:geo="http://www.opengis.net/ont/geosparql#" xmlns:gndo="http://d-nb.info/standards/elementset/gnd#" xmlns:ps="http://www.wikidata.org/prop/statement/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:wgs="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:wgs84_pos="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:wdt="http://www.wikidata.org/prop/direct/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:owl="http://www.w3.org/2002/07/owl#" version="2.0"> <xsl:stylesheet xmlns:geo="http://www.opengis.net/ont/geosparql#" xmlns:gndo="http://d-nb.info/standards/elementset/gnd#" xmlns:ps="http://www.wikidata.org/prop/statement/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:wgs="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:wgs84_pos="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:wdt="http://www.wikidata.org/prop/direct/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:owl="http://www.w3.org/2002/07/owl#" version="2.0">
<xsl:variable name="plcpath">https://hainhofer.hab.de/register/orte/</xsl:variable> <xsl:variable name="plcpath">https://hainhofer.hab.de/register/orte/</xsl:variable>
...@@ -37,32 +37,36 @@ Transformationsdauer via VPN ca. 45 Minuten! --> ...@@ -37,32 +37,36 @@ Transformationsdauer via VPN ca. 45 Minuten! -->
</xsl:when> </xsl:when>
<xsl:when test="tei:idno[@type = 'URI'][contains(., 'd-nb.info')]"> <xsl:when test="tei:idno[@type = 'URI'][contains(., 'd-nb.info')]">
<xsl:variable name="uri" select="tei:idno[@type = 'URI'][contains(., 'd-nb.info')][not(preceding-sibling::tei:idno[@type = 'URI'][contains(., 'd-nb.info')])]"/> <xsl:variable name="uri" select="tei:idno[@type = 'URI'][contains(., 'd-nb.info')][not(preceding-sibling::tei:idno[@type = 'URI'][contains(., 'd-nb.info')])]"/>
<xsl:variable name="rdfurl" select="concat($uri,'/about/lds.rdf')"/> <xsl:variable name="rdfurl" select="concat($uri,'/about/lds.rdf')"/>
<xsl:variable name="lat" select="substring-before(substring-after(substring-after(document($rdfurl)//geo:asWKT[not(preceding::geo:asWKT)],'Point ( +'), ' +'),' )')"/> <xsl:if test="doc-available($rdfurl)">
<xsl:variable name="long" select="substring-before(substring-after(document($rdfurl)//geo:asWKT[not(preceding::geo:asWKT)],'Point ( +'), ' +')"/> <xsl:variable name="lat" select="substring-before(substring-after(substring-after(document($rdfurl)//geo:asWKT[not(preceding::geo:asWKT)],'Point ( +'), ' +'),' )')"/>
<xsl:choose> <xsl:variable name="long" select="substring-before(substring-after(document($rdfurl)//geo:asWKT[not(preceding::geo:asWKT)],'Point ( +'), ' +')"/>
<xsl:when test="($lat ne '') and ($long ne '')"> <xsl:choose>
<xsl:call-template name="output_wrk"> <xsl:when test="($lat ne '') and ($long ne '')">
<xsl:with-param name="placeid" select="@xml:id"/>
<xsl:with-param name="uri" select="$uri"/>
<xsl:with-param name="lat" select="$lat"/>
<xsl:with-param name="long" select="$long"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="wdurl" select="concat('https://www.wikidata.org/wiki/Special:EntityData/Q',substring-after(document($rdfurl)//owl:sameAs[contains(./@rdf:resource, 'wikidata')]/@rdf:resource,'/Q'),'.rdf')"/>
<xsl:variable name="lat" select="substring-before(substring-after(substring-after(document($wdurl)//ps:P625[not(preceding::ps:P625)],'Point('), ' '),')')"/>
<xsl:variable name="long" select="substring-before(substring-after(document($wdurl)//ps:P625[not(preceding::ps:P625)],'Point('), ' ')"/>
<xsl:if test="($lat ne '') and ($long ne '')">
<xsl:call-template name="output_wrk"> <xsl:call-template name="output_wrk">
<xsl:with-param name="placeid" select="@xml:id"/> <xsl:with-param name="placeid" select="@xml:id"/>
<xsl:with-param name="uri" select="substring-before($wdurl,'.rdf')"/> <xsl:with-param name="uri" select="$uri"/>
<xsl:with-param name="lat" select="$lat"/> <xsl:with-param name="lat" select="$lat"/>
<xsl:with-param name="long" select="$long"/> <xsl:with-param name="long" select="$long"/>
</xsl:call-template> </xsl:call-template>
</xsl:if> </xsl:when>
</xsl:otherwise> <xsl:otherwise>
</xsl:choose> <xsl:variable name="wdurl" select="concat('https://www.wikidata.org/wiki/Special:EntityData/Q',substring-after(document($rdfurl)//owl:sameAs[contains(./@rdf:resource, 'wikidata')]/@rdf:resource,'/Q'),'.rdf')"/>
<xsl:if test="doc-available($wdurl)">
<xsl:variable name="lat" select="substring-before(substring-after(substring-after(document($wdurl)//ps:P625[not(preceding::ps:P625)],'Point('), ' '),')')"/>
<xsl:variable name="long" select="substring-before(substring-after(document($wdurl)//ps:P625[not(preceding::ps:P625)],'Point('), ' ')"/>
<xsl:if test="($lat ne '') and ($long ne '')">
<xsl:call-template name="output_wrk">
<xsl:with-param name="placeid" select="@xml:id"/>
<xsl:with-param name="uri" select="substring-before($wdurl,'.rdf')"/>
<xsl:with-param name="lat" select="$lat"/>
<xsl:with-param name="long" select="$long"/>
</xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:when> </xsl:when>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
...@@ -86,7 +90,7 @@ Transformationsdauer via VPN ca. 45 Minuten! --> ...@@ -86,7 +90,7 @@ Transformationsdauer via VPN ca. 45 Minuten! -->
</xsl:when> </xsl:when>
<xsl:when test="tei:idno[@type = 'URI'][contains(., 'vocab.getty.edu/tgn')]"> <xsl:when test="tei:idno[@type = 'URI'][contains(., 'vocab.getty.edu/tgn')]">
<xsl:variable name="uri" select="tei:idno[@type = 'URI'][contains(., 'vocab.getty.edu/tgn')][not(preceding-sibling::tei:idno[@type = 'URI'][contains(., 'vocab.getty.edu/tgn')])]"/> <xsl:variable name="uri" select="tei:idno[@type = 'URI'][contains(., 'vocab.getty.edu/tgn')][not(preceding-sibling::tei:idno[@type = 'URI'][contains(., 'vocab.getty.edu/tgn')])]"/>
<xsl:variable name="rdfurl" select="concat($uri,'.rdf')"/> <xsl:variable name="rdfurl" select="concat('http://vocab.getty.edu/download/rdf?uri=',$uri,'.rdf')"/>
<xsl:if test="doc-available($rdfurl)"> <xsl:if test="doc-available($rdfurl)">
<xsl:variable name="lat" select="document($rdfurl)//wgs:lat"/> <xsl:variable name="lat" select="document($rdfurl)//wgs:lat"/>
<xsl:variable name="long" select="document($rdfurl)//wgs:long"/> <xsl:variable name="long" select="document($rdfurl)//wgs:long"/>
...@@ -102,35 +106,37 @@ Transformationsdauer via VPN ca. 45 Minuten! --> ...@@ -102,35 +106,37 @@ Transformationsdauer via VPN ca. 45 Minuten! -->
</xsl:when> </xsl:when>
<xsl:when test="tei:idno[@type = 'URI'][contains(., 'd-nb.info')]"> <xsl:when test="tei:idno[@type = 'URI'][contains(., 'd-nb.info')]">
<xsl:variable name="uri" select="tei:idno[@type = 'URI'][contains(., 'd-nb.info')][not(preceding-sibling::tei:idno[@type = 'URI'][contains(., 'd-nb.info')])]"/> <xsl:variable name="uri" select="tei:idno[@type = 'URI'][contains(., 'd-nb.info')][not(preceding-sibling::tei:idno[@type = 'URI'][contains(., 'd-nb.info')])]"/>
<xsl:variable name="rdfurl" select="concat($uri,'/about/lds.rdf')"/> <xsl:variable name="rdfurl" select="concat($uri,'/about/lds.rdf')"/>
<xsl:variable name="lat" select="substring-before(substring-after(substring-after(document($rdfurl)//geo:asWKT[not(preceding::geo:asWKT)],'Point ( +'), ' +'),' )')"/> <xsl:if test="doc-available($rdfurl)">
<xsl:variable name="long" select="substring-before(substring-after(document($rdfurl)//geo:asWKT[not(preceding::geo:asWKT)],'Point ( +'), ' +')"/> <xsl:variable name="lat" select="substring-before(substring-after(substring-after(document($rdfurl)//geo:asWKT[not(preceding::geo:asWKT)],'Point ( +'), ' +'),' )')"/>
<xsl:choose> <xsl:variable name="long" select="substring-before(substring-after(document($rdfurl)//geo:asWKT[not(preceding::geo:asWKT)],'Point ( +'), ' +')"/>
<xsl:when test="($lat ne '') and ($long ne '')"> <xsl:choose>
<xsl:call-template name="output"> <xsl:when test="($lat ne '') and ($long ne '')">
<xsl:with-param name="placeid" select="@xml:id"/> <xsl:call-template name="output">
<xsl:with-param name="uri" select="$uri"/> <xsl:with-param name="placeid" select="@xml:id"/>
<xsl:with-param name="lat" select="$lat"/> <xsl:with-param name="uri" select="$uri"/>
<xsl:with-param name="long" select="$long"/> <xsl:with-param name="lat" select="$lat"/>
</xsl:call-template> <xsl:with-param name="long" select="$long"/>
</xsl:when> </xsl:call-template>
<xsl:otherwise> </xsl:when>
<xsl:variable name="wdurl" select="concat('https://www.wikidata.org/wiki/Special:EntityData/Q',substring-after(document($rdfurl)//owl:sameAs[contains(./@rdf:resource, 'wikidata')]/@rdf:resource,'/Q'),'.rdf')"/> <xsl:otherwise>
<xsl:if test="doc-available($wdurl)"> <xsl:variable name="wdurl" select="concat('https://www.wikidata.org/wiki/Special:EntityData/Q',substring-after(document($rdfurl)//owl:sameAs[contains(./@rdf:resource, 'wikidata')]/@rdf:resource,'/Q'),'.rdf')"/>
<xsl:variable name="lat" select="substring-before(substring-after(substring-after(document($wdurl)//ps:P625[not(preceding::ps:P625)],'Point('), ' '),')')"/> <xsl:if test="doc-available($wdurl)">
<xsl:variable name="long" select="substring-before(substring-after(document($wdurl)//ps:P625[not(preceding::ps:P625)],'Point('), ' ')"/> <xsl:variable name="lat" select="substring-before(substring-after(substring-after(document($wdurl)//ps:P625[not(preceding::ps:P625)],'Point('), ' '),')')"/>
<xsl:if test="($lat ne '') and ($long ne '')"> <xsl:variable name="long" select="substring-before(substring-after(document($wdurl)//ps:P625[not(preceding::ps:P625)],'Point('), ' ')"/>
<xsl:if test="($lat ne '') and ($long ne '')">
<xsl:call-template name="output">
<xsl:with-param name="placeid" select="@xml:id"/> <xsl:call-template name="output">
<xsl:with-param name="uri" select="substring-before($wdurl,'.rdf')"/> <xsl:with-param name="placeid" select="@xml:id"/>
<xsl:with-param name="lat" select="$lat"/> <xsl:with-param name="uri" select="substring-before($wdurl,'.rdf')"/>
<xsl:with-param name="long" select="$long"/> <xsl:with-param name="lat" select="$lat"/>
</xsl:call-template> <xsl:with-param name="long" select="$long"/>
</xsl:call-template>
</xsl:if>
</xsl:if> </xsl:if>
</xsl:if> </xsl:otherwise>
</xsl:otherwise> </xsl:choose>
</xsl:choose> </xsl:if>
</xsl:when> </xsl:when>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment