| XML schema |
http://dd.eionet.europa.eu/schemas/habitatsdirective/art17_species.xsd
|
|---|---|
| Output type | RDF |
| Description | RDF output |
| XSL file | species-rdf-2018.xsl (Last modified: 18 Mar 2019 16:17 ) |
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: habitats_species-rdf.xsl 14357 2013-07-04 13:06:46Z roug $ -->
<!DOCTYPE xsl:stylesheet [
<!ENTITY biogeo "http://rdfdata.eionet.europa.eu/eea/biogeographic-regions/">
<!ENTITY countries "http://rdfdata.eionet.europa.eu/eea/countries/">
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">
<!ENTITY asmnt "http://dd.eionet.europa.eu/vocabulary/art17_2018/assessments/">
<!ENTITY umethod "http://dd.eionet.europa.eu/vocabulary/art17_2018/methodsUsed/">
<!ENTITY trend "http://dd.eionet.europa.eu/vocabulary/art17_2018/trends/">
<!ENTITY ctrend "http://dd.eionet.europa.eu/vocabulary/art17_2018/trendsConclusion/">
<!ENTITY measures "http://dd.eionet.europa.eu/vocabulary/art17_2018/measures/">
<!ENTITY imeasures "http://dd.eionet.europa.eu/vocabulary/art17_2018/measuresIdentified/">
<!ENTITY lmeasures "http://dd.eionet.europa.eu/vocabulary/art17_2018/measuresLocation/">
<!ENTITY phmeasures "http://dd.eionet.europa.eu/vocabulary/art17_2018/measuresPurposeHabitats/">
<!ENTITY psmeasures "http://dd.eionet.europa.eu/vocabulary/art17_2018/measuresPurposeSpecies/">
<!ENTITY rmeasures "http://dd.eionet.europa.eu/vocabulary/art17_2018/measuresResponse/">
<!ENTITY punit "http://dd.eionet.europa.eu/vocabulary/art17_2018/populationUnits/">
<!ENTITY estimate "http://dd.eionet.europa.eu/vocabulary/art17_2018/typeEstimate/">
<!ENTITY prospect "http://dd.eionet.europa.eu/vocabulary/art17_2018/prospects/">
<!ENTITY foperator "http://dd.eionet.europa.eu/vocabulary/art17_2018/favourableOperator/">
<!ENTITY yesnounk "http://dd.eionet.europa.eu/vocabulary/art17_2018/yesNoUnknown/">
<!ENTITY rchange "http://dd.eionet.europa.eu/vocabulary/art17_2018/reasonChange/">
]>
<xsl:stylesheet version="1.0"
xmlns="http://rdfdata.eionet.europa.eu/article17/ontology/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:l="http://biodiversity.eionet.europa.eu/art17dataflow">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="habitat_reports|species_reports">
<rdf:RDF>
<!-- <xsl:attribute name="xml:lang"><xsl:value-of select="@xml:lang"/></xsl:attribute> -->
<xsl:apply-templates/>
</rdf:RDF>
</xsl:template>
<xsl:template match="habitat_report">
<HabitatTypeReport>
<xsl:attribute name="rdf:about">#<xsl:value-of select="habitatcode"/></xsl:attribute>
<rdfs:label>Habitats directive art. 17 report for habitat type <xsl:value-of select="habitatcode"/> in <xsl:value-of select="country/@desc"/></rdfs:label>
<xsl:apply-templates/>
</HabitatTypeReport>
</xsl:template>
<xsl:template match="species_report">
<SpeciesReport>
<xsl:attribute name="rdf:about">#<xsl:value-of select="speciescode"/></xsl:attribute>
<rdfs:label>Habitat Directive Art. 17 report on <xsl:value-of select="speciesname"/> in <xsl:value-of select="country/@desc"/></rdfs:label>
<xsl:apply-templates/>
</SpeciesReport>
</xsl:template>
<xsl:template match="regional">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="habitat_report/regional/region">
<hasRegionalReport>
<HabitatTypeRegionalReport>
<xsl:attribute name="rdf:about">#<xsl:value-of select="code"/><xsl:value-of select="../../habitatcode"/></xsl:attribute>
<rdfs:label>Report on habitat type <xsl:value-of select="../../habitatcode"/> for <xsl:value-of select="code"/> biogeographical region in <xsl:value-of select="../../country/@desc"/></rdfs:label>
<forCountry>
<xsl:attribute name="rdf:resource">&countries;<xsl:value-of select="../../country/@isocode"/></xsl:attribute>
</forCountry>
<memberstate>
<xsl:value-of select="../../country/@desc"/>
</memberstate>
<habitatcode>
<xsl:value-of select="../../habitatcode"/>
</habitatcode>
<region>
<xsl:attribute name="rdf:resource">&biogeo;<xsl:value-of select="code"/></xsl:attribute>
</region>
<xsl:apply-templates/>
</HabitatTypeRegionalReport>
</hasRegionalReport>
</xsl:template>
<xsl:template match="species_report/regional/region">
<hasRegionalReport>
<SpeciesRegionalReport>
<xsl:attribute name="rdf:about">#<xsl:value-of select="code"/><xsl:value-of select="../../speciescode"/></xsl:attribute>
<rdfs:label>Report on species <xsl:value-of select="../../speciescode"/> for <xsl:value-of select="code"/> biogeographical region in <xsl:value-of select="../../country/@desc"/></rdfs:label>
<forCountry>
<xsl:attribute name="rdf:resource">&countries;<xsl:value-of select="../../country/@isocode"/></xsl:attribute>
</forCountry>
<memberstate>
<xsl:value-of select="../../country/@desc"/>
</memberstate>
<speciescode>
<xsl:value-of select="../../speciescode"/>
</speciescode>
<speciesname>
<xsl:value-of select="../../speciesname"/>
</speciesname>
<region>
<xsl:attribute name="rdf:resource">&biogeo;<xsl:value-of select="code"/></xsl:attribute>
</region>
<xsl:apply-templates/>
</SpeciesRegionalReport>
</hasRegionalReport>
</xsl:template>
<!-- Country reference -->
<xsl:template match="country">
<xsl:element name="{local-name()}">
<xsl:attribute name="rdf:resource">&countries;<xsl:value-of select="@isocode"/></xsl:attribute>
</xsl:element>
</xsl:template>
<!-- Boolean properties -->
<xsl:template match="distribution_map|additional_distribution_map|typical_species_change|
measures_needed|no_change|genuine|knowledge|method|no_info|
sensitive_species|wild_takings|measures_access|measures_prohibitions|measures_periods|
measures_rules|measures_licences|measures_trading_legislation|measures_conservation_propagation|
measures_other|huntingbag_y1_unknown|huntingbag_y2_unknown|huntingbag_y3_unknown|huntingbag_y4_unknown|
huntingbag_y5_unknown|huntingbag_y6_unknown">
<xsl:element name="{local-name()}">
<xsl:attribute name="rdf:datatype">&xsd;boolean</xsl:attribute>
<xsl:value-of select="."/></xsl:element>
</xsl:template>
<!-- Assessments -->
<xsl:template match="conclusion_range|conclusion_area|conclusion_structure|conclusion_future|conclusion_assessment|
conclusion_population|conclusion_habitat">
<xsl:if test="normalize-space(text()) != ''">
<xsl:element name="{local-name()}">
<xsl:attribute name="rdf:resource">&asmnt;<xsl:value-of select="normalize-space(text())"/></xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:template>
<!-- Method used -->
<xsl:template match="distribution_method|range_trend_method|range_trend_long_method|
coverage_method|coverage_trend_method|coverage_trend_long_method|hab_condition_method|
hab_condition_trend_method|natura2000_area_method|natura2000_area_trend_method|
huntingbag_method|population_method|population_trend_method|population_trend_long_method|
habitat_sufficiency_method|habitat_trend_method|habitat_trend_long_method|
natura2000_population_method|natura2000_population_trend_method">
<xsl:if test="normalize-space(text()) != ''">
<xsl:element name="{local-name()}">
<xsl:attribute name="rdf:resource">&umethod;<xsl:value-of select="normalize-space(text())"/></xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:template>
<!-- Population units -->
<xsl:template match="huntingbag_unit|population_size_unit|population_alt_size_unit|complementary_favourable_population_unit|natura2000_population_unit">
<xsl:if test="normalize-space(text()) != ''">
<xsl:element name="{local-name()}">
<xsl:attribute name="rdf:resource">&punit;<xsl:value-of select="normalize-space(text())"/></xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:template>
<!-- Type of estimate -->
<xsl:template match="coverage_estimate_type|natura2000_area_estimate_type|population_estimate_type|population_alt_estimate_type|natura2000_population_estimate_type">
<xsl:if test="normalize-space(text()) != ''">
<xsl:element name="{local-name()}">
<xsl:attribute name="rdf:resource">&estimate;<xsl:value-of select="normalize-space(text())"/></xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:template>
<!-- Prospect -->
<xsl:template match="future_range|future_area|future_structure|future_population|future_habitat">
<xsl:if test="normalize-space(text()) != ''">
<xsl:element name="{local-name()}">
<xsl:attribute name="rdf:resource">&prospect;<xsl:value-of select="normalize-space(text())"/></xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:template>
<!-- Measures identified -->
<xsl:template match="measures_status">
<xsl:if test="normalize-space(text()) != ''">
<xsl:element name="{local-name()}">
<xsl:attribute name="rdf:resource">&imeasures;<xsl:value-of select="normalize-space(text())"/></xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:template>
<!-- Measures location -->
<xsl:template match="measures_location">
<xsl:if test="normalize-space(text()) != ''">
<xsl:element name="{local-name()}">
<xsl:attribute name="rdf:resource">&lmeasures;<xsl:value-of select="normalize-space(text())"/></xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:template>
<!-- Measures purpose for habitats -->
<xsl:template match="habitat_report/regional/region/conservation_measures/measures_purpose">
<xsl:if test="normalize-space(text()) != ''">
<xsl:element name="{local-name()}">
<xsl:attribute name="rdf:resource">&phmeasures;<xsl:value-of select="normalize-space(text())"/></xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:template>
<!-- Measures purpose for species -->
<xsl:template match="species_report/regional/region/conservation_measures/measures_purpose">
<xsl:if test="normalize-space(text()) != ''">
<xsl:element name="{local-name()}">
<xsl:attribute name="rdf:resource">&psmeasures;<xsl:value-of select="normalize-space(text())"/></xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:template>
<!-- Measures response -->
<xsl:template match="measures_response">
<xsl:if test="normalize-space(text()) != ''">
<xsl:element name="{local-name()}">
<xsl:attribute name="rdf:resource">&rmeasures;<xsl:value-of select="normalize-space(text())"/></xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:template>
<!-- Favourable operator -->
<xsl:template match="complementary_favourable_range_op|complementary_favourable_area_op|complementary_favourable_population_op">
<xsl:if test="normalize-space(text()) != ''">
<xsl:element name="{local-name()}">
<xsl:attribute name="rdf:resource">&foperator;<xsl:value-of select="normalize-space(text())"/></xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:template>
<xsl:template match="habitat_sufficiency_occupied|habitat_sufficiency_unoccupied">
<xsl:if test="normalize-space(text()) != ''">
<xsl:element name="{local-name()}">
<xsl:attribute name="rdf:resource">&yesnounk;<xsl:value-of select="normalize-space(text())"/></xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:template>
<xsl:template match="ranking">
<xsl:if test="normalize-space(text()) != ''">
<xsl:call-template name="one-resource-predicate">
<xsl:with-param name="text" select="text()"/>
<xsl:with-param name="table" select="local-name(.)"/>
<xsl:with-param name="predicate" select="local-name(.)"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- Trend -->
<xsl:template match="range_trend|range_trend_long|coverage_trend|coverage_trend_long|
hab_condition_trend|natura2000_area_trend|population_trend|population_trend_long|
habitat_trend|habitat_trend_long|natura2000_area_trend|natura2000_population_trend">
<xsl:if test="normalize-space(text()) != ''">
<xsl:element name="{local-name()}">
<xsl:attribute name="rdf:resource">&trend;<xsl:value-of select="normalize-space(text())"/></xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:template>
<!-- Conclusion trend -->
<xsl:template match="conclusion_assessment_trend">
<xsl:if test="normalize-space(text()) != ''">
<xsl:element name="{local-name()}">
<xsl:attribute name="rdf:resource">&ctrend;<xsl:value-of select="normalize-space(text())"/></xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:template>
<!-- reason change -->
<xsl:template match="main_reason">
<xsl:if test="normalize-space(text()) != ''">
<xsl:element name="{local-name()}">
<xsl:attribute name="rdf:resource">&rchange;<xsl:value-of select="normalize-space(text())"/></xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:template>
<xsl:template match="range_reasons_for_change|area_reasons_for_change|status_reasons_for_change|trend_reasons_for_change|population_reasons_for_change">
<xsl:element name="{local-name()}">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="pressures|threats|measures|data_pressures_threats_info|conservation_measures|annexV_species">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="pressure|threat">
<xsl:element name="{local-name()}">
<xsl:attribute name="rdf:parseType">Resource</xsl:attribute>
<rdfs:label><xsl:value-of select="code/@desc"/></rdfs:label>
<xsl:call-template name="one-resource-predicate">
<xsl:with-param name="text" select="code"/>
<xsl:with-param name="table" select="'threats'"/>
<xsl:with-param name="predicate" select="'forPressureThreat'"/>
</xsl:call-template>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<!-- TODO check if measures will be added to rdfdata -->
<xsl:template match="measure">
<measure>
<xsl:attribute name="rdf:parseType">Resource</xsl:attribute>
<rdfs:label><xsl:value-of select="code/@desc"/></rdfs:label>
<xsl:call-template name="one-resource-predicate">
<xsl:with-param name="text" select="code"/>
<xsl:with-param name="table" select="local-name(parent::*)"/>
<xsl:with-param name="predicate" select="'forMeasure'"/>
</xsl:call-template>
<xsl:apply-templates/>
</measure>
</xsl:template>
<xsl:template name="one-resource-predicate">
<xsl:param name="text"/>
<xsl:param name="predicate"/>
<xsl:param name="table"/>
<xsl:if test="string-length($text) != 0">
<xsl:element name="{$predicate}">
<xsl:attribute name="rdf:resource">http://dd.eionet.europa.eu/vocabulary/art17_2018/<xsl:value-of
select="$table" />/<xsl:value-of select="$text"/></xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:template>
<xsl:template name="break-at-newlines">
<xsl:param name="text"/>
<xsl:param name="predicate"/>
<xsl:choose>
<xsl:when test="contains($text, ' ')">
<xsl:call-template name="one-literal-predicate">
<xsl:with-param name="text" select="substring-before($text, ' ')" />
<xsl:with-param name="predicate" select="$predicate"/>
</xsl:call-template>
<xsl:call-template name="break-at-newlines">
<xsl:with-param name="text" select="substring-after($text, ' ')" />
<xsl:with-param name="predicate" select="$predicate"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$text=''"/>
<xsl:otherwise>
<xsl:call-template name="one-literal-predicate">
<xsl:with-param name="text" select="$text"/>
<xsl:with-param name="predicate" select="$predicate"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="one-literal-predicate">
<xsl:param name="text"/>
<xsl:param name="predicate"/>
<xsl:element name="{$predicate}">
<xsl:value-of select="$text"/>
</xsl:element>
</xsl:template>
<!-- Drop text nodes incl. whitespace -->
<xsl:template match="text()"/>
<xsl:template match="*">
<xsl:if test="normalize-space(text()) != ''">
<xsl:element name="{local-name()}"><xsl:value-of select="."/></xsl:element>
</xsl:if>
</xsl:template>
<xsl:template name="code-name">
<xsl:param name="text" select="code/@desc"/>
<xsl:param name="predicate" select="concat(name(.) ,'name')"/>
<xsl:call-template name="one-literal-predicate">
<xsl:with-param name="text" select="$text"/>
<xsl:with-param name="predicate" select="$predicate"/>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>
European Environment Agency
Kgs. Nytorv 6, DK-1050 Copenhagen K, Denmark