<commit_before><?xml version="1.0" encoding="UTF-8"?>

<metamorph xmlns="http://www.culturegraph.org/metamorph" version="1">


    <macros>

        <macro name="viaf-literal">
            <entity name="$[abbrev]{}" flushWith="$[predicate]">
                <data source="$[predicate]" name="@value">
                    <regexp match='"(.*?)"' format="${1}"/>
                </data>
                <data source="$[predicate]" name="@language">
                    <regexp match='"@(.*)$' format="${1}"/>
                </data>
                <data source="$[predicate]" name="@type">
                    <regexp match='"\^\^.(.*).$' format="${1}"/>
                </data>
            </entity>
        </macro>

        <macro name="date-shortener">
            <choose>
                <data source="$[predicate]" name="$[abbrev]">
                    <regexp match='"\d\d\d\d"'/>
                </data>
                <data source="$[predicate]" name="$[abbrev]">
                    <regexp match='"(\d\d\d\d)-\d\d-\d\d"' format="${1}"/>
                </data>
            </choose>
        </macro>

        <macro name="person-literal">
            <data source="$[predicate]" name="$[abbrev]">
                <regexp match='"(.*)"|(.*)' format="${1}"/>
            </data>
        </macro>

        <macro name="dbpedia-uri">
            <entity name="$[abbrev]{}" flushWith="$[predicate]">
                <data source="$[predicate]" name="@id"/>
            </entity>
        </macro>

        <macro name="language-tag">
            <entity name="$[abbrev]{}" flushWith="$[predicate]">
                <combine name="${lang}" value="${value}" flushWith="$[predicate]">
                    <data name="value" source="$[predicate]">
                        <regexp match='"(.*)"' format="${1}"/>
                    </data>
                    <data name="lang" source="$[predicate]">
                        <regexp match='.*"@(.*) *$' format="${1}"/>
                    </data>
                </combine>
            </entity>
        </macro>

    </macros>


    <rules>

        <data source="_id" name="\@id"/>
        <data source="_id" name="id">
            <replace pattern="http://viaf.org/viaf/" with=""/>
            <replace pattern="http://data.swissbib.ch/person/" with=""/>
        </data>

        <data source="_id" name="@type">
            <constant value="http://xmlns.com/foaf/0.1/Person"/>
        </data>

        <!--REFERENCED JSON-LD CONTEXT-->
        <data source="_id" name="@context">
            <constant value="http://data.swissbib.ch/person/context.jsonld"/>
        </data>

        <!-- VIAF resources -->
        <call-macro name="viaf-literal" abbrev="owl:differentFrom"
                    predicate="http://www.w3.org/2002/07/owl#differentFrom"/>
        <call-macro name="viaf-literal" abbrev="rdf:type" predicate="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"/>
        <call-macro name="viaf-literal" abbrev="schema:sameAs" predicate="http://schema.org/sameAs"/>
        <call-macro name="viaf-literal" abbrev="dc:identifier" predicate="http://purl.org/dc/terms/identifier"/>
        <call-macro name="viaf-literal" abbrev="schema:name" predicate="http://schema.org/name"/>
        <call-macro name="viaf-literal" abbrev="rdf:value"
                    predicate="http://www.w3.org/1999/02/22-rdf-syntax-ns#value"/>
        <call-macro name="viaf-literal" abbrev="schema:gender" predicate="http://schema.org/gender"/>

        <call-macro name="date-shortener" abbrev="schema:birthDate" predicate="http://schema.org/birthDate"/>
        <call-macro name="date-shortener" abbrev="schema:deathDate" predicate="http://schema.org/deathDate"/>
        <call-macro name="date-shortener" abbrev="dbp:birthYear" predicate="http://dbpedia.org/ontology/birthYear"/>
        <call-macro name="date-shortener" abbrev="dbp:deathYear" predicate="http://dbpedia.org/ontology/deathYear"/>

        <!-- Person resources -->
        <call-macro name="person-literal" abbrev="skos:note" predicate="http://www.w3.org/2004/02/skos/core#note"/>
        <call-macro name="person-literal" abbrev="foaf:lastName" predicate="http://xmlns.com/foaf/0.1/lastName"/>
        <call-macro name="person-literal" abbrev="foaf:firstName" predicate="http://xmlns.com/foaf/0.1/firstName"/>
        <call-macro name="person-literal" abbrev="rdfs:label" predicate="http://www.w3.org/2000/01/rdf-schema#label"/>
        <call-macro name="person-literal" abbrev="foaf:name" predicate="http://xmlns.com/foaf/0.1/name"/>

        <!-- DBPedia resources -->
        <call-macro name="dbpedia-uri" abbrev="dbp:birthPlace" predicate="http://dbpedia.org/ontology/birthPlace"/>
        <call-macro name="dbpedia-uri" abbrev="dbp:deathPlace" predicate="http://dbpedia.org/ontology/deathPlace"/>
        <call-macro name="dbpedia-uri" abbrev="dbp:genre" predicate="http://dbpedia.org/ontology/genre"/>
        <call-macro name="dbpedia-uri" abbrev="dbp:movement" predicate="http://dbpedia.org/ontology/movement"/>
        <call-macro name="dbpedia-uri" abbrev="dbp:nationality" predicate="http://dbpedia.org/ontology/nationality"/>
        <call-macro name="dbpedia-uri" abbrev="dbp:notableWork" predicate="http://dbpedia.org/ontology/notableWork"/>
        <call-macro name="dbpedia-uri" abbrev="dbp:occupation" predicate="http://dbpedia.org/ontology/occupation"/>
        <call-macro name="dbpedia-uri" abbrev="dbp:thumbnail" predicate="http://dbpedia.org/ontology/thumbnail"/>
        <call-macro name="dbpedia-uri" abbrev="dbp:influencedBy" predicate="http://dbpedia.org/ontology/influencedBy"/>
        <call-macro name="dbpedia-uri" abbrev="dbp:partner" predicate="http://dbpedia.org/ontology/partner"/>
        <call-macro name="dbpedia-uri" abbrev="dbp:spouse" predicate="http://dbpedia.org/ontology/spouse"/>
        <call-macro name="dbpedia-uri" abbrev="dbp:author" predicate="http://dbpedia.org/ontology/author"/>
        <call-macro name="dbpedia-uri" abbrev="dbp:influenced" predicate="http://dbpedia.org/ontology/influenced"/>

        <call-macro name="language-tag" abbrev="dbp:abstract" predicate="http://dbpedia.org/ontology/abstract"/>
        <call-macro name="language-tag" abbrev="dbp:pseudonym" predicate="http://dbpedia.org/ontology/pseudonym"/>
        <call-macro name="language-tag" abbrev="dbp:alternativeNames"
                    predicate="http://dbpedia.org/ontology/alternativeNames"/>

        <data source="owl:sameAs" name="owl:sameAs"/>
        <data source="http://www.w3.org/2002/07/owl#sameAs" name="owl:sameAs"/>
        <data source="http://schema.org/alternateName" name="schema:alternateName"/><commit_msg>dbp:alternativeNames removed<commit_after><?xml version="1.0" encoding="UTF-8"?>

