<commit_before><?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://bioinformatics.northwestern.edu/ns/psc"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:psc="http://bioinformatics.northwestern.edu/ns/psc"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified">

    <xsd:element name="study" type="psc:Study" />

    <xsd:complexType name="Study">
        <xsd:sequence>
            <xsd:element name="planned-calendar" type="psc:PlannedCalendar" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="amendment" type="psc:Amendment" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="assigned-identifier" type="xsd:string" use="required"/>
        <xsd:attribute name="id" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="PlannedCalendar">
        <xsd:attribute name="id" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="Amendment">
        <xsd:sequence>
            <xsd:element name="delta" type="psc:Delta" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="name" type="xsd:string" use="required"/>
        <xsd:attribute name="date" type="xsd:date" use="required"/>
        <xsd:attribute name="mandatory" type="xsd:boolean" use="required"/>
        <xsd:attribute name="id" type="xsd:string" use="required"/>
        <xsd:attribute name="previous-amendment-id" type="xsd:string"/>
    </xsd:complexType>


    <xsd:complexType name="Delta">
        <xsd:sequence>
            <xsd:element name="add" type="psc:Add" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element name="remove" type="psc:Remove" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element name="reorder" type="psc:Reorder" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element name="property-change" type="psc:PropertyChange" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:string" use="required"/>
        <xsd:attribute name="node-id" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="Add">
        <xsd:sequence>
            <xsd:element name="epoch" type="psc:Epoch" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element name="study-segment" type="psc:StudySegment" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element name="period" type="psc:Period" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element name="planned-activity" type="psc:PlannedActivity" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="index" type="xsd:integer" use="optional"/>
        <xsd:attribute name="id" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="Remove">
        <xsd:attribute name="id" type="xsd:string" use="required"/>
        <xsd:attribute name="child-id" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="Reorder">
        <xsd:attribute name="id" type="xsd:string" use="required"/>
        <xsd:attribute name="child-id" type="xsd:string" use="required"/>
        <xsd:attribute name="old-index" type="xsd:integer" use="required"/>
        <xsd:attribute name="new-index" type="xsd:integer" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="PropertyChange">
        <xsd:attribute name="id" type="xsd:string" use="required"/>
        <xsd:attribute name="property-name" type="xsd:string" use="required"/>
        <xsd:attribute name="old-value" type="xsd:string" use="required"/>
        <xsd:attribute name="new-value" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="Epoch">
        <xsd:sequence>
            <xsd:element name="study-segment" type="psc:StudySegment" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="name" type="xsd:string" use="required"/>
        <xsd:attribute name="id" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="StudySegment">
        <xsd:sequence>
            <xsd:element name="period" type="psc:Period" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="name" type="xsd:string" use="required"/>
        <xsd:attribute name="id" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="Period">
        <xsd:sequence>
            <xsd:element name="planned-activity" type="psc:PlannedActivity" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="name" type="xsd:string" use="required"/>
        <xsd:attribute name="id" type="xsd:string" use="required"/>
    </xsd:complexType>

    <!-- TODO: add population -->
    <xsd:complexType name="PlannedActivity">
        <xsd:sequence>
            <xsd:element name="activity" type="psc:Activity" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:string" use="required"/>
        <xsd:attribute name="day" type="xsd:integer" use="required"/>
        <xsd:attribute name="details" type="xsd:string"/>
        <xsd:attribute name="condition" type="xsd:string"/>
    </xsd:complexType>


    <xsd:element name="sources" type="psc:Sources" />

    <xsd:complexType name="Sources">
        <xsd:sequence>
            <xsd:element name="source" type="psc:Source" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="Source">
        <xsd:sequence>
            <xsd:element name="activity" type="psc:Activity" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:string"/><commit_msg>Make period name optional in template schema.<commit_after><?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://bioinformatics.northwestern.edu/ns/psc"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:psc="http://bioinformatics.northwestern.edu/ns/psc"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified">

    <xsd:element name="study" type="psc:Study" />

    <xsd:complexType name="Study">
        <xsd:sequence>
            <xsd:element name="planned-calendar" type="psc:PlannedCalendar" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="amendment" type="psc:Amendment" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="assigned-identifier" type="xsd:string" use="required"/>
        <xsd:attribute name="id" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="PlannedCalendar">
        <xsd:attribute name="id" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="Amendment">
        <xsd:sequence>
            <xsd:element name="delta" type="psc:Delta" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="name" type="xsd:string" use="required"/>
        <xsd:attribute name="date" type="xsd:date" use="required"/>
        <xsd:attribute name="mandatory" type="xsd:boolean" use="required"/>
        <xsd:attribute name="id" type="xsd:string" use="required"/>
        <xsd:attribute name="previous-amendment-id" type="xsd:string"/>
    </xsd:complexType>


    <xsd:complexType name="Delta">
        <xsd:sequence>
            <xsd:element name="add" type="psc:Add" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element name="remove" type="psc:Remove" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element name="reorder" type="psc:Reorder" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element name="property-change" type="psc:PropertyChange" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:string" use="required"/>
        <xsd:attribute name="node-id" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="Add">
        <xsd:sequence>
            <xsd:element name="epoch" type="psc:Epoch" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element name="study-segment" type="psc:StudySegment" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element name="period" type="psc:Period" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element name="planned-activity" type="psc:PlannedActivity" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="index" type="xsd:integer" use="optional"/>
        <xsd:attribute name="id" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="Remove">
        <xsd:attribute name="id" type="xsd:string" use="required"/>
        <xsd:attribute name="child-id" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="Reorder">
        <xsd:attribute name="id" type="xsd:string" use="required"/>
        <xsd:attribute name="child-id" type="xsd:string" use="required"/>
        <xsd:attribute name="old-index" type="xsd:integer" use="required"/>
        <xsd:attribute name="new-index" type="xsd:integer" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="PropertyChange">
        <xsd:attribute name="id" type="xsd:string" use="required"/>
        <xsd:attribute name="property-name" type="xsd:string" use="required"/>
        <xsd:attribute name="old-value" type="xsd:string" use="required"/>
        <xsd:attribute name="new-value" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="Epoch">
        <xsd:sequence>
            <xsd:element name="study-segment" type="psc:StudySegment" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="name" type="xsd:string" use="required"/>
        <xsd:attribute name="id" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="StudySegment">
        <xsd:sequence>
            <xsd:element name="period" type="psc:Period" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="name" type="xsd:string" use="required"/>
        <xsd:attribute name="id" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="Period">
        <xsd:sequence>
            <xsd:element name="planned-activity" type="psc:PlannedActivity" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="name" type="xsd:string"/>
        <xsd:attribute name="id" type="xsd:string" use="required"/>
    </xsd:complexType>

    <!-- TODO: add population -->
    <xsd:complexType name="PlannedActivity">
        <xsd:sequence>
            <xsd:element name="activity" type="psc:Activity" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:string" use="required"/>
        <xsd:attribute name="day" type="xsd:integer" use="required"/>
        <xsd:attribute name="details" type="xsd:string"/>
        <xsd:attribute name="condition" type="xsd:string"/>
    </xsd:complexType>


    <xsd:element name="sources" type="psc:Sources" />

    <xsd:complexType name="Sources">
        <xsd:sequence>
            <xsd:element name="source" type="psc:Source" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="Source">
        <xsd:sequence>
            <xsd:element name="activity" type="psc:Activity" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:string"/>
{'fraction_non_alphanumeric': 0.17905839979418575, 'fraction_numerical': 0.004459308807134894, 'mean_word_length': 3.75030549898167, 'pattern_counts': {'":': 0, '<': 207, '<?xml version=': 2, '>': 207, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 6}, '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': '203372', 'n_tokens_mistral': 3889, 'n_tokens_neox': 3512, 'n_words': 586}