<?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;


        SELECT DISTINCT ?dateTimeValue
                        (REPLACE(STR(?dateTimePrecision),"^.*(#)(.*)$", "$2") AS ?precision)
                        ?dateTime
        WHERE {
            ?subject ?property ?dateTimeValue .
            OPTIONAL {
                <precise-subquery>?subject ?property ?dateTimeValue .</precise-subquery>
                ?dateTimeValue core:dateTime ?dateTime .
            }
            OPTIONAL {
                <precise-subquery>?subject ?property ?dateTimeValue .</precise-subquery>
                ?dateTimeValue core:dateTimePrecision ?dateTimePrecision .
            }
            <critical-data-required>
            FILTER ( bound(?dateTime) )
            </critical-data-required>
        }
    </query-select>

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