<?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;
        PREFIX fn:   &lt;http://www.w3.org/2005/xpath-functions#&gt;

        SELECT DISTINCT <collated> ?subclass </collated>
                        ?editorship
                        ?person ?personName
        WHERE {
            ?subject ?property ?editorship .
            ?editorship a core:Editorship .
            OPTIONAL {
                <precise-subquery>?subject ?property ?editorship .
                ?editorship a core:Editorship .</precise-subquery>
                ?editorship core:rank ?rank .
            }
            OPTIONAL {
                <precise-subquery>?subject ?property ?editorship .
                ?editorship a core:Editorship .</precise-subquery>
                ?editorship core:relates ?person .
                ?person a foaf:Person .
                ?person rdfs:label ?personName .
            }
            <collated>
            OPTIONAL {
                <precise-subquery>?subject ?property ?editorship .
                ?editorship a core:Editorship .</precise-subquery>
                ?editorship core:relates ?person .
                ?person a foaf:Person .
                ?person vitro:mostSpecificType ?subclass .
                ?subclass rdfs:subClassOf foaf:Person .
            }
            </collated>
            <critical-data-required>
            FILTER ( bound(?person) )
            </critical-data-required>
        } ORDER BY <collated> ?subclass </collated> ?rank (fn:lower-case(?personName))
    </query-select>

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