vivo/legacy/utilities/acceptance-tests/suites/ShortViews/shortview_config.n3
2015-11-19 23:47:41 +00:00

127 lines
3.7 KiB
Text

# $This file is distributed under the terms of the license in /doc/license.txt$
#
# 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://sourceforge.net/apps/mediawiki/vivo/index.php?title=Using_Short_Views_in_Release_1.5
#
@prefix vivo: <http://vivoweb.org/ontology/core#> .
@prefix display: <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#> .
@prefix datagetters: <java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.> .
@prefix mydomain: <http://vivo.mydomain.edu/individual/> .
#
# In all views, Facult Members should show the name of the
# department they belong to.
#
vivo:FacultyMember
display:hasCustomView mydomain:facultySearchView ;
display:hasCustomView mydomain:facultyIndexView ;
display:hasCustomView mydomain:facultyBrowseView .
mydomain:facultySearchView
a display:customViewForIndividual ;
display:appliesToContext "SEARCH" ;
display:hasTemplate "view-search-faculty.ftl" ;
display:hasDataGetter mydomain:facultyDepartmentDG .
mydomain:facultyIndexView
a display:customViewForIndividual ;
display:appliesToContext "INDEX" ;
display:hasTemplate "view-index-faculty.ftl" ;
display:hasDataGetter mydomain:facultyDepartmentDG .
mydomain:facultyBrowseView
a display:customViewForIndividual ;
display:appliesToContext "BROWSE" ;
display:hasTemplate "view-browse-faculty.ftl" ;
display:hasDataGetter mydomain:facultyDepartmentDG ;
display:hasDataGetter mydomain:facultyPreferredTitleDG .
mydomain:facultyDepartmentDG
a datagetters:SparqlQueryDataGetter ;
display:saveToVar "details" ;
display:query """
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX vivo: <http://vivoweb.org/ontology/core#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
SELECT ?deptName
WHERE {
?individualUri obo:RO_0000053 ?membership .
?membership vivo:roleContributesTo ?deptUri .
?deptUri
a vivo:AcademicDepartment ;
rdfs:label ?deptName .
}
LIMIT 20
""" .
mydomain:facultyPreferredTitleDG
a datagetters:SparqlQueryDataGetter ;
display:saveToVar "extra" ;
display:query """
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>
SELECT DISTINCT ?pt
WHERE {
?individualUri obo:ARG_2000028 ?vIndividual .
?vIndividual vcard:hasTitle ?vTitle .
?vTitle vcard:title ?pt .
}
LIMIT 1
""" .
#
# In the INDEX view, Academic departments should show locations
# and department head.
#
vivo:AcademicDepartment
display:hasCustomView mydomain:departmentView .
mydomain:departmentView
a display:customViewForIndividual ;
display:appliesToContext "INDEX" ;
display:hasTemplate "view-index-department.ftl" ;
display:hasDataGetter mydomain:departmentLocationDG ;
display:hasDataGetter mydomain:departmentHeadDG .
mydomain:departmentLocationDG
a datagetters:SparqlQueryDataGetter ;
display:saveToVar "locations" ;
display:query """
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
SELECT ?label
WHERE
{
?location obo:RO_0001015 ?individualUri ;
rdfs:label ?label .
}
LIMIT 20
""" .
mydomain:departmentHeadDG
a datagetters:SparqlQueryDataGetter ;
display:saveToVar "deptHead" ;
display:query """
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX vivo: <http://vivoweb.org/ontology/core#>
SELECT ?label
WHERE
{
?individualUri vivo:contributingRole ?role .
?role obo:RO_0000052 ?head .
?head rdfs:label ?label .
}
LIMIT 1
""" .