<?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 foaf:  &lt;http://xmlns.com/foaf/0.1/&gt;
        PREFIX bibo:  &lt;http://purl.org/ontology/bibo/&gt;
        PREFIX core:  &lt;http://vivoweb.org/ontology/core#&gt;
        PREFIX owl:   &lt;http://www.w3.org/2002/07/owl#&gt;
        PREFIX rdfs:  &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
        PREFIX vitro: &lt;http://vitro.mannlib.cornell.edu/ns/vitro/0.7#&gt;

        SELECT DISTINCT ?awardReceipt
            ?receiptLabel
            ?award
            ?awardLabel
            ?assignedBy
            ?assignedByLabel
            ?dateTimeStart
            ?dateTimeEnd
            ?dateTime

        WHERE
        {
            ?subject ?property ?awardReceipt .
            ?awardReceipt a core:AwardReceipt .
            OPTIONAL {
                <precise-subquery>?subject ?property ?awardReceipt .
                ?awardReceipt a core:AwardReceipt .</precise-subquery>
                ?awardReceipt rdfs:label ?receiptLabel .
            }
            OPTIONAL {
                <precise-subquery>?subject ?property ?awardReceipt .
                ?awardReceipt a core:AwardReceipt .</precise-subquery>
                ?awardReceipt core:relates ?award .
                ?award a core:Award .
                ?award core:relatedBy ?awardReceipt .
                ?award rdfs:label ?awardLabel .
            }
            OPTIONAL {
                <precise-subquery>?subject ?property ?awardReceipt .
                ?awardReceipt a core:AwardReceipt .</precise-subquery>
                ?awardReceipt core:assignedBy ?assignedBy .
                ?assignedBy rdfs:label ?assignedByLabel .
            }
            OPTIONAL {
                <precise-subquery>?subject ?property ?awardReceipt .
                ?awardReceipt a core:AwardReceipt .</precise-subquery>
                ?awardReceipt core:dateTimeInterval ?dateTimeInterval .
                ?dateTimeInterval core:start ?dateTimeStartValue .
                ?dateTimeStartValue core:dateTime ?dateTimeStart .
            }
            OPTIONAL {
                <precise-subquery>?subject ?property ?awardReceipt .
                ?awardReceipt a core:AwardReceipt .</precise-subquery>
                ?awardReceipt core:dateTimeInterval ?dateTimeInterval .
                ?dateTimeInterval core:end ?dateTimeEndValue .
                ?dateTimeEndValue core:dateTime ?dateTimeEnd .
            }
            OPTIONAL {
                <precise-subquery>?subject ?property ?awardReceipt .
                ?awardReceipt a core:AwardReceipt .</precise-subquery>
                ?awardReceipt core:dateTimeValue ?dateTimeValue .
                ?dateTimeValue core:dateTime ?dateTime .
            }
        }  ORDER BY  DESC(?dateTime) DESC(?dateTimeEnd)
    </query-select>

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