<commit_before><?xml version="1.0"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at
    
    http://www.apache.org/licenses/LICENSE-2.0
    
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<xsl:stylesheet version="1.0"
    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:dc="http://purl.org/dc/elements/1.1/"
    xmlns:foaf="http://xmlns.com/foaf/0.1/"
    xmlns:wot="http://xmlns.com/wot/0.1/"
    exclude-result-prefixes="rdf dc foaf">

    <xsl:template match="/">
        <document>
            <xsl:call-template name="header" />
            <body>
                <xsl:apply-templates select="rdf:RDF/foaf:Person" />
            </body>
        </document>
    </xsl:template>

    <xsl:template match="foaf:Person">
        <section>
            <title>
                <xsl:value-of select="foaf:name" />
            </title>

            <xsl:apply-templates select="foaf:depiction/@rdf:resource" />

                <table>
                    <tr>
                        <th>Property</th>
                        <th>Value</th>
                    </tr>
                    <tr>
                        <td>Name</td>
                        <td>
                            <xsl:choose>
                                <xsl:when test="foaf:name">
                                    <xsl:value-of select="foaf:name" />
                                </xsl:when>
                                <xsl:otherwise>
                                    <xsl:value-of
                                        select="foaf:firstName" />
                                    <xsl:text></xsl:text>
                                    <xsl:value-of select="foaf:surname" />
                                </xsl:otherwise>
                            </xsl:choose>
                        </td>
                    </tr>

                    <tr>
                        <td>Mbox</td>
                        <xsl:choose>
                            <xsl:when test="foaf:mbox_sha1sum">
                                <td>
                                    <xsl:value-of
                                        select="foaf:mbox_sha1sum" />
                                </td>
                            </xsl:when>
                            <xsl:otherwise>
                                <td>
                                    <a
                                        href="{foaf:mbox/@rdf:resource}">
                                        <xsl:value-of
                                            select="foaf:mbox/@rdf:resource" />
                                    </a>
                                </td>
                            </xsl:otherwise>
                        </xsl:choose>
                    </tr>
                    
                    <xsl:apply-templates select="*[not(local-name(.) = 'knows')]"/>
                </table>
                    
                <xsl:if test="foaf:knows">
                  <section>
                    <title>Knows</title>
                    <table>
                      <xsl:apply-templates select="foaf:knows"/>
                    </table>
                  </section>
                </xsl:if>

        </section>
    </xsl:template>

    <xsl:template name="header">
        <header>
            <title>Person details</title>
        </header>
    </xsl:template>

    <xsl:template match="foaf:currentProject">
            <tr>
                <td>
                    <xsl:value-of select="./@dc:title" />
                </td>
                <td>
                    <a href="{./@rdf:resource}">
                        <xsl:value-of select="./@rdf:resource" />
                    </a>
                </td>
                <td>
                    <xsl:value-of select="./@rdfs:comment" />
                </td>
            </tr>
    </xsl:template>

    <xsl:template match="foaf:publications">
            <tr><commit_msg>Tidier handling of some elements<commit_after><?xml version="1.0"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at
    
    http://www.apache.org/licenses/LICENSE-2.0
    
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<xsl:stylesheet version="1.0"
    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:dc="http://purl.org/dc/elements/1.1/"
    xmlns:foaf="http://xmlns.com/foaf/0.1/"
    xmlns:wot="http://xmlns.com/wot/0.1/"
    exclude-result-prefixes="rdf dc foaf">

    <xsl:template match="/">
        <document>
            <xsl:call-template name="header" />
            <body>
                <xsl:apply-templates select="rdf:RDF/foaf:Person" />
            </body>
        </document>
    </xsl:template>

    <xsl:template match="foaf:Person">
        <section>
            <title>
                <xsl:value-of select="foaf:name" />
            </title>

            <xsl:apply-templates select="foaf:depiction/@rdf:resource" />

                <table>
                    <tr>
                        <th>Property</th>
                        <th>Value</th>
                    </tr>    
                    <tr>
                        <td>Name</td>
                        <td>
                            <xsl:choose>
                                <xsl:when test="foaf:name">
                                    <xsl:value-of select="foaf:name" />
                                </xsl:when>
                                <xsl:otherwise>
                                    <xsl:value-of
                                        select="foaf:firstName" />
                                    <xsl:text></xsl:text>
                                    <xsl:value-of select="foaf:surname" />
                                </xsl:otherwise>
                            </xsl:choose>
                        </td>
                    </tr>
                    
                    <xsl:apply-templates select="*[not(local-name(.) = 'knows')]"/>
                </table>
                    
                <xsl:if test="foaf:knows">
                  <section>
                    <title>Knows</title>
                    <table>
                      <xsl:apply-templates select="foaf:knows"/>
                    </table>
                  </section>
                </xsl:if>

        </section>
    </xsl:template>

    <xsl:template name="header">
        <header>
            <title>Person details</title>
        </header>
    </xsl:template>
    
    <xsl:template match="foaf:name">
    </xsl:template>
    
    <xsl:template match="foaf:firstname">
    </xsl:template>
    
    <xsl:template match="foaf:surname">
    </xsl:template>

    <xsl:template match="foaf:mbox_sha1sum">
        <tr>
            <td>Mbox SH1Sum</td>
            <td>
                <xsl:value-of select="." />
            </td>
        </tr>
    </xsl:template>

    <xsl:template match="foaf:mbox">
        <tr>
            <td>Mbox</td>
            <td>
                <a href="{@rdf:resource}">
                    <xsl:value-of select="@rdf:resource" />
                </a>
            </td>
        </tr>
    </xsl:template>

    <xsl:template match="foaf:currentProject">
            <tr>
                <td>
                    <xsl:value-of select="./@dc:title" />
                </td>
                <td>
                    <a href="{./@rdf:resource}">
                        <xsl:value-of select="./@rdf:resource" />
                    </a>
                </td>
                <td>
                    <xsl:value-of select="./@rdfs:comment" />
                </td>
            </tr>
    </xsl:template>

    <xsl:template match="foaf:publications">
            <tr>
{'fraction_non_alphanumeric': 0.12546286212154215, 'fraction_numerical': 0.008059246351557395, 'mean_word_length': 1.103298213467705, 'pattern_counts': {'":': 0, '<': 201, '<?xml version=': 2, '>': 201, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, 'xml': 18}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1924409', 'n_tokens_mistral': 2639, 'n_tokens_neox': 2385, 'n_words': 487}