# $This file is distributed under the terms of the license in LICENSE$

#
# Short View configuration
#
# This file allows a Vitro administrator to configure short view templates and data getters
# for individuals of particular classes in particular contexts. This is a transitional
# implementation, and should be replaced when the work on the Application and Display
# Ontology is complete.
#
# Find out how to use this file at
# https://wiki.duraspace.org/display/VIVO/Using+Short+Views+in+Release+1.5
#
@prefix ts_:    <https://litvinovg.pro/text_structures#> .
@prefix display: <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#> .
@prefix mydomain: <http://vivo.mydomain.edu/individual/> .

ts_:elenphExcerpt    display:hasCustomView  mydomain:elenphExcerptShortView .
 
mydomain:elenphExcerptShortView
    a                          display:customViewForIndividual ;
    display:appliesToContext   "SEARCH" ;
    display:hasTemplate        "elenphExcerptShortView.ftl" ;
    display:hasDataGetter      mydomain:elenphExcerptShortViewDataGetter .

mydomain:elenphExcerptShortViewDataGetter
    a <java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter>;
    display:saveToVar "excerptInfo";
    display:query
        """
       PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
       PREFIX vivo: <http://vivoweb.org/ontology/core#>
       PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
       PREFIX ts_:  <https://litvinovg.pro/text_structures#> 
       SELECT ?property ?value
       WHERE {
          ?individualUri ?property ?value .
          ?individualUri rdf:type ts_:elenphExcerpt .
       }
        """ .

