<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $This file is distributed under the terms of the license in LICENSE$ -->

<!-- See guidelines at https://wiki.duraspace.org/x/eYXVAw  -->

<list-view-config>
    <query-select>
        PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
        PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
        PREFIX foaf:  &lt;http://xmlns.com/foaf/0.1/&gt;
        PREFIX vitro: &lt;http://vitro.mannlib.cornell.edu/ns/vitro/0.7#&gt;

        SELECT DISTINCT ?subclass
                        ?edTraining
                        ?person ?personName
                        ?awardedDegree
                        ?degree
                        ?degreeName ?degreeAbbr
                        ?majorField ?info
                        ?dateTimeStart ?dateTimeEnd
        WHERE {
            ?subject ?property ?edTraining .
            ?edTraining a core:EducationalProcess .
            OPTIONAL {
                <precise-subquery>?subject ?property ?edTraining .
                ?edTraining a core:EducationalProcess .</precise-subquery>
                ?edTraining vitro:mostSpecificType ?subclass .
            }
            OPTIONAL {
                <precise-subquery>?subject ?property ?edTraining .
                ?edTraining a core:EducationalProcess .</precise-subquery>
                ?edTraining &lt;http://purl.obolibrary.org/obo/RO_0002234&gt; ?awardedDegree .
                ?awardedDegree core:relates ?degree .
                ?degree a core:AcademicDegree .
                ?degree rdfs:label ?degreeName .
            }
            OPTIONAL {
                <precise-subquery>?subject ?property ?edTraining .
                ?edTraining a core:EducationalProcess .</precise-subquery>
                ?edTraining &lt;http://purl.obolibrary.org/obo/RO_0002234&gt; ?awardedDegree .
                ?awardedDegree core:relates ?degree .
                ?degree a core:AcademicDegree .
                ?degree core:abbreviation ?degreeAbbr .
            }
            OPTIONAL {
                <precise-subquery>?subject ?property ?edTraining .
                ?edTraining a core:EducationalProcess .</precise-subquery>
                ?edTraining &lt;http://purl.obolibrary.org/obo/RO_0000057&gt; ?person .
                ?person a foaf:Person .
                ?person rdfs:label ?personName .
            }
            OPTIONAL {
                <precise-subquery>?subject ?property ?edTraining .
                ?edTraining a core:EducationalProcess .</precise-subquery>
                ?edTraining core:majorField ?majorField .
            }
            OPTIONAL {
                <precise-subquery>?subject ?property ?edTraining .
                ?edTraining a core:EducationalProcess .</precise-subquery>
                ?edTraining core:supplementalInformation ?info .
            }
            OPTIONAL {
                <precise-subquery>?subject ?property ?edTraining .
                ?edTraining a core:EducationalProcess .</precise-subquery>
                ?edTraining core:dateTimeInterval ?dateTimeInterval .
                ?dateTimeInterval core:start ?dateTimeStartValue .
                ?dateTimeStartValue core:dateTime ?dateTimeStart .
            }
            OPTIONAL {
                <precise-subquery>?subject ?property ?edTraining .
                ?edTraining a core:EducationalProcess .</precise-subquery>
                ?edTraining core:dateTimeInterval ?dateTimeInterval .
                ?dateTimeInterval core:end ?dateTimeEndValue .
                ?dateTimeEndValue core:dateTime ?dateTimeEnd .
            }
         }  ORDER BY ?subclass DESC(?dateTimeEnd) DESC(?dateTimeStart)
    </query-select>

    <template>propStatement-organizationForTraining.ftl</template>
</list-view-config>