<metamorph xmlns="http://www.culturegraph.org/metamorph" version="1">


    <macros>

        <macro name="viaf-literal">
            <entity name="$[abbrev]{}" flushWith="$[predicate]">
                <data source="$[predicate]" name="@value">
                    <regexp match='"(.*?)"' format="${1}"/>
                </data>
                <data source="$[predicate]" name="@language">
                    <regexp match='"@(.*)$' format="${1}"/>
                </data>
                <data source="$[predicate]" name="@type">
                    <regexp match='"\^\^.(.*).$' format="${1}"/>
                </data>
            </entity>
        </macro>

        <macro name="date-shortener">
            <choose>
                <data source="$[predicate]" name="$[abbrev]">
                    <regexp match='"\d\d\d\d"'/>
                </data>
                <data source="$[predicate]" name="$[abbrev]">
                    <regexp match='"(\d\d\d\d)-\d\d-\d\d"' format="${1}"/>
                </data>
            </choose>
        </macro>

        <macro name="person-literal">
            <data source="$[predicate]" name="$[abbrev]">
                <regexp match='"(.*)"|(.*)' format="${1}"/>
            </data>
        </macro>

        <macro name="dbpedia-uri">
            <entity name="$[abbrev]{}" flushWith="$[predicate]">
                <data source="$[predicate]" name="@id"/>
            </entity>
        </macro>

        <macro name="language-tag">
            <entity name="$[abbrev]{}" flushWith="$[predicate]">
                <combine name="${lang}" value="${value}" flushWith="$[predicate]">
                    <data name="value" source="$[predicate]">
                        <regexp match='"(.*)"' format="${1}"/>
                    </data>
                    <data name="lang" source="$[predicate]">
                        <regexp match='.*"@(.*) *$' format="${1}"/>
                    </data>
                </combine>
            </entity>
        </macro>

    </macros>


    <rules>

        <data source="_id" name="\@id"/>
        <data source="_id" name="id">
            <replace pattern="http://viaf.org/viaf/" with=""/>
            <replace pattern="http://data.swissbib.ch/person/" with=""/>
        </data>

        <data source="_id" name="@type">
            <constant value="http://xmlns.com/foaf/0.1/Person"/>
        </data>

        <!--REFERENCED JSON-LD CONTEXT-->
        <data source="_id" name="@context">
            <constant value="http://data.swissbib.ch/person/context.jsonld"/>
        </data>

        <!-- VIAF resources -->
        <call-macro name="viaf-literal" abbrev="owl:differentFrom"
                    predicate="http://www.w3.org/2002/07/owl#differentFrom"/>
        <call-macro name="viaf-literal" abbrev="rdf:type" predicate="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"/>
        <call-macro name="viaf-literal" abbrev="schema:sameAs" predicate="http://schema.org/sameAs"/>
        <call-macro name="viaf-literal" abbrev="dc:identifier" predicate="http://purl.org/dc/terms/identifier"/>
        <call-macro name="viaf-literal" abbrev="schema:name" predicate="http://schema.org/name"/>
        <call-macro name="viaf-literal" abbrev="rdf:value"
                    predicate="http://www.w3.org/1999/02/22-rdf-syntax-ns#value"/>
        <call-macro name="viaf-literal" abbrev="schema:gender" predicate="http://schema.org/gender"/>

        <call-macro name="date-shortener" abbrev="schema:birthDate" predicate="http://schema.org/birthDate"/>
        <call-macro name="date-shortener" abbrev="schema:deathDate" predicate="http://schema.org/deathDate"/>
        <call-macro name="date-shortener" abbrev="dbp:birthYear" predicate="http://dbpedia.org/ontology/birthYear"/>
        <call-macro name="date-shortener" abbrev="dbp:deathYear" predicate="http://dbpedia.org/ontology/deathYear"/>

        <!-- Person resources -->
        <call-macro name="person-literal" abbrev="skos:note" predicate="http://www.w3.org/2004/02/skos/core#note"/>
        <call-macro name="person-literal" abbrev="foaf:lastName" predicate="http://xmlns.com/foaf/0.1/lastName"/>
        <call-macro name="person-literal" abbrev="foaf:firstName" predicate="http://xmlns.com/foaf/0.1/firstName"/>
        <call-macro name="person-literal" abbrev="rdfs:label" predicate="http://www.w3.org/2000/01/rdf-schema#label"/>
        <call-macro name="person-literal" abbrev="foaf:name" predicate="http://xmlns.com/foaf/0.1/name"/>

        <!-- DBPedia resources -->
        <call-macro name="dbpedia-uri" abbrev="dbp:birthPlace" predicate="http://dbpedia.org/ontology/birthPlace"/>
        <call-macro name="dbpedia-uri" abbrev="dbp:deathPlace" predicate="http://dbpedia.org/ontology/deathPlace"/>
        <call-macro name="dbpedia-uri" abbrev="dbp:genre" predicate="http://dbpedia.org/ontology/genre"/>
        <call-macro name="dbpedia-uri" abbrev="dbp:movement" predicate="http://dbpedia.org/ontology/movement"/>
        <call-macro name="dbpedia-uri" abbrev="dbp:nationality" predicate="http://dbpedia.org/ontology/nationality"/>
        <call-macro name="dbpedia-uri" abbrev="dbp:notableWork" predicate="http://dbpedia.org/ontology/notableWork"/>
        <call-macro name="dbpedia-uri" abbrev="dbp:occupation" predicate="http://dbpedia.org/ontology/occupation"/>
        <call-macro name="dbpedia-uri" abbrev="dbp:thumbnail" predicate="http://dbpedia.org/ontology/thumbnail"/>
        <call-macro name="dbpedia-uri" abbrev="dbp:influencedBy" predicate="http://dbpedia.org/ontology/influencedBy"/>
        <call-macro name="dbpedia-uri" abbrev="dbp:partner" predicate="http://dbpedia.org/ontology/partner"/>
        <call-macro name="dbpedia-uri" abbrev="dbp:spouse" predicate="http://dbpedia.org/ontology/spouse"/>
        <call-macro name="dbpedia-uri" abbrev="dbp:author" predicate="http://dbpedia.org/ontology/author"/>
        <call-macro name="dbpedia-uri" abbrev="dbp:influenced" predicate="http://dbpedia.org/ontology/influenced"/>

        <call-macro name="language-tag" abbrev="dbp:abstract" predicate="http://dbpedia.org/ontology/abstract"/>
        <call-macro name="language-tag" abbrev="dbp:pseudonym" predicate="http://dbpedia.org/ontology/pseudonym"/>

        <data source="owl:sameAs" name="owl:sameAs"/>
        <data source="http://www.w3.org/2002/07/owl#sameAs" name="owl:sameAs"/>
        <data source="http://schema.org/alternateName" name="schema:alternateName"/>
{'fraction_non_alphanumeric': 0.20178760793819117, 'fraction_numerical': 0.009846992879866687, 'mean_word_length': 2.615279299014239, 'pattern_counts': {'":': 0, '<': 202, '<?xml version=': 2, '>': 202, 'https://': 0, 'lorem ipsum': 0, 'www.': 14, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '379206', 'n_tokens_mistral': 4598, 'n_tokens_neox': 4059, 'n_words': 540}