Merge branch 'develop' into feature/microformats

This commit is contained in:
Tim Worrall 2015-02-11 16:18:38 -05:00
commit 36227770a8
62 changed files with 1327 additions and 51309 deletions

View file

@ -12,6 +12,8 @@ http://vivoweb.org/
### DuraSpace Wiki:
https://wiki.duraspace.org/display/VIVO/
Installation instructions for the latest release can be found at this location on the wiki: https://wiki.duraspace.org/display/VIVO/VIVO+Technical+Documentation
## Contact us
There are several ways to contact the VIVO community.
Whatever your interest, we would be pleased to hear from you.

View file

@ -3,33 +3,44 @@
:application
a <java:edu.cornell.mannlib.vitro.webapp.application.ApplicationImpl> ,
<java:edu.cornell.mannlib.vitro.webapp.modules.Application> ;
:hasSearchEngine :searchEngineWrapper ;
:hasImageProcessor :imageProcessor ;
:hasFileStorage :fileStorage ;
:hasContentTripleSource :contentTripleSource ;
:hasConfigurationTripleSource :configurationTripleSource .
:hasSearchEngine :instrumentedSearchEngineWrapper ;
:hasSearchIndexer :basicSearchIndexer ;
:hasImageProcessor :jaiImageProcessor ;
:hasFileStorage :ptiFileStorage ;
:hasContentTripleSource :sdbContentTripleSource ;
:hasConfigurationTripleSource :tdbConfigurationTripleSource ;
:hasTBoxReasonerModule :jfactTBoxReasonerModule .
:imageProcessor
:jaiImageProcessor
a <java:edu.cornell.mannlib.vitro.webapp.imageprocessor.jai.JaiImageProcessor> ,
<java:edu.cornell.mannlib.vitro.webapp.modules.imageProcessor.ImageProcessor> .
:fileStorage
:ptiFileStorage
a <java:edu.cornell.mannlib.vitro.webapp.filestorage.impl.FileStorageImplWrapper> ,
<java:edu.cornell.mannlib.vitro.webapp.modules.fileStorage.FileStorage> .
:searchEngineWrapper
:instrumentedSearchEngineWrapper
a <java:edu.cornell.mannlib.vitro.webapp.searchengine.InstrumentedSearchEngineWrapper> ,
<java:edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchEngine> ;
:wraps :searchEngine .
:wraps :solrSearchEngine .
:searchEngine
:solrSearchEngine
a <java:edu.cornell.mannlib.vitro.webapp.searchengine.solr.SolrSearchEngine> ,
<java:edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchEngine> .
:contentTripleSource
:basicSearchIndexer
a <java:edu.cornell.mannlib.vitro.webapp.searchindex.SearchIndexerImpl> ,
<java:edu.cornell.mannlib.vitro.webapp.modules.searchIndexer.SearchIndexer> ;
:threadPoolSize "10" .
:sdbContentTripleSource
a <java:edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb.ContentTripleSourceSDB> ,
<java:edu.cornell.mannlib.vitro.webapp.modules.tripleSource.ContentTripleSource> .
:configurationTripleSource
:tdbConfigurationTripleSource
a <java:edu.cornell.mannlib.vitro.webapp.triplesource.impl.tdb.ConfigurationTripleSourceTDB> ,
<java:edu.cornell.mannlib.vitro.webapp.modules.tripleSource.ConfigurationTripleSource> .
<java:edu.cornell.mannlib.vitro.webapp.modules.tripleSource.ConfigurationTripleSource> .
:jfactTBoxReasonerModule
a <java:edu.cornell.mannlib.vitro.webapp.tboxreasoner.impl.jfact.JFactTBoxReasonerModule> ,
<java:edu.cornell.mannlib.vitro.webapp.modules.tboxreasoner.TBoxReasonerModule> .

View file

@ -86,20 +86,6 @@ GNU AGPL 3
licenses/agpl.LICENSE.txt
iText
pellet-cli
pellet-core
pellet-datatypes
pellet-dig
pellet-el
pellet-explanation
pellet
pellet-jena
pellet-modularity
pellet-owlapi
pellet-pellint
pellet-query
pellet-rules
pellet-test
GNU GPL 2

View file

@ -20,7 +20,7 @@
# setting to point elsewhere in development environments).
# Examples:
# vitro.core.dir = ./vitro-core
# vitro.core.dir = ../vitro
# vitro.core.dir = ../Vitro
# vitro.core.dir = /usr/local/vitro/trunk
vitro.core.dir = ./vitro-core

View file

@ -881,4 +881,5 @@ editor_of_entry = editor de para
role_type = Tipo de papel
add_capitalized = Añadir
researcher_role = El papel del investigador
search_service_btn = Búsqueda el servicio
search_service_btn = Búsqueda el servicio
through_today = sobre la fecha de hoy

Binary file not shown.

View file

@ -13,9 +13,6 @@ edu.cornell.mannlib.vitro.webapp.config.ConfigurationPropertiesSetup
edu.cornell.mannlib.vitro.webapp.config.ConfigurationPropertiesSmokeTests
# For the conversion from 1.6 or earlier (RDB) to 1.7 or later (TDB)
edu.cornell.mannlib.vitro.webapp.servlet.setup.GuardAgainstUnmigratedRDB
edu.cornell.mannlib.vitro.webapp.utils.developer.DeveloperSettings$Setup
edu.cornell.mannlib.vitro.webapp.application.ApplicationImpl$ComponentsSetup
@ -36,7 +33,9 @@ edu.cornell.mannlib.vitro.webapp.servlet.setup.FileGraphSetup
# Invokes process to perform updates to align with ontology changes if needed -->
edu.cornell.mannlib.vitro.webapp.servlet.setup.UpdateKnowledgeBase
edu.cornell.mannlib.vitro.webapp.migration.Release18Migrator
edu.cornell.mannlib.vitro.webapp.application.ApplicationImpl$ReasonersSetup
edu.cornell.mannlib.vitro.webapp.servlet.setup.SimpleReasonerSetup
# Must run after JenaDataSourceSetup
@ -46,7 +45,7 @@ edu.cornell.mannlib.vitro.webapp.auth.permissions.PermissionRegistry$Setup
edu.cornell.mannlib.vitro.webapp.auth.permissions.PermissionSetsSmokeTest
edu.cornell.mannlib.vitro.webapp.auth.policy.bean.PropertyRestrictionPolicyHelper$Setup
edu.cornell.mannlib.vitro.webapp.auth.policy.bean.PropertyRestrictionBean$Setup
edu.cornell.mannlib.vitro.webapp.auth.policy.setup.CommonPolicyFamilySetup

View file

@ -819,6 +819,15 @@
<url-pattern>/showObjectPropertyHierarchy</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>ListFauxPropertiesController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.freemarker.ListFauxPropertiesController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ListFauxPropertiesController</servlet-name>
<url-pattern>/listFauxProperties</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>ShowDataPropertyHierarchyController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.freemarker.ShowDataPropertyHierarchyController</servlet-class>

View file

@ -24,17 +24,17 @@
?title WHERE {
?subject ?property ?object .
?object a ?objectType .
LET (?localName := afn:localname(?object))
OPTIONAL { ?object rdfs:label ?label }
OPTIONAL {
# Get mostSpecificType only for Persons
?object a foaf:Person .
?object vitro:mostSpecificType ?typeUri .
?typeUri rdfs:label ?type .
?object vitro:mostSpecificType ?subclass .
?subclass rdfs:label ?type .
# Display only a mostSpecificType that belongs to a classgroup.
?typeUri vitro:inClassGroup ?classGroup .
?subclass vitro:inClassGroup ?classGroup .
?classGroup a vitro:ClassGroup
}
@ -44,7 +44,6 @@
}
<collated>
OPTIONAL { ?object a ?subclass }
FILTER ( afn:namespace(?subclass) != "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#" )
</collated>
@ -60,16 +59,15 @@
CONSTRUCT {
?subject ?property ?object .
?object a ?subclass .
?object a ?objectType .
?object rdfs:label ?label .
} WHERE {
{
?subject ?property ?object .
} UNION {
?subject ?property ?object .
?object a ?subclass .
?object a ?objectType .
} UNION {
?subject ?property ?object .
?object a ?objectType .
?object rdfs:label ?label .
}
}
@ -84,24 +82,28 @@
CONSTRUCT {
?subject ?property ?object .
?object vitro:mostSpecificType ?typeUri .
?typeUri vitro:inClassGroup ?classGroup .
?object a ?objectType .
?object vitro:mostSpecificType ?subclass .
?subclass vitro:inClassGroup ?classGroup .
?classGroup a vitro:ClassGroup .
?typeUri rdfs:label ?type .
?subclass rdfs:label ?type .
?object obo:ARG_2000028 ?vcard .
?vcard vcard:hasTitle ?titleObj .
?titleObj vcard:title ?title
} WHERE {
{
?subject ?property ?object .
?object a ?objectType .
} UNION {
?subject ?property ?object .
?object vitro:mostSpecificType ?typeUri .
?typeUri rdfs:label ?type .
?typeUri vitro:inClassGroup ?classGroup .
?object a ?objectType .
?object vitro:mostSpecificType ?subclass .
?subclass rdfs:label ?type .
?subclass vitro:inClassGroup ?classGroup .
?classGroup a vitro:ClassGroup
} UNION {
?subject ?property ?object .
?object a ?objectType .
?object obo:ARG_2000028 ?vcard .
?vcard vcard:hasTitle ?titleObj .
?titleObj vcard:title ?title
@ -110,4 +112,4 @@
</query-construct>
<template>propStatement-default.ftl</template>
</list-view-config>
</list-view-config>

View file

@ -167,13 +167,13 @@
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
CONSTRUCT {
?subject ?property ?edTraining .
?leaderRole core:dateTimeInterval ?dateTimeInterval .
?edTraining core:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval core:start ?dateTimeStartValue .
?dateTimeStartValue core:dateTime ?dateTimeStart
} WHERE {
?subject ?property ?edTraining .
?edTraining a core:EducationalProcess .
?leaderRole core:dateTimeInterval ?dateTimeInterval .
?edTraining core:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval core:start ?dateTimeStartValue .
?dateTimeStartValue core:dateTime ?dateTimeStart
}
@ -183,15 +183,15 @@
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
CONSTRUCT {
?subject ?property ?edTraining .
?leaderRole core:dateTimeInterval ?dateTimeInterval .
?edTraining core:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval core:end ?dateTimeEndValue .
?dateTimeStartValue core:dateTime ?dateTimeEnd
?dateTimeEndValue core:dateTime ?dateTimeEnd
} WHERE {
?subject ?property ?edTraining .
?edTraining a core:EducationalProcess .
?leaderRole core:dateTimeInterval ?dateTimeInterval .
?edTraining core:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval core:end ?dateTimeEndValue .
?dateTimeStartValue core:dateTime ?dateTimeEnd
?dateTimeEndValue core:dateTime ?dateTimeEnd
}
</query-construct>

View file

@ -134,7 +134,7 @@ $(document).ready(function(){
//Check to see if this index hasn't already been employed
if(!indexFound) {
//if this index hasn't already been employed then utilize it
html += "<li><a href='" + urlsBase + "/individual"
html += "<li><a href='" + urlsBase + "/individual?uri="
+ academicDepartments[index].uri + "'>"
+ academicDepartments[index].name + "</a></li>";
//add this index to the set of already used indices
@ -146,7 +146,7 @@ $(document).ready(function(){
}
else {
for ( var i=0;i<deptNbr;i++) {
html += "<li><a href='" + urlsBase + "/individual"
html += "<li><a href='" + urlsBase + "/individual?uri="
+ academicDepartments[i].uri + "'>"
+ academicDepartments[i].name + "</a></li>";
}

View file

@ -1,7 +1,7 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
$(document).ready(function(){
// ensures proper layout when an organization has its webpage link displayed as a thumnail.
// there's a timing issue, so we can't check the length here, so check the role just to see
// if $('ul.webpages-withThumnails') exists
@ -48,7 +48,8 @@ $(document).ready(function(){
// var $propList = $('.property-list').not('>li>ul');
var $propList = $('.property-list:not(:has(>li>ul))');
$propList.each(function() {
var $additionalItems = $(this).find('li:gt(4)');
var limit = $(this).attr("displayLimit");
var $additionalItems = $(this).find('li:gt(' + (limit - 1) + ')');
if ( $additionalItems.exists() ) {
// create container for additional elements
var $itemContainer = $('<div class="additionalItems" />').appendTo(this);
@ -66,7 +67,8 @@ $(document).ready(function(){
var $subPropList = $('.subclass-property-list');
$subPropList.each(function() {
var $additionalItems = $(this).find('li:gt(4)');
var limit = $(this).parent().parent().attr("displayLimit");
var $additionalItems = $(this).find('li:gt(' + (limit - 1) + ')');
if ( $additionalItems.exists() ) {
// create container for additional elements
var $itemContainer = $('<div class="additionalItems" />').appendTo(this);

View file

@ -49,7 +49,7 @@
<h2>${relatedSubject.relatingPredicateDomainPublic} ${i18n().for} ${relatedSubject.name}</h2>
<p><a href="${relatedSubject.url}" title="${i18n().return_to(relatedSubject.name)}">&larr; ${i18n().return_to(relatedSubject.name)}</a></p>
<#else>
<h1 class="vcard foaf-person fn" <#if !editable>style="float:left;border-right:1px solid #A6B1B0;"</#if>>
<h1 itemprop="name" class="vcard foaf-person fn" <#if !editable>style="float:left;border-right:1px solid #A6B1B0;"</#if>>
<#-- Label -->
<@p.label individual editable labelCount localesCount/>
</h1>
@ -64,9 +64,9 @@
</#if>
<#list title.statements as statement>
<#if !editable >
<div id="titleContainer"><span class="display-title-not-editable">${statement.preferredTitle}</span></div>
<div id="titleContainer"><span itemprop="jobTitle" class="display-title-not-editable">${statement.preferredTitle}</span></div>
<#else>
<span class="display-title-editable">${statement.preferredTitle}</span>
<span itemprop="jobTitle" class="display-title-editable">${statement.preferredTitle}</span>
<@p.editingLinks "${title.localName}" "${title.name}" statement editable title.rangeUri />
</#if>
</#list>

View file

@ -60,7 +60,7 @@
<#else>
<#-- Image -->
<div id="photo-wrapper">${individualImage}</div>
<h1 class="vcard foaf-person fn" <#if !editable>style="float:left;border-right:1px solid #A6B1B0;"</#if>>
<h1 itemprop="name" class="vcard foaf-person fn" <#if !editable>style="float:left;border-right:1px solid #A6B1B0;"</#if>>
<#-- Label -->
<@p.label individual editable labelCount localesCount/>
</h1>
@ -75,9 +75,9 @@
</#if>
<#list title.statements as statement>
<#if !editable >
<div id="titleContainer"><span class="display-title-not-editable">${statement.preferredTitle}</span></div>
<div id="titleContainer"><span itemprop="jobTitle" class="display-title-not-editable">${statement.preferredTitle}</span></div>
<#else>
<span class="display-title-editable">${statement.preferredTitle}</span>
<span itemprop="jobTitle" class="display-title-editable">${statement.preferredTitle}</span>
<@p.editingLinks "${title.localName}" "${title.name}" statement editable title.rangeUri />
</#if>
</#list>

View file

@ -4,16 +4,15 @@
This template must be self-contained and not rely on other variables set for the individual page, because it
is also used to generate the property statement during a deletion.
-->
-->
<@showStatement statement />
<#macro showStatement statement>
<#-- The query retrieves a type only for Persons. Post-processing will remove all but one. -->
<a href="${profileUrl(statement.uri("object"))}" title="${i18n().name}">${statement.label!statement.localName!}</a>&nbsp; ${statement.title!statement.type!}
</#macro>
<#-- The query retrieves a type only for Persons. Post-processing will remove all but one. -->
<#if statement.subclass??>
<a href="${profileUrl(statement.uri("object"))}" title="${i18n().name}">${statement.label!statement.localName!}</a>
<#else>
<a href="${profileUrl(statement.uri("object"))}" title="${i18n().name}">${statement.label!statement.localName!}</a>&nbsp; ${statement.title!statement.type!}
</#if>
</#macro>

View file

@ -9,11 +9,11 @@
<#if (individual.thumbUrl)??>
<img src="${individual.thumbUrl}" width="90" alt="${individual.name}" />
<h1 class="thumb">
<a href="${individual.profileUrl}" title="${i18n().view_profile_page_for} ${individual.name}}">${individual.name}</a>
<a href="${individual.profileUrl}" title="${i18n().view_profile_page_for} ${individual.name}">${individual.name}</a>
</h1>
<#else>
<h1>
<a href="${individual.profileUrl}" title="${i18n().view_profile_page_for} ${individual.name}}">${individual.name}</a>
<a href="${individual.profileUrl}" title="${i18n().view_profile_page_for} ${individual.name}">${individual.name}</a>
</h1>
</#if>

View file

@ -192,7 +192,7 @@ var i18nStrings = {
authorTypeText: '${i18n().author_capitalized}',
organizationTypeText: '${i18n().organization_capitalized}',
helpTextSelect: '${i18n().select_an_existing}',
helptextAdd: '${i18n().or_add_new_one}'
helpTextAdd: '${i18n().or_add_new_one}'
};
</script>

View file

@ -162,7 +162,7 @@ var i18nStrings = {
removeEditorshipAlert: '${i18n().error_processing_editor_request}',
editorTypeText: '${i18n().editor_capitalized}',
helpTextSelect: '${i18n().select_an_existing}',
helptextAdd: '${i18n().or_add_new_one}'
helpTextAdd: '${i18n().or_add_new_one}'
};
</script>

View file

@ -7,6 +7,10 @@
<#assign sparqlForAcFilter = editConfiguration.pageData.sparqlForAcFilter />
<#--This flag is for clearing the label field on submission for an existing object being selected from autocomplete.
Set this flag on the input acUriReceiver where you would like this behavior to occur. -->
<#assign flagClearLabelForExisting = "flagClearLabelForExisting" />
<h2>${i18n().create_own_concept_all_caps}</h2>
<@lvf.unsupportedBrowser urls.base />
@ -26,7 +30,7 @@
<a href="" class="verifyMatch" title="${i18n().verify_match_capitalized}">(${i18n().verify_match_capitalized}</a> ${i18n().or}
<a href="#" class="changeSelection" id="changeSelection" title="${i18n().change_selection}">${i18n().change_selection})</a>
</p>
<input class="acUriReceiver" type="hidden" id="conceptNode" name="conceptNode" value="" />
<input class="acUriReceiver" type="hidden" id="conceptNode" name="conceptNode" value="" ${flagClearLabelForExisting}="true"/>
</div>
<br />
@ -54,7 +58,8 @@
typeName: 'Concept',
defaultTypeName: 'concept', // used in repair mode to generate button text
baseHref: '${urls.base}/individual?uri=',
limitToConceptClasses:["http://www.w3.org/2004/02/skos/core#Concept"]
limitToConceptClasses:["http://www.w3.org/2004/02/skos/core#Concept"],
flagClearLabelForExisting: '${flagClearLabelForExisting}'
};
var i18nStrings = {
selectAnExisting: '${i18n().select_an_existing}',

View file

@ -39,7 +39,7 @@
<#if (class.uri?contains("FacultyMember")) >
<#assign foundClassGroup = true />
<#if (class.individualCount > 0) >
<script>var facultyMemberCount = ${class.individualCount?string?replace(",","")};</script>
<script>var facultyMemberCount = ${class.individualCount?string?replace(",","")?replace(".","")};</script>
<#else>
<script>var facultyMemberCount = 0;</script>
</#if>
@ -165,8 +165,7 @@ var academicDepartments = [
<#list academicDeptDG as resultRow>
<#assign uri = resultRow["theURI"] />
<#assign label = resultRow["name"] />
<#assign localName = uri?substring(uri?last_index_of("/")) />
{"uri": "${localName}", "name": "${label}"}<#if (resultRow_has_next)>,</#if>
{"uri": "${uri?url}", "name": "${label}"}<#if (resultRow_has_next)>,</#if>
</#list>
</#if>
];

View file

@ -0,0 +1,72 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Macros used to insert microformats into non-foaf person profiles via the individual-vitro.ftl template. -->
<#macro sectionSchema individual>
<#if individual.organization() >
<#list individual.mostSpecificTypes as type >
<#assign mst = type />
<#break>
</#list>
<@getItemType mst "organization"/>
<#elseif individual.event()>
itemscope itemtype="http://schema.org/Event"
<#elseif individual.infoContentEntity()>
<#list individual.mostSpecificTypes as type >
<#assign mst = type />
<#break>
</#list>
<@getItemType mst "infoContentEntity"/>
</#if>
</#macro>
<#macro getItemType type class >
<#-- The itemscope and full itemtype element and value are included here because Freemarker appends leading
and trailing white space to the returned value. -->
<#switch type>
<#case "Article">
itemscope itemtype="http://schema.org/Article"
<#break>
<#case "Academic Article">
itemscope itemtype="http://schema.org/ScholarlyArticle"
<#break>
<#case "Blog">
itemscope itemtype="http://schema.org/Blog"
<#break>
<#case "Blog Posting">
itemscope itemtype="http://schema.org/BlogPosting"
<#break>
<#case "Book">
itemscope itemtype="http://schema.org/Book"
<#break>
<#case "Dataset">
itemscope itemtype="http://schema.org/Dataset"
<#break>
<#case "Periodical">
itemscope itemtype="http://schema.org/Periodical"
<#break>
<#case "Review">
itemscope itemtype="http://schema.org/Review"
<#break>
<#case "Series">
itemscope itemtype="http://schema.org/Series"
<#break>
<#case "Webpage">
itemscope itemtype="http://schema.org/WebPage"
<#break>
<#case "Website">
itemscope itemtype="http://schema.org/WebSite"
<#break>
<#case "College">
itemscope itemtype="http://schema.org/CollegeOrUniversity"
<#break>
<#case "University">
itemscope itemtype="http://schema.org/CollegeOrUniversity"
<#break>
<#default>
<#if class == "organization" >
itemscope itemtype="http://schema.org/Organization"
<#else>
<#-- don't return anything if the info content entity has no matching subclass -->
</#if>
</#switch>
</#macro>

View file

@ -186,7 +186,7 @@
$('#${sparklineContainerID} td.sparkline_number').text(totalPubs).css("font-weight", "bold").attr("class", "grey").append("<span style='color: #2485AE;'> " + pubDisplay + " <br/></span>");
var sparksText = ' ${i18n().from} <span class="sparkline_range">${sparklineVO.earliestYearConsidered?c}'
+ ' ${i18n().to} ${sparklineVO.latestRenderedPublicationYear?c}</span>';
+ ' - ${sparklineVO.latestRenderedPublicationYear?c}</span>';
if (totalPubs !== totalPublicationCount) {
sparksText += ' (' + totalPublicationCount + ' ${i18n().total})';

View file

@ -62,7 +62,7 @@ var i18nStringsCoauthorship = {
coAuthorsString: '${i18n().co_authors_capitalized}',
authorString: '${i18n().author_capitalized}',
publicationsWith: '${i18n().publications_with}',
publicationsString: '${i18n().publication_s_capitalized}',
publicationsString: "${i18n().publications_thru_today}",
coauthorsString: '${i18n().co_author_s_capitalized}'
};
var i18nStringsPersonLvl = {

View file

@ -154,7 +154,7 @@
sparksText += "${i18n().years}";
if (totalPubs !== totalPublicationCount) {
sparksText += ' (' + totalPublicationCount + ' ${i18n().total})' ;
//sparksText += ' (' + totalPublicationCount + ' ${i18n().total})' ;
}
sparksText += "&nbsp;<img class='infoIcon' src='" + infoIconSrc + "' height='16px' width='16px' alt='${i18n().info_icon}' title='${i18n().numbers_based_on_publications_in_vivo}' />" ;
@ -189,7 +189,7 @@
$('#${sparklineContainerID} td.sparkline_number').text(totalPubs).attr("class", "grey-text").append("<span style='color: #2485AE;'> "+ pubDisplay +"<br/></span>");
var sparksText = ' ${i18n().from} <span class="sparkline_range">${sparklineVO.earliestYearConsidered?c}'
+ ' to ${sparklineVO.latestRenderedPublicationYear?c}</span>';
+ ' - ${sparklineVO.latestRenderedPublicationYear?c}</span>';
if (totalPubs !== totalPublicationCount) {
sparksText += ' (' + totalPublicationCount + ' ${i18n().total})';

View file

@ -1,46 +0,0 @@
@prefix : <http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#> .
#
# Specify the SearchIndexExcluders and DocumentModifiers for VIVO.
# These are in addition to the ones specified for VIVO.
#
:vivoSearchExcluder_namespaceExcluder
a <java:edu.cornell.mannlib.vitro.webapp.search.documentBuilding.ExcludeBasedOnNamespace> ,
<java:edu.cornell.mannlib.vitro.webapp.search.documentBuilding.SearchIndexExcluder> ;
:excludes
"http://purl.obolibrary.org/obo/" .
# ------------------------------------
:vivodocumentModifier_calculateParameters
a <java:edu.cornell.mannlib.vitro.webapp.search.documentBuilding.CalculateParameters> ,
<java:edu.cornell.mannlib.vitro.webapp.search.documentBuilding.DocumentModifier> .
:vivodocumentModifier_valuesFromVcards
a <java:edu.cornell.mannlib.vitro.webapp.search.documentBuilding.VIVOValuesFromVcards> ,
<java:edu.cornell.mannlib.vitro.webapp.search.documentBuilding.DocumentModifier> .
:vivodocumentModifier_ISFBasicFields
a <java:edu.cornell.mannlib.vitro.webapp.search.documentBuilding.VivoISFBasicFields> ,
<java:edu.cornell.mannlib.vitro.webapp.search.documentBuilding.DocumentModifier> .
:vivodocumentModifier_ISFAdvisingFields
a <java:edu.cornell.mannlib.vitro.webapp.search.documentBuilding.VivoISFAdvisingFields> ,
<java:edu.cornell.mannlib.vitro.webapp.search.documentBuilding.DocumentModifier> .
:vivodocumentModifier_ISFEducationFields
a <java:edu.cornell.mannlib.vitro.webapp.search.documentBuilding.VivoISFEducationFields> ,
<java:edu.cornell.mannlib.vitro.webapp.search.documentBuilding.DocumentModifier> .
:vivodocumentModifier_ISFGrantFields
a <java:edu.cornell.mannlib.vitro.webapp.search.documentBuilding.VivoISFGrantFields> ,
<java:edu.cornell.mannlib.vitro.webapp.search.documentBuilding.DocumentModifier> .
:vivodocumentModifier_ISFMemberFields
a <java:edu.cornell.mannlib.vitro.webapp.search.documentBuilding.VivoISFMemberFields> ,
<java:edu.cornell.mannlib.vitro.webapp.search.documentBuilding.DocumentModifier> .
:vivodocumentModifier_informationResourceContextNodeFields
a <java:edu.cornell.mannlib.vitro.webapp.search.documentBuilding.VivoInformationResourceContextNodeFields> ,
<java:edu.cornell.mannlib.vitro.webapp.search.documentBuilding.DocumentModifier> .

View file

@ -0,0 +1,92 @@
@prefix : <http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
#
# Specify the SearchIndexExcluders, DocumentModifiers and IndexingUriFinders for VIVO.
# These are in addition to the ones specified for VIVO.
#
:vivoSearchExcluder_namespaceExcluder
a <java:edu.cornell.mannlib.vitro.webapp.searchindex.exclusions.ExcludeBasedOnNamespace> ,
<java:edu.cornell.mannlib.vitro.webapp.searchindex.exclusions.SearchIndexExcluder> ;
:excludes
"http://purl.obolibrary.org/obo/" .
# ------------------------------------
:extension_forContextNodes
a <java:edu.cornell.mannlib.vitro.webapp.searchindex.indexing.IndexingUriFinder> ,
<java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.DocumentModifier> ,
<java:edu.cornell.mannlib.vitro.webapp.searchindex.extensions.LabelsAcrossContextNodes> .
# ------------------------------------
:vivodocumentModifier_calculateParameters
a <java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.CalculateParameters> ,
<java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.DocumentModifier> .
# ------------------------------------
:vivoUriFinder_VCard
a <java:edu.cornell.mannlib.vitro.webapp.searchindex.indexing.IndexingUriFinder> ,
<java:edu.cornell.mannlib.vitro.webapp.searchindex.indexing.SelectQueryUriFinder> ;
rdfs:label "Preferred title" ;
:hasPredicateRestriction "http://www.w3.org/2006/vcard/ns#title" ;
:hasPredicateRestriction "http://www.w3.org/2006/vcard/ns#email" ;
:hasSelectQuery """
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
SELECT ?uri
WHERE {
?uri obo:ARG_2000028 ?card .
?card a vcard:Individual .
?card vcard:hasTitle ?subject .
}
""" ;
:hasSelectQuery """
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
SELECT ?uri
WHERE {
?uri obo:ARG_2000028 ?card .
?card a vcard:Individual .
?card vcard:hasEmail ?subject .
}
""" .
:vivodocumentModifier_PreferredTitle
a <java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.SelectQueryDocumentModifier> ,
<java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.DocumentModifier> ;
rdfs:label "Preferred title" ;
:hasTargetField "ALLTEXT" ;
:hasTargetField "ALLTEXTUNSTEMMED" ;
:hasTargetField "PREFERRED_TITLE" ;
:hasSelectQuery """
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
SELECT ?title
WHERE {
?uri obo:ARG_2000028 ?card .
?card a vcard:Individual .
?card vcard:hasTitle ?titleHolder .
?titleHolder vcard:title ?title .
}
""" .
:vivodocumentModifier_EmailAddress
a <java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.SelectQueryDocumentModifier> ,
<java:edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.DocumentModifier> ;
rdfs:label "Email address" ;
:hasSelectQuery """
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
SELECT ?email
WHERE {
?uri obo:ARG_2000028 ?card .
?card a vcard:Individual .
?card vcard:hasEmail ?emailHolder .
?emailHolder vcard:email ?email .
}
""" .

View file

@ -23,6 +23,7 @@ local:personInPositionContext a :ConfigContext ;
:qualifiedBy vivo:Position .
local:personInPositionConfig a :ObjectPropertyDisplayConfig ;
rdfs:label "personInPosition"@en-US;
:displayName "positions" ;
:listViewConfigFile "listViewConfig-personInPosition.xml"^^xsd:string ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGroupaffiliation> ;
@ -39,6 +40,7 @@ local:organizationForPositionContext a :ConfigContext ;
:qualifiedBy vivo:Position .
local:organizationForPositionConfig a :ObjectPropertyDisplayConfig ;
rdfs:label "organizationForPosition"@en-US;
:displayName "people" ;
:listViewConfigFile "listViewConfig-organizationForPosition.xml"^^xsd:string ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGroupaffiliation> ;
@ -57,6 +59,7 @@ local:authorInAuthorshipContext a :ConfigContext ;
local:authorInAuthorshipConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-authorInAuthorship.xml"^^xsd:string ;
rdfs:label "authorInAuthorship"@en-US;
:displayName "selected publications" ;
vitro:collateBySubclassAnnot
"true"^^xsd:boolean;
@ -74,6 +77,7 @@ local:orgInAuthorshipContext a :ConfigContext ;
local:orgInAuthorshipConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-authorInAuthorship.xml"^^xsd:string ;
rdfs:label "organizationInAuthorship"@en-US;
:displayName "selected publications" ;
vitro:collateBySubclassAnnot
"true"^^xsd:boolean;
@ -93,7 +97,8 @@ local:hasServiceProviderRoleContext a :ConfigContext ;
local:hasServiceProviderRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-roleContributesTo.xml"^^xsd:string ;
:displayName "professional service activities" ;
rdfs:label "hasServiceProviderRole"@en-US;
:displayName "professional service activities" ;
vitro:displayRankAnnot 32;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
@ -109,6 +114,7 @@ local:hasClinicalRoleContext a :ConfigContext ;
local:hasClinicalRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-hasClinicalActivity.xml"^^xsd:string ;
rdfs:label "hasClinicalRole"@en-US;
:displayName "clinical activities" ;
vitro:displayRankAnnot 70;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -125,6 +131,7 @@ local:orgHasClinicalRoleContext a :ConfigContext ;
local:orgHasClinicalRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-hasClinicalActivity.xml"^^xsd:string ;
rdfs:label "organizationHasClinicalRole"@en-US;
:displayName "clinical activities" ;
vitro:displayRankAnnot 70;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -141,6 +148,7 @@ local:hasLeaderRoleContext a :ConfigContext ;
local:hasLeaderRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-roleContributesTo.xml"^^xsd:string ;
rdfs:label "hasLeaderRole"@en-US;
:displayName "head of" ;
vitro:displayRankAnnot 30;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -157,6 +165,7 @@ local:orgHasLeaderRoleContext a :ConfigContext ;
local:orgHasLeaderRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-roleContributesTo.xml"^^xsd:string ;
rdfs:label "organizationHasLeaderRole"@en-US;
:displayName "lead organization of" ;
vitro:displayRankAnnot 30;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -173,6 +182,7 @@ local:hasMemberRoleContext a :ConfigContext ;
local:hasMemberRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-roleContributesTo.xml"^^xsd:string ;
rdfs:label "hasMemberRole"@en-US;
:displayName "member of" ;
vitro:displayRankAnnot 50;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -189,6 +199,7 @@ local:orgHasMemberRoleContext a :ConfigContext ;
local:orgHasMemberRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-roleContributesTo.xml"^^xsd:string ;
rdfs:label "organizationHasMemberRole"@en-US;
:displayName "member of" ;
vitro:displayRankAnnot 50;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -205,6 +216,7 @@ local:hasTeacherRoleContext a :ConfigContext ;
local:hasTeacherRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-roleRealizedIn.xml"^^xsd:string ;
rdfs:label "hasTeacherRole"@en-US;
:displayName "teaching activities" ;
vitro:displayRankAnnot 20;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -221,6 +233,7 @@ local:hasEditorRoleContext a :ConfigContext ;
local:hasEditorRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-hasEditorRole.xml"^^xsd:string ;
rdfs:label "hasEditorRole"@en-US;
:displayName "collection or series editor for" ;
vitro:displayRankAnnot 15;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -237,6 +250,7 @@ local:groupHasEditorRoleContext a :ConfigContext ;
local:groupHasEditorRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-hasEditorRole.xml"^^xsd:string ;
rdfs:label "groupHasEditorRole"@en-US;
:displayName "collection or series editorial group for" ;
vitro:displayRankAnnot 15;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -253,6 +267,7 @@ local:hasReviewerRoleContext a :ConfigContext ;
local:hasReviewerRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-hasReviewerRole.xml"^^xsd:string ;
rdfs:label "hasReviewerRole"@en-US;
:displayName "reviewer of" ;
vitro:displayRankAnnot 18;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -269,6 +284,7 @@ local:hasOrganizerRoleContext a :ConfigContext ;
local:hasOrganizerRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-roleRealizedIn.xml"^^xsd:string ;
rdfs:label "hasOrganizerRole"@en-US;
:displayName "organizer of event" ;
vitro:displayRankAnnot 27;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -285,6 +301,7 @@ local:orgHasOrganizerRoleContext a :ConfigContext ;
local:orgHasOrganizerRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-roleRealizedIn.xml"^^xsd:string ;
rdfs:label "orgHasOrganizerRole"@en-US;
:displayName "convener of event" ;
vitro:displayRankAnnot 80;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -301,6 +318,7 @@ local:hasOutreachProviderRoleContext a :ConfigContext ;
local:hasOutreachProviderRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-roleContributesTo.xml"^^xsd:string ;
rdfs:label "hasOutreachProviderRole"@en-US;
:displayName "outreach and community service activities" ;
vitro:displayRankAnnot 50;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -317,6 +335,7 @@ local:orgHasOutreachProviderRoleContext a :ConfigContext ;
local:orgHasOutreachProviderRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-roleContributesTo.xml"^^xsd:string ;
rdfs:label "orgHasOutreachProviderRole"@en-US;
:displayName "outreach and community service activities" ;
vitro:displayRankAnnot 50;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -333,6 +352,7 @@ local:hasAttendeeRoleContext a :ConfigContext ;
local:hasAttendeeRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-hasAttendeeRole.xml"^^xsd:string ;
rdfs:label "hasAttendeeRole"@en-US;
:displayName "attended event" ;
vitro:displayRankAnnot 85;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -349,6 +369,7 @@ local:orgHasAttendeeRoleContext a :ConfigContext ;
local:orgHasAttendeeRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-hasAttendeeRole.xml"^^xsd:string ;
rdfs:label "orgHasAttendeeRole"@en-US;
:displayName "attended event" ;
vitro:displayRankAnnot 85;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -365,6 +386,7 @@ local:hasResearcherRoleContext a :ConfigContext ;
local:hasResearcherRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-researchActivities.xml"^^xsd:string ;
rdfs:label "hasResearcherRole"@en-US;
:displayName "other research activities" ;
vitro:displayRankAnnot 35;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -381,6 +403,7 @@ local:hasInvestigatorRoleContext a :ConfigContext ;
local:hasInvestigatorRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-hasInvestigatorRole.xml"^^xsd:string ;
rdfs:label "hasInvestigatorRole"@en-US;
:displayName "investigator on" ;
vitro:displayRankAnnot 30;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -396,6 +419,7 @@ local:hasPrincipalInvestigatorRoleContext a :ConfigContext ;
local:hasPrincipalInvestigatorRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-hasPrincipalInvestigatorRole.xml"^^xsd:string ;
rdfs:label "hasPrincipalInvestigatorRole"@en-US;
:displayName "principal investigator on" ;
vitro:displayRankAnnot 20;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -411,6 +435,7 @@ local:hasCo-PrincipalInvestigatorRoleContext a :ConfigContext ;
local:hasCo-PrincipalInvestigatorRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-hasCoPrincipalInvestigatorRole.xml"^^xsd:string ;
rdfs:label "hasCo-PrincipalInvestigatorRole"@en-US;
:displayName "co-principal investigator on" ;
vitro:displayRankAnnot 25;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -426,6 +451,7 @@ local:hasPresenterRoleContext a :ConfigContext ;
local:hasPresenterRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-hasPresenterRole.xml"^^xsd:string ;
rdfs:label "hasPresenterRole"@en-US;
:displayName "presentations" ;
vitro:collateBySubclassAnnot
"true"^^xsd:boolean;
@ -443,6 +469,7 @@ local:orgHasPresenterRoleContext a :ConfigContext ;
local:orgHasPresenterRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-hasPresenterRole.xml"^^xsd:string ;
rdfs:label "organizationHasPresenterRole"@en-US;
:displayName "presentations" ;
vitro:collateBySubclassAnnot
"true"^^xsd:boolean;
@ -462,6 +489,7 @@ local:awardOrHonorContext a :ConfigContext ;
local:awardOrHonorConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-awardOrHonor.xml"^^xsd:string ;
rdfs:label "awardOrHonor"@en-US;
:displayName "awards and honors" ;
vitro:displayRankAnnot 20;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -477,6 +505,7 @@ local:orgHasAwardOrHonorContext a :ConfigContext ;
local:orgHasAwardOrHonorConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-awardOrHonor.xml"^^xsd:string ;
rdfs:label "organizationHasAwardOrHonor"@en-US;
:displayName "awards and honors received" ;
vitro:displayRankAnnot 75;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -492,6 +521,7 @@ local:educationalTrainingContext a :ConfigContext ;
local:educationalTrainingConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-educationalTraining.xml"^^xsd:string ;
rdfs:label "educationalTraining"@en-US;
:displayName "education and training" ;
vitro:displayRankAnnot 10;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -508,6 +538,7 @@ local:educationalProcessPersonContext a :ConfigContext ;
local:educationalProcessPersonConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "educationalProcessPerson"@en-US;
:displayName "education and training of" ;
vitro:displayRankAnnot 10;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -523,6 +554,7 @@ local:educationalProcessOrgContext a :ConfigContext ;
local:educationalProcessOrgConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "educationalProcessOrganization"@en-US;
:displayName "educational organization" ;
vitro:displayRankAnnot 15;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -538,6 +570,7 @@ local:educationalProcessDegreeContext a :ConfigContext ;
local:educationalProcessDegreeConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-degreeEarned.xml"^^xsd:string ;
rdfs:label "educationalProcessDegree"@en-US;
:displayName "degree earned" ;
vitro:displayRankAnnot 20;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -553,6 +586,7 @@ local:organizationForTrainingContext a :ConfigContext ;
local:organizationForTrainingConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-organizationForTraining.xml"^^xsd:string ;
rdfs:label "organizationForTraining"@en-US;
:displayName "organization for training" ;
vitro:displayRankAnnot 1;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:nobody ;
@ -568,6 +602,7 @@ local:adviseeRoleContext a :ConfigContext ;
local:adviseeRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-adviseeIn.xml"^^xsd:string ;
rdfs:label "adviseeRole"@en-US;
:displayName "advisee of" ;
vitro:collateBySubclassAnnot
"true"^^xsd:boolean;
@ -585,6 +620,7 @@ local:advisorRoleContext a :ConfigContext ;
local:advisorRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-advisorIn.xml"^^xsd:string ;
rdfs:label "advisorRole"@en-US;
:displayName "advisees" ;
vitro:collateBySubclassAnnot
"true"^^xsd:boolean;
@ -602,6 +638,7 @@ local:informationResourceInAuthorshipContext a :ConfigContext ;
local:informationResourceInAuthorshipConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-informationResourceInAuthorship.xml"^^xsd:string ;
rdfs:label "informationResourceInAuthorship"@en-US;
:displayName "authors" ;
vitro:displayRankAnnot 10;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -617,6 +654,7 @@ local:informationResourceInEditorshipContext a :ConfigContext ;
local:informationResourceInEditorshipConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-informationResourceInEditorship.xml"^^xsd:string ;
rdfs:label "informationResourceInEditorship"@en-US;
:displayName "editors" ;
vitro:displayRankAnnot 12;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -632,6 +670,7 @@ local:editorOfContext a :ConfigContext ;
local:editorOfConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-editorship.xml"^^xsd:string ;
rdfs:label "editorOf"@en-US;
:displayName "editor of" ;
vitro:displayRankAnnot 20;
vitro:collateBySubclassAnnot
@ -649,6 +688,7 @@ local:issuedCredentialContext a :ConfigContext ;
local:issuedCredentialConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-issuedCredential.xml"^^xsd:string ;
rdfs:label "issuedCredential"@en-US;
:displayName "credentials" ;
vitro:displayRankAnnot 12;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -664,6 +704,7 @@ local:grantAdministeredByContext a :ConfigContext ;
local:grantAdministeredByConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-grantAdministeredBy.xml"^^xsd:string ;
rdfs:label "grantAdministeredBy"@en-US;
:displayName "administered by" ;
vitro:displayRankAnnot 16;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -679,6 +720,7 @@ local:contractAdministeredByContext a :ConfigContext ;
local:contractAdministeredByConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-grantAdministeredBy.xml"^^xsd:string ;
rdfs:label "contractAdministeredBy"@en-US;
:displayName "administered by" ;
vitro:displayRankAnnot 16;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -693,6 +735,7 @@ local:orgAdministersGrantContext a :ConfigContext ;
local:orgAdministersGrantConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-organizationAdministersGrant.xml"^^xsd:string ;
rdfs:label "orgAdministersGrant"@en-US;
:displayName "administers grant" ;
vitro:displayRankAnnot 62;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -716,6 +759,7 @@ local:hasCollaboratorConfig a :ObjectPropertyDisplayConfig ;
vitro:customEntryFormAnnot
"edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AutocompleteObjectPropertyFormGenerator"^^xsd:string ;
# :listViewConfigFile "listViewConfig-roleRealizedIn.xml"^^xsd:string ;
rdfs:label "hasCollaborator"@en-US;
:displayName "has collaborator" ;
vitro:displayLimitAnnot
"5"^^xsd:int ;
@ -742,6 +786,7 @@ local:orgHasCollaboratorConfig a :ObjectPropertyDisplayConfig ;
vitro:customEntryFormAnnot
"edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AutocompleteObjectPropertyFormGenerator"^^xsd:string ;
# :listViewConfigFile "listViewConfig-roleRealizedIn.xml"^^xsd:string ;
rdfs:label "organizationHasCollaborator"@en-US;
:displayName "has collaborating organization or group" ;
vitro:displayLimitAnnot
"5"^^xsd:int ;
@ -770,6 +815,7 @@ local:mailingAddressContext a :ConfigContext ;
local:mailingAddressConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-mailingAddress.xml"^^xsd:string ;
rdfs:label "mailingAddress"@en-US;
:displayName "mailing address" ;
vitro:displayRankAnnot 29;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -786,6 +832,7 @@ local:mailingAddressOrgContext a :ConfigContext ;
local:mailingAddressOrgConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-mailingAddress.xml"^^xsd:string ;
rdfs:label "mailingAddressOrganization"@en-US;
:displayName "mailing address" ;
vitro:displayRankAnnot 29;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -802,6 +849,7 @@ local:personTelephoneContext a :ConfigContext ;
local:personTelephoneConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-telephoneNumber.xml"^^xsd:string ;
rdfs:label "personTelephone"@en-US;
:displayName "phone" ;
vitro:displayRankAnnot 60;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -818,6 +866,7 @@ local:orgTelephoneContext a :ConfigContext ;
local:orgTelephoneConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-telephoneNumber.xml"^^xsd:string ;
rdfs:label "organizationTelephone"@en-US;
:displayName "phone" ;
vitro:displayRankAnnot 10;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -834,6 +883,7 @@ local:personFaxContext a :ConfigContext ;
local:personFaxConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-faxNumber.xml"^^xsd:string ;
rdfs:label "personFax"@en-US;
:displayName "fax" ;
vitro:displayRankAnnot 60;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -850,6 +900,7 @@ local:orgFaxContext a :ConfigContext ;
local:orgFaxConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-faxNumber.xml"^^xsd:string ;
rdfs:label "organizationFax"@en-US;
:displayName "fax" ;
vitro:displayRankAnnot 20;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -866,6 +917,7 @@ local:additionalEmailContext a :ConfigContext ;
local:additionalEmailConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-additionalEmail.xml"^^xsd:string ;
rdfs:label "additionalEmail"@en-US;
:displayName "additional emails" ;
vitro:displayRankAnnot 30;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -882,6 +934,7 @@ local:organizationEmailContext a :ConfigContext ;
local:organizationEmailConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-additionalEmail.xml"^^xsd:string ;
rdfs:label "organizationEmail"@en-US;
:displayName "email address" ;
vitro:displayRankAnnot 28;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -898,6 +951,7 @@ local:primaryEmailContext a :ConfigContext ;
local:primaryEmailConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-primaryEmail.xml"^^xsd:string ;
rdfs:label "primaryEmail"@en-US;
:displayName "primary email" ;
vitro:displayRankAnnot 20;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -914,6 +968,7 @@ local:webpagePersonContext a :ConfigContext ;
local:webpagePersonConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-webpage.xml"^^xsd:string ;
rdfs:label "webpagePerson"@en-US;
:displayName "webpage" ;
vitro:displayRankAnnot 40;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -930,6 +985,7 @@ local:webpageOrgContext a :ConfigContext ;
local:webpageOrgConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-webpage.xml"^^xsd:string ;
rdfs:label "webpageOrganization"@en-US;
:displayName "webpage" ;
vitro:displayRankAnnot 40;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -946,6 +1002,7 @@ local:webpageInfoContext a :ConfigContext ;
local:webpageInfoConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-webpage.xml"^^xsd:string ;
rdfs:label "webpageInfo"@en-US;
:displayName "webpage" ;
vitro:displayRankAnnot 40;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1009,6 +1066,23 @@ local:webpageEventContext a :ConfigContext ;
:qualifiedBy <http://www.w3.org/2006/vcard/ns#URL> .
local:webpageEventConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-webpage.xml"^^xsd:string ;
rdfs:label "webpageEvent"@en-US;
:displayName "webpage" ;
vitro:displayRankAnnot 40;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.ManageWebpagesForIndividualGenerator"^^<http://www.w3.org/2001/XMLSchema#string> ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGroupoverview> .
local:webpageEventSeriesContext a :ConfigContext ;
:hasConfiguration local:webpageEventSeriesConfig ;
:configContextFor <http://purl.obolibrary.org/obo/ARG_2000028> ;
:qualifiedByDomain <http://vivoweb.org/ontology/core#EventSeries> ;
:qualifiedByRoot <http://www.w3.org/2006/vcard/ns#Kind> ;
:qualifiedBy <http://www.w3.org/2006/vcard/ns#URL> .
local:webpageEventSeriesConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-webpage.xml"^^xsd:string ;
:displayName "webpage" ;
vitro:displayRankAnnot 40;
@ -1026,6 +1100,7 @@ local:fullNameContext a :ConfigContext ;
local:fullNameConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fullName.xml"^^xsd:string ;
rdfs:label "fullName"@en-US;
:displayName "full name" ;
vitro:displayRankAnnot 10;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1042,6 +1117,7 @@ local:preferredTitleContext a :ConfigContext ;
local:preferredTitleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-preferredTitle.xml"^^xsd:string ;
rdfs:label "preferredTitle"@en-US;
:displayName "preferred title" ;
vitro:displayRankAnnot 8;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1059,6 +1135,7 @@ local:outputOfContext a :ConfigContext ;
:qualifiedBy obo:BFO_0000015 . # Process
local:outputOfConfig a :ObjectPropertyDisplayConfig ;
rdfs:label "outputOf"@en-US;
:displayName "output of process or event" ;
vitro:displayRankAnnot 80 ;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1075,6 +1152,7 @@ local:hasOutputContext a :ConfigContext ;
local:hasOutputConfig a :ObjectPropertyDisplayConfig ;
rdfs:label "hasOutput"@en-US;
:displayName "output publications or other works" ;
vitro:displayRankAnnot 80 ;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1092,6 +1170,7 @@ local:credentialOfContext a :ConfigContext ;
local:credentialOfConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "credentialOf"@en-US;
:displayName "credential of" ;
vitro:displayRankAnnot 6;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1102,10 +1181,11 @@ local:documentHasPartContext a :ConfigContext ;
:hasConfiguration local:documentHasPartConfig ;
:configContextFor <http://purl.obolibrary.org/obo/BFO_0000051> ;
:qualifiedByDomain <http://purl.org/ontology/bibo/Document> ;
:qualifiedBy <http://purl.org/ontology/bibo/DocumentPart> .
:qualifiedBy <http://purl.org/ontology/bibo/Document> .
local:documentHasPartConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "documentHasPart"@en-US;
:displayName "has document part" ;
vitro:displayRankAnnot 51;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1122,6 +1202,7 @@ local:documentPartOfContext a :ConfigContext ;
local:documentPartOfConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "documentPartOf"@en-US;
:displayName "part of other document" ;
vitro:displayRankAnnot 52;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1138,6 +1219,7 @@ local:geographicLocationContainsLocationContext a :ConfigContext ;
local:geographicLocationContainsLocationConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "geographicLocationContainsLocation"@en-US;
:displayName "has part" ;
vitro:displayRankAnnot 81;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1154,6 +1236,7 @@ local:geographicLocationWithinLocationContext a :ConfigContext ;
local:geographicLocationWithinLocationConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "geographicLocationWithinLocation"@en-US;
:displayName "part of" ;
vitro:displayRankAnnot 82;
vitro:selectFromExistingAnnot "true"^^xsd:boolean ;
@ -1170,6 +1253,7 @@ local:hasSubOrganizationContext a :ConfigContext ;
local:hasSubOrganizationConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "hasSubOrganization"@en-US;
:displayName "has sub-organization" ;
vitro:displayRankAnnot 15;
vitro:selectFromExistingAnnot "true"^^xsd:boolean ;
@ -1186,6 +1270,7 @@ local:subOrganizationWithinContext a :ConfigContext ;
local:subOrganizationWithinConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "subOrganizationWithin"@en-US;
:displayName "organization within" ;
vitro:displayRankAnnot 20;
vitro:selectFromExistingAnnot "true"^^xsd:boolean ;
@ -1202,6 +1287,7 @@ local:eventWithinContext a :ConfigContext ;
local:eventWithinConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "eventWithin"@en-US;
:displayName "occurs within event" ;
vitro:displayRankAnnot 15;
vitro:selectFromExistingAnnot "true"^^xsd:boolean ;
@ -1218,6 +1304,7 @@ local:includesEventContext a :ConfigContext ;
local:includesEventConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "includesEvent"@en-US;
:displayName "includes event" ;
vitro:displayRankAnnot 16;
vitro:selectFromExistingAnnot "true"^^xsd:boolean ;
@ -1234,6 +1321,7 @@ local:inEventSeriesContext a :ConfigContext ;
local:inEventSeriesConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "inEventSeries"@en-US;
:displayName "in event series" ;
vitro:displayRankAnnot 17;
vitro:selectFromExistingAnnot "true"^^xsd:boolean ;
@ -1250,6 +1338,7 @@ local:eventsForSeriesContext a :ConfigContext ;
local:eventsForSeriesConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "eventsForSeries"@en-US;
:displayName "events in this series" ;
vitro:displayRankAnnot 18;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1266,6 +1355,7 @@ local:eventLocationContext a :ConfigContext ;
local:eventLocationConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "eventLocation"@en-US;
:displayName "held in geographic location" ;
vitro:displayRankAnnot 30;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1282,6 +1372,7 @@ local:eventInFacilityContext a :ConfigContext ;
local:eventInFacilityConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "eventInFacility"@en-US;
:displayName "held in facility" ;
vitro:displayRankAnnot 29;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1298,6 +1389,7 @@ local:agentInGeoLocationContext a :ConfigContext ;
local:agentInGeoLocationConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "agentInGeoLocation"@en-US;
:displayName "geographic location" ;
vitro:displayRankAnnot 30;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1314,6 +1406,7 @@ local:agentInFacilityContext a :ConfigContext ;
local:agentInFacilityConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "agentInFacility"@en-US;
:displayName "located in facility" ;
vitro:displayRankAnnot 32;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1330,6 +1423,7 @@ local:materialEntityInFacilityContext a :ConfigContext ;
local:materialEntityInFacilityConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "materialEntityInFacility"@en-US;
:displayName "housed in facility" ;
vitro:displayRankAnnot 2;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1346,6 +1440,7 @@ local:hasRoomContext a :ConfigContext ;
local:hasRoomConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "hasRoom"@en-US;
:displayName "rooms" ;
vitro:displayRankAnnot 30;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1362,6 +1457,7 @@ local:roomWithinBuildingContext a :ConfigContext ;
local:roomWithinBuildingConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "roomWithinBuilding"@en-US;
:displayName "within building" ;
vitro:displayRankAnnot 23;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1379,6 +1475,7 @@ local:geographicLocationContainsBuildingContext a :ConfigContext ;
local:geographicLocationContainsBuildingConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "geographicLocationContainsBuilding"@en-US;
:displayName "location of facility" ;
vitro:displayRankAnnot 85;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1395,6 +1492,7 @@ local:siteGeographicallyWithinGeoLocationContext a :ConfigContext ;
local:siteGeographicallyWithinGeoLocationConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "siteGeographicallyWithinGeoLocation"@en-US;
:displayName "geographically within" ;
vitro:displayRankAnnot 40;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1411,6 +1509,7 @@ local:facilitySiteOfEventContext a :ConfigContext ;
local:facilitySiteOfEventConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "facilitySiteOfEvent"@en-US;
:displayName "facility for event" ;
vitro:displayRankAnnot 22;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1427,6 +1526,7 @@ local:facilitySiteOfAgentContext a :ConfigContext ;
local:facilitySiteOfAgentConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "facilitySiteOfAgent"@en-US;
:displayName "facility for person, group, or organization" ;
vitro:displayRankAnnot 20;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1444,6 +1544,7 @@ local:facilitySiteOfAgentConfig a :ObjectPropertyDisplayConfig ;
#local:projectUsesMaterialEntityConfig a :ObjectPropertyDisplayConfig ;
# :listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
# rdfs:label "projectUsesMaterialEntity"@en-US;
# :displayName "uses specimen, equipment, instrument, organism, reagent, or software" ;
# vitro:displayRankAnnot 85;
# vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1460,6 +1561,7 @@ local:facilitySiteOfAgentConfig a :ObjectPropertyDisplayConfig ;
#local:materialEntityUsedByProjectConfig a :ObjectPropertyDisplayConfig ;
# :listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
# rdfs:label "materialEntityUsedByProject"@en-US;
# :displayName "used by project" ;
# vitro:displayRankAnnot 85;
# vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1476,6 +1578,7 @@ local:facilityLocationOfEquipmentContext a :ConfigContext ;
local:facilityLocationOfEquipmentConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "facilityLocationOfEquipment"@en-US;
:displayName "location of equipment or instrument" ;
vitro:displayRankAnnot 14;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1492,6 +1595,7 @@ local:facilityLocationOfServiceContext a :ConfigContext ;
local:facilityLocationOfServiceConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "facilityLocationOfService"@en-US;
:displayName "facility for service" ;
vitro:displayRankAnnot 18;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1509,6 +1613,7 @@ local:courseOfferedByContext a :ConfigContext ;
local:courseOfferedByConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "courseOfferedBy"@en-US;
:displayName "offered by" ;
vitro:displayRankAnnot 2;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1525,6 +1630,7 @@ local:orgOffersCourseContext a :ConfigContext ;
local:orgOffersCourseConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "organizationOffersCourse"@en-US;
:displayName "offers course" ;
vitro:displayRankAnnot 90;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1541,6 +1647,7 @@ local:collegeOffersDegreeContext a :ConfigContext ;
local:collegeOffersDegreeConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "collegeOffersDegree"@en-US;
:displayName "offers degree" ;
vitro:displayRankAnnot 12;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1555,6 +1662,7 @@ local:deptOffersDegreeContext a :ConfigContext ;
local:deptOffersDegreeConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "deptOffersDegree"@en-US;
:displayName "offers degree" ;
vitro:displayRankAnnot 2;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1569,6 +1677,7 @@ local:uniOffersDegreeContext a :ConfigContext ;
local:uniOffersDegreeConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "universityOffersDegree"@en-US;
:displayName "offers degree" ;
vitro:displayRankAnnot 2;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1583,6 +1692,7 @@ local:labOffersServiceContext a :ConfigContext ;
local:labOffersServiceConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "labOffersService"@en-US;
:displayName "offers service" ;
vitro:displayRankAnnot 2;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1598,6 +1708,7 @@ local:grantAwardedByContext a :ConfigContext ;
local:grantAwardedByConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "grantAwardedBy"@en-US;
:displayName "awarded by" ;
vitro:displayRankAnnot 14;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1613,6 +1724,7 @@ local:contractAwardedByContext a :ConfigContext ;
local:contractAwardedByConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "contractAwardedBy"@en-US;
:displayName "awarded by" ;
vitro:displayRankAnnot 14;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1628,6 +1740,7 @@ local:grantSubjectAreaContext a :ConfigContext ;
local:grantSubjectAreaConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "grantSubjectArea"@en-US;
:displayName "has subject area" ;
vitro:displayRankAnnot 10;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1642,6 +1755,7 @@ local:grantHasSubgrantContext a :ConfigContext ;
local:grantHasSubgrantConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "grantHasSubgrant"@en-US;
:displayName "has sub grant" ;
vitro:displayRankAnnot 30;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1658,6 +1772,7 @@ local:grantIsSubgrantOfContext a :ConfigContext ;
local:grantIsSubgrantOfConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "grantIsSubgrantOf"@en-US;
:displayName "sub grant of" ;
vitro:displayRankAnnot 32;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1674,6 +1789,7 @@ local:grantGeographicFocusContext a :ConfigContext ;
local:grantGeographicFocusConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "grantGeographicFocus"@en-US;
:displayName "geographic focus" ;
vitro:displayRankAnnot 20;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1690,6 +1806,7 @@ local:awardOrHonorReceiptsContext a :ConfigContext ;
local:awardOrHonorReceiptsConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "awardOrHonorReceipts"@en-US;
:displayName "receipts" ;
vitro:displayRankAnnot 3;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1704,6 +1821,7 @@ local:awardReceiptsContext a :ConfigContext ;
local:awardReceiptsConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "awardReceipts"@en-US;
:displayName "receipt of" ;
vitro:displayRankAnnot 1;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1718,6 +1836,7 @@ local:awardReceiptsAwardForContext a :ConfigContext ;
local:awardReceiptsAwardForConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "awardReceiptsAwardFor"@en-US;
:displayName "award or honor for" ;
vitro:displayRankAnnot 2;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1732,6 +1851,7 @@ local:awardOrHonorGivenContext a :ConfigContext ;
local:awardOrHonorGivenConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-awardOrHonorGiven.xml"^^xsd:string ;
rdfs:label "awardOrHonorGiven"@en-US;
:displayName "award or honor given" ;
vitro:displayRankAnnot 72;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1746,6 +1866,7 @@ local:awardConferredByContext a :ConfigContext ;
local:awardConferredByConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "awardConferredBy"@en-US;
:displayName "award conferred by" ;
vitro:displayRankAnnot 3;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1760,6 +1881,7 @@ local:orgAwardsGrantContext a :ConfigContext ;
local:orgAwardsGrantConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-organizationAwardsGrant.xml"^^xsd:string ;
rdfs:label "orgAwardsGrant"@en-US;
:displayName "awards grant" ;
vitro:displayRankAnnot 60;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1775,6 +1897,7 @@ local:addressLocationContext a :ConfigContext ;
local:addressLocationConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-fauxPropertyDefault.xml"^^xsd:string ;
rdfs:label "addressLocation"@en-US;
:displayName "has geographic location" ;
vitro:displayRankAnnot 2;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1791,6 +1914,7 @@ local:bfo_0000055Context a :ConfigContext ;
local:bfo_0000055Config a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-relatedRole.xml"^^xsd:string ;
rdfs:label "relatedRole"@en-US;
:displayName "participant" ;
vitro:displayRankAnnot 17;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1808,6 +1932,7 @@ local:grantRelatesContext a :ConfigContext ;
local:grantRelatesConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-relatedRole.xml"^^xsd:string ;
rdfs:label "grantRelates"@en-US;
:displayName "contributor" ;
vitro:displayRankAnnot 55;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1823,6 +1948,7 @@ local:contractRelatesContext a :ConfigContext ;
local:contractRelatesConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-relatedRole.xml"^^xsd:string ;
rdfs:label "contractRelates"@en-US;
:displayName "contributor" ;
vitro:displayRankAnnot 55;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1840,6 +1966,7 @@ local:publicationDateContext a :ConfigContext ;
local:publicationDateConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-dateTimeValue.xml"^^xsd:string ;
rdfs:label "publicationDate"@en-US;
:displayName "publication date" ;
vitro:displayRankAnnot 17;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
@ -1854,6 +1981,7 @@ local:yearAwardedContext a :ConfigContext ;
local:yearAwardedConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-dateTimeValue.xml"^^xsd:string ;
rdfs:label "yearAwarded"@en-US;
:displayName "year awarded" ;
vitro:displayRankAnnot 10;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;

View file

@ -540,7 +540,7 @@
<owl:equivalentClass>
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<owl:unionOf rdf:parseType="Collection">
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<owl:Restriction>
@ -589,7 +589,7 @@
</owl:Restriction>
</owl:intersectionOf>
</owl:Class>
</owl:intersectionOf>
</owl:unionOf>
</owl:Class>
</owl:equivalentClass>
<rdfs:comment rdf:datatype="http://www.w3.org/2001/XMLSchema#string">These types are concerned with information related to the delivery addressing or label for the vCard object</rdfs:comment>
@ -786,7 +786,7 @@ Was called CALADRURI in vCard</rdfs:comment>
<owl:equivalentClass>
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<owl:unionOf rdf:parseType="Collection">
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<owl:Restriction>
@ -835,7 +835,7 @@ Was called CALADRURI in vCard</rdfs:comment>
</owl:Restriction>
</owl:intersectionOf>
</owl:Class>
</owl:intersectionOf>
</owl:unionOf>
</owl:Class>
</owl:equivalentClass>
<rdfs:comment rdf:datatype="http://www.w3.org/2001/XMLSchema#string">These properties describe information about how to communicate with the object the vCard represents</rdfs:comment>
@ -927,7 +927,7 @@ Was called CALADRURI in vCard</rdfs:comment>
<owl:equivalentClass>
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<owl:unionOf rdf:parseType="Collection">
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<owl:Restriction>
@ -976,7 +976,7 @@ Was called CALADRURI in vCard</rdfs:comment>
</owl:Restriction>
</owl:intersectionOf>
</owl:Class>
</owl:intersectionOf>
</owl:unionOf>
</owl:Class>
</owl:equivalentClass>
<rdfs:comment rdf:datatype="http://www.w3.org/2001/XMLSchema#string">These properties are concerned with additional explanations, such as that related to informational notes or revisions specific to the vCard</rdfs:comment>
@ -1131,7 +1131,7 @@ Was called CALADRURI in vCard</rdfs:comment>
<owl:equivalentClass>
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<owl:unionOf rdf:parseType="Collection">
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<owl:Restriction>
@ -1180,7 +1180,7 @@ Was called CALADRURI in vCard</rdfs:comment>
</owl:Restriction>
</owl:intersectionOf>
</owl:Class>
</owl:intersectionOf>
</owl:unionOf>
</owl:Class>
</owl:equivalentClass>
<rdfs:comment rdf:datatype="http://www.w3.org/2001/XMLSchema#string">These types are used to capture information associated with the identification and naming of the entity associated with the vCard</rdfs:comment>

View file

@ -520,7 +520,7 @@ geo:hasMinLongitude
<http://vitro.mannlib.cornell.edu/ns/vitro/role#public> .
bibo:Manuscript
rdfs:label "manuscript"@en-US , "Manuscript"@en-US ;
rdfs:label "manuscript"@en-US ;
vitro:displayLimitAnnot
"-1"^^xsd:int ;
vitro:displayRankAnnot
@ -535,7 +535,7 @@ bibo:Manuscript
owl:sameAs
a owl:ObjectProperty ;
rdfs:domain owl:Thing ;
rdfs:label "mismo que"@es , "same as"@en-US ;
rdfs:label "same as"@en-US ;
rdfs:range owl:Thing ;
rdfs:subPropertyOf owl:topObjectProperty ;
vitro:displayLimitAnnot
@ -1774,6 +1774,8 @@ vivo:publisherOf
"25"^^xsd:int ;
vitro:fullPropertyNameAnnot
"publisher of"^^xsd:string ;
vitro:customEntryFormAnnot
"edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AutocompleteObjectPropertyFormGenerator"^^xsd:string ;
vitro:hiddenFromDisplayBelowRoleLevelAnnot
<http://vitro.mannlib.cornell.edu/ns/vitro/role#public> ;
vitro:hiddenFromPublishBelowRoleLevelAnnot

View file

@ -120,7 +120,9 @@ public class GeoFocusMapLocations extends AbstractAjaxResponder {
response = response.substring(0, response.lastIndexOf(","));
}
response += " ]";
log.debug(response);
if ( log.isDebugEnabled() ) {
log.debug(response);
}
return response;
} catch (Exception e) {
log.error("Failed geographic focus locations", e);

View file

@ -44,7 +44,9 @@ public class ManageGrantsForIndividualController extends FreemarkerHttpServlet {
body.put("subjectUri", subjectUri);
HashMap<String, List<Map<String,String>>> grants = getGrants(subjectUri, vreq);
log.debug("grants = " + grants);
if ( log.isDebugEnabled() ) {
log.debug("grants = " + grants);
}
body.put("grants", grants);
List<String> allSubclasses = getAllSubclasses(grants);

View file

@ -44,7 +44,9 @@ public class ManagePeopleForOrganizationController extends FreemarkerHttpServlet
body.put("subjectUri", subjectUri);
HashMap<String, List<Map<String,String>>> people = getPeople(subjectUri, vreq);
log.debug("people = " + people);
if ( log.isDebugEnabled() ) {
log.debug("people = " + people);
}
body.put("people", people);
List<String> allSubclasses = getAllSubclasses(people);

View file

@ -44,7 +44,9 @@ public class ManagePublicationsForIndividualController extends FreemarkerHttpSer
body.put("subjectUri", subjectUri);
HashMap<String, List<Map<String,String>>> publications = getPublications(subjectUri, vreq);
log.debug("publications = " + publications);
if ( log.isDebugEnabled() ) {
log.debug("publications = " + publications);
}
body.put("publications", publications);
List<String> allSubclasses = getAllSubclasses(publications);

View file

@ -360,7 +360,7 @@ public class AddAuthorsToInformationResourceGenerator extends VivoBaseGenerator
+ " OPTIONAL { ?authorURI rdfs:label ?authorName } \n"
+ " OPTIONAL { ?authorshipURI core:rank ?rank } \n"
+ "} UNION { \n"
+ " <http://vivo.cornell.edu/individual/n2251> core:relatedBy ?authorshipURI . \n"
+ " ?subject core:relatedBy ?authorshipURI . \n"
+ " ?authorshipURI a core:Authorship . \n"
+ " ?authorshipURI core:relates ?authorURI . \n"
+ " ?authorURI a vcard:Individual . \n"

View file

@ -1,139 +0,0 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.search.documentBuilding;
import static edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames.ALLTEXT;
import static edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames.ALLTEXTUNSTEMMED;
import static edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames.PREFERRED_TITLE;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.RDFNode;
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ContextModelAccess;
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchInputDocument;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceUtils;
import edu.cornell.mannlib.vitro.webapp.utils.configuration.ContextModelsUser;
/**
* If there are any VCards on this Individual with Title objects, store the text
* in the Preferred Title search field, and the ALL_TEXT field.
*
* If there are any VCards on this Individual with EMail objects, store the text
* in the ALL_TEXT field.
*/
public class VIVOValuesFromVcards implements DocumentModifier, ContextModelsUser {
private static final Log log = LogFactory
.getLog(VIVOValuesFromVcards.class);
private static final String PREFERRED_TITLE_QUERY = ""
+ "prefix vcard: <http://www.w3.org/2006/vcard/ns#> \n"
+ "prefix obo: <http://purl.obolibrary.org/obo/> \n\n"
+ "SELECT ?title WHERE { \n" //
+ " ?uri obo:ARG_2000028 ?card . \n"
+ " ?card a vcard:Individual . \n"
+ " ?card vcard:hasTitle ?titleHolder . \n"
+ " ?titleHolder vcard:title ?title . \n" //
+ "}";
private static final ResultParser PREFERRED_TITLE_PARSER = new ResultParser() {
@Override
public void parse(String uri, QuerySolution solution, SearchInputDocument doc) {
String title = getLiteralValue(solution, "title");
if (StringUtils.isNotBlank(title)) {
doc.addField(PREFERRED_TITLE, title);
doc.addField(ALLTEXT, title);
doc.addField(ALLTEXTUNSTEMMED, title);
log.debug("Preferred Title for " + uri + ": '" + title + "'");
}
}
};
private static final String EMAIL_QUERY = ""
+ "prefix vcard: <http://www.w3.org/2006/vcard/ns#> \n"
+ "prefix obo: <http://purl.obolibrary.org/obo/> \n\n"
+ "SELECT ?email WHERE { \n" //
+ " ?uri obo:ARG_2000028 ?card . \n"
+ " ?card a vcard:Individual . \n"
+ " ?card vcard:hasEmail ?emailHolder . \n"
+ " ?emailHolder vcard:email ?email . \n" //
+ "}";
private static final ResultParser EMAIL_PARSER = new ResultParser() {
@Override
public void parse(String uri, QuerySolution solution,
SearchInputDocument doc) {
String email = getLiteralValue(solution, "email");
if (StringUtils.isNotBlank(email)) {
doc.addField(ALLTEXT, email);
doc.addField(ALLTEXTUNSTEMMED, email);
log.debug("Email for " + uri + ": '" + email + "'");
}
}};
private RDFService rdfService;
private boolean shutdown = false;
@Override
public void setContextModels(ContextModelAccess models) {
this.rdfService = models.getRDFService();
}
@Override
public void modifyDocument(Individual individual, SearchInputDocument doc) {
if (individual == null)
return;
processQuery(individual, PREFERRED_TITLE_QUERY, PREFERRED_TITLE_PARSER,
doc);
processQuery(individual, EMAIL_QUERY, EMAIL_PARSER, doc);
}
private void processQuery(Individual individual, String queryTemplate,
ResultParser resultParser, SearchInputDocument doc) {
String uri = "<" + individual.getURI() + "> ";
String query = queryTemplate.replaceAll("\\?uri", uri);
try {
ResultSet results = RDFServiceUtils.sparqlSelectQuery(query,
rdfService);
if (results != null) {
while (results.hasNext()) {
log.debug("Next solution");
QuerySolution solution = results.nextSolution();
resultParser.parse(uri, solution, doc);
}
}
} catch (Exception e) {
if (!shutdown) {
log.error("problem while running query '" + query + "'", e);
}
}
}
@Override
public void shutdown() {
shutdown = true;
}
private abstract static class ResultParser {
public abstract void parse(String uri, QuerySolution solution, SearchInputDocument doc);
String getLiteralValue(QuerySolution solution, String name) {
RDFNode node = solution.get(name);
if ((node != null) && (node.isLiteral())) {
String value = node.asLiteral().getString();
if (StringUtils.isNotBlank(value)) {
return value;
}
}
return "";
}
}
}

View file

@ -1,182 +0,0 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.search.documentBuilding;
import java.util.ArrayList;
import java.util.List;
/**
* Class that adds text from context nodes to Search Documents for
* foaf:Agent individuals.
*/
public class VivoAgentContextNodeFields extends ContextNodeFields{
static List<String> queriesForAgent = new ArrayList<String>();
public VivoAgentContextNodeFields(){
super(queriesForAgent);
}
protected static final String prefix =
"prefix owl: <http://www.w3.org/2002/07/owl#> "
+ " prefix vitroDisplay: <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#> "
+ " prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> "
+ " prefix core: <http://vivoweb.org/ontology/core#> "
+ " prefix foaf: <http://xmlns.com/foaf/0.1/> "
+ " prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> "
+ " prefix localNav: <http://vitro.mannlib.cornell.edu/ns/localnav#> "
+ " prefix bibo: <http://purl.org/ontology/bibo/> "
+ " prefix obo: <http://purl.obolibrary.org/obo/> \n" ;
//queries for foaf:Agent
static {
/* Positions for People */
queriesForAgent.add(prefix +
"SELECT " +
"(str(?ContextNodeProperty) as ?contextNodeProperty) WHERE {" +
" ?uri rdf:type foaf:Agent . " +
" ?uri ?b ?c . " +
" ?c rdf:type core:Position . " +
" ?c core:hrJobTitle ?ContextNodeProperty . }");
queriesForAgent.add(prefix + "SELECT " +
"(str(?ContextNodeProperty) as ?contextNodeProperty) WHERE {" +
" ?uri rdf:type foaf:Agent . " +
" ?uri ?b ?c . " +
" ?c rdf:type core:Position . " +
" ?c core:relates ?i . " +
" ?i rdf:type foaf:Organization . " +
" ?i rdfs:label ?ContextNodeProperty . }");
queriesForAgent.add(prefix + "SELECT " +
"(str(?ContextNodeProperty) as ?contextNodeProperty) WHERE {" +
" ?uri rdf:type foaf:Agent . " +
" ?uri ?b ?c . " +
" ?c rdf:type core:Position . " +
" ?c core:titleOrRole ?ContextNodeProperty . }");
/* HR Job Title */
queriesForAgent.add(prefix +
"SELECT " +
"(str(?HRJobTitle) as ?hrJobTitle) " +
"(str(?PositionInOrganization) as ?positionInOrganization) " +
"(str(?TitleOrRole) as ?titleOrRole) WHERE {"
+ "?uri rdf:type foaf:Agent ; ?b ?c . "
+ " ?c rdf:type core:Position . "
+ " OPTIONAL { ?c core:hrJobTitle ?HRJobTitle . } . "
+ " OPTIONAL { ?c core:relates ?i . ?i rdf:type foaf:Organization . ?i rdfs:label ?PositionInOrganization . } . "
+ " OPTIONAL { ?c core:titleOrRole ?TitleOrRole . } . "
+ " }");
/* Advisor */
queriesForAgent.add(prefix + "SELECT " +
"(str(?ContextNodeProperty) as ?contextNodeProperty) WHERE {" +
" ?uri rdf:type foaf:Agent ; ?b ?c . " +
" ?c rdf:type core:AdvisingRelationship . " +
" ?c rdfs:label ?ContextNodeProperty . }");
queriesForAgent.add(prefix + "SELECT " +
"(str(?ContextNodeProperty) as ?contextNodeProperty) WHERE {" +
" ?uri rdf:type foaf:Agent ; ?b ?c . " +
" ?c rdf:type core:AdvisingRelationship . " +
" ?c core:degreeCandidacy ?e . ?e rdfs:label ?ContextNodeProperty . }");
queriesForAgent.add(prefix + "SELECT " +
"(str(?label) as ?adviseeLabel) WHERE {" +
" ?uri rdf:type foaf:Agent ." +
" ?c rdf:type core:AdvisingRelationship . " +
" ?c core:relates ?uri . " +
" ?uri obo:RO_0000053 ?advisorRole . " +
" ?advisorRole rdf:type core:AdvisorRole . " +
" ?c core:relates ?d . " +
" ?d rdf:type foaf:Person . " +
" ?d obo:RO_0000053 ?adviseeRole . " +
" ?adviseeRole rdf:type core:AdviseeRole . " +
" ?d rdfs:label ?ContextNodeProperty . }");
queriesForAgent.add(prefix + "SELECT " +
"(str(?label) as ?advisorLabel) WHERE {" +
" ?uri rdf:type foaf:Agent ." +
" ?c rdf:type core:AdvisingRelationship . " +
" ?c core:relates ?uri . " +
" ?uri obo:RO_0000053 ?adviseeRole . " +
" ?adviseeRole rdf:type core:AdviseeRole . " +
" ?c core:relates ?d . " +
" ?d rdf:type foaf:Person . " +
" ?d obo:RO_0000053 ?advisorRole . " +
" ?advisorRole rdf:type core:AdvisorRole . " +
" ?d rdfs:label ?ContextNodeProperty . }");
/* Author */
queriesForAgent.add(prefix + "SELECT " +
"(str(?ContextNodeProperty) as ?contextNodeProperty) WHERE {" +
" ?uri rdf:type foaf:Agent ; ?b ?c . " +
" ?c rdf:type core:Authorship . " +
" ?c core:relates ?f . " +
" ?f rdf:type foaf:Person . " +
" ?f rdfs:label ?ContextNodeProperty . " +
" FILTER( ?f != ?uri ) " +
"}");
queriesForAgent.add(prefix + "SELECT " +
"(str(?ContextNodeProperty) as ?contextNodeProperty) WHERE {" +
" ?uri rdf:type foaf:Agent ; ?b ?c . " +
" ?c rdf:type core:Authorship . " +
" ?c core:relates ?h . " +
" ?h rdf:type obo:IAO_0000030 . ?h rdfs:label ?ContextNodeProperty . }");
/* Award */
queriesForAgent.add(prefix +
"SELECT " +
"(str(?AwardLabel) as ?awardLabel) " +
"(str(?AwardConferredBy) as ?awardConferredBy) " +
"(str(?Description) as ?description) " +
"WHERE {"
+ " ?uri rdf:type foaf:Agent ; ?b ?c . "
+ " ?c rdf:type core:AwardReceipt . "
+ " OPTIONAL { ?c core:relates ?e . ?e rdf:type core:Award . ?e rdfs:label ?AwardLabel . } . "
+ " OPTIONAL { ?c core:assignedBy ?d . ?d rdf:type foaf:Organization . ?d rdfs:label ?AwardConferredBy . } . "
+ " OPTIONAL { ?c core:description ?Description . } . "
+ " }");
/* Role In Organization */
queriesForAgent.add(prefix +
"SELECT (str(?OrganizationLabel) as ?organizationLabel) WHERE {"
+ " ?uri rdf:type foaf:Agent ; ?b ?c . "
+ " ?c rdf:type obo:BFO_0000023 ; core:roleContributesTo ?Organization ."
+ " ?Organization rdf:type core:Organization . "
+ " ?Organization rdfs:label ?OrganizationLabel . "
+ " }");
/* Academic Degree / Educational Training */
queriesForAgent.add(prefix +
"SELECT " +
"(str(?AcademicDegreeLabel) as ?academicDegreeLabel) " +
"(str(?AcademicDegreeAbbreviation) as ?academicDegreeAbbreviation) " +
"(str(?MajorField) as ?majorField) " +
"(str(?DepartmentOrSchool) as ?departmentOrSchool) " +
"(str(?TrainingAtOrganizationLabel) as ?trainingAtOrganizationLabel) WHERE {"
+ " ?uri rdf:type foaf:Agent ; ?b ?c . "
+ " ?c rdf:type core:EducationalProcess . "
+ "OPTIONAL { ?c core:relates ?d . "
+ " ?d rdf:type core:AwardedDegree . "
+ " ?d core:relates ?e . "
+ " ?e rdf:type core:AcademicDegree . "
+ " ?e rdfs:label ?AcademicDegreeLabel . } . "
+ "OPTIONAL { ?c core:majorField ?MajorField .} ."
+ " OPTIONAL { ?c core:departmentOrSchool ?DepartmentOrSchool . }"
+ " OPTIONAL { ?c obo:RO_0000057 ?f . ?f rdf:type foaf:organization . ?f rdfs:label ?TrainingAtOrganizationLabel . } . "
+"}");
}
}

View file

@ -1,52 +0,0 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.search.documentBuilding;
import java.util.ArrayList;
import java.util.List;
/**
* DocumentModifier for adding rdfs:labels of individuals related via
* a advising relationship.
*
* @author bdc34
*
*/
public class VivoISFAdvisingFields extends ContextNodeFields {
private static String VIVONS = "http://vivoweb.org/ontology/core#";
protected static final String prefix =
" prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n"
+ " prefix core: <" + VIVONS + "> \n"
+ " prefix foaf: <http://xmlns.com/foaf/0.1/> \n"
+ " prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n"
+ " prefix obo: <http://purl.obolibrary.org/obo/> \n" ;
static List<String> queries = new ArrayList<String>();
static{
queries.add( makeQueryForPeople() );
}
public VivoISFAdvisingFields(){
super(queries);
}
/**
* This query will get all the labels for the other
* person in the relationship.
*/
private static String makeQueryForPeople(){
return prefix +
"SELECT \n" +
"(str(?rawresult) as ?result) WHERE \n" +
"{\n" +
" ?uri core:relatedBy ?rel . \n" +
" ?rel rdf:type core:AdvisingRelationship . \n" +
" ?rel core:relates ?other . \n" +
" ?other rdfs:label ?rawresult . \n" +
" FILTER( ?other != ?uri ) \n" +
"}";
}
}

View file

@ -1,69 +0,0 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.search.documentBuilding;
import java.util.ArrayList;
import java.util.List;
/**
* DocumentModifier to populate Search index fields for the basic ISF relationships.
*
* This will add the all rdfs:labels of the related individuals to the search document.
*
* @author bdc34
*/
public class VivoISFBasicFields extends ContextNodeFields {
private static String VIVONS = "http://vivoweb.org/ontology/core#";
/**
* Subtypes of vivo:Relationship that get handled by this class.
*/
private static String[] RELATIONSHIP_TYPES = {
VIVONS + "Position",
VIVONS + "Authorship",
VIVONS + "Collaboration",
VIVONS + "Affiliation"
};
static List<String> queries = new ArrayList<String>();
public VivoISFBasicFields(){
super(queries);
}
protected static final String prefix =
" prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n"
+ " prefix core: <" + VIVONS + "> \n"
+ " prefix foaf: <http://xmlns.com/foaf/0.1/> \n"
+ " prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n"
+ " prefix obo: <http://purl.obolibrary.org/obo/> \n" ;
static {
/* make a string of the RELATIONSHIP_TYPES for use in
* a SPARQL IN clause */
String types = "";
for( int i = 0 ; i < RELATIONSHIP_TYPES.length ; i++ ){
types += "<" + RELATIONSHIP_TYPES[i] + ">";
if( i != RELATIONSHIP_TYPES.length - 1 ){
types += ", ";
}
}
queries.add(
prefix +
"SELECT \n" +
"(str(?rawresult) as ?result) WHERE \n" +
"{\n" +
" ?uri core:relatedBy ?rel . \n" +
" ?rel rdf:type ?type . \n" +
" ?rel core:relates ?other . \n" +
" ?other rdfs:label ?rawresult . \n" +
" FILTER ( ?type IN ( " + types + " ) )\n" +
"}" );
}
}

View file

@ -1,55 +0,0 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.search.documentBuilding;
import java.util.ArrayList;
import java.util.List;
public class VivoISFEducationFields extends ContextNodeFields {
private static String VIVONS = "http://vivoweb.org/ontology/core#";
protected static final String prefix =
" prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n"
+ " prefix core: <" + VIVONS + "> \n"
+ " prefix foaf: <http://xmlns.com/foaf/0.1/> \n"
+ " prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n"
+ " prefix obo: <http://purl.obolibrary.org/obo/> \n" ;
public VivoISFEducationFields(){
super(queries);
}
/**
* This query will get all the labels for the degree.
*/
private static String queryForDegree =
prefix +
"SELECT \n" +
"(str(?rawresult) as ?result) WHERE \n" +
"{\n" +
" ?uri core:relates ?deg . \n" +
" ?deg rdf:type core:AwardedDegree . \n" +
" ?deg rdfs:label ?rawresult . \n" +
"}";
/**
* This will get all labels for the organization.
*/
private static String queryForOrganization =
prefix +
"SELECT \n" +
"(str(?rawresult) as ?result) WHERE \n" +
"{\n" +
" ?uri core:relates ?deg . \n" +
" ?deg rdf:type core:AwardedDegree . \n" +
" ?deg core:assignedBy ?org . \n" +
" ?org rdfs:label ?rawresult . \n" +
"}";
static List<String> queries = new ArrayList<String>();
static{
queries.add( queryForDegree );
queries.add( queryForOrganization );
}
}

View file

@ -1,158 +0,0 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.search.documentBuilding;
import java.util.ArrayList;
import java.util.List;
/*
* This DocumentModifier is for the ISF style grants.
* It will
* add people's names to the grant's search Document
* add the grant's name to the people's search Document
* add the grant's name to the Organization's search Document
* add the organization's name to the grant's search Document
* add the grant's names to the project's search Document
* add the people's names to the project's search Document
* add the project's name to the grant's search Document
* add the project's name to the people's search Document
*/
public class VivoISFGrantFields extends ContextNodeFields {
private static String VIVONS = "http://vivoweb.org/ontology/core#";
protected static final String prefix =
" prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n"
+ " prefix core: <" + VIVONS + "> \n"
+ " prefix foaf: <http://xmlns.com/foaf/0.1/> \n"
+ " prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n"
+ " prefix obo: <http://purl.obolibrary.org/obo/> \n" ;
public VivoISFGrantFields(){
super(queries);
}
/**
* Query to add people's names to the grant's search Document.
* ?uri is the URI of a grant.
*/
private static String peopleForGrant =
prefix +
"SELECT (str(?rawresult) as ?result) WHERE {\n" +
" ?uri rdf:type core:Grant . \n" +
" ?uri core:relates ?person . \n" +
" ?person rdf:type foaf:Person . \n" +
" ?person rdfs:label ?rawresult . \n" +
"}";
/**
* Query to add the grant's name to the people's search Document.
* ?uri is the URI of a person.
*/
private static String grantsForPerson =
prefix +
"SELECT \n" +
"(str(?rawresult) as ?result) WHERE \n" +
"{\n" +
" ?uri rdf:type foaf:Person . \n" +
" ?grant core:relates ?uri . \n" +
" ?grant rdf:type core:Grant . \n" +
" ?grant rdfs:label ?rawresult . \n" +
"}";
/**
* Query to add the grant's name to the Organization's search Document.
* ?uri is the URI of an Organization.
*/
private static String grantsForOrganization =
prefix +
"SELECT (str(?rawresult) as ?result) WHERE {\n" +
" ?uri rdf:type foaf:Organization . \n" +
" ?grant core:relates ?uri . \n" +
" ?grant rdf:type core:Grant . \n" +
" ?grant rdfs:label ?rawresult . \n" +
"}";
/**
* Query to add the organization's name to the grant's search Document.
* ?uri is the URI of a grant.
*/
private static String organizationsForGrant =
prefix +
"SELECT (str(?rawresult) as ?result) WHERE {\n" +
" ?uri rdf:type core:Grant . \n" +
" ?uri core:relates ?org . \n" +
" ?org rdf:type foaf:Organization . \n" +
" ?org rdfs:label ?rawresult . \n" +
"}";
/**
* Query to add the grant's names to the project's search Document.
* ?uir is the URI of a Project.
*/
private static String grantsForProject =
prefix +
"SELECT (str(?rawresult) as ?result) WHERE {\n" +
" ?uri rdf:type core:Project . \n" +
" ?role obo:BFO_0000054 ?uri . \n" +
" ?grant core:relates ?role . \n" +
" ?grant rdf:type core:Grant . \n" +
" ?grant rdfs:label ?rawresult . \n" +
"}";
/**
* Query to add the people's names to the project's search Document.
* ?uri is the URI of a Project.
*/
private static String peopleForProject =
prefix +
"SELECT (str(?rawresult) as ?result) WHERE {\n" +
" ?uri rdf:type core:Project . \n" +
" ?role obo:BFO_0000054 ?uri . \n" +
" ?role obo:RO_0000053 ?person . \n" +
" ?person rdf:type foaf:Person . \n" +
" ?person rdfs:label ?rawresult . \n" +
"}";
/**
* Query to add the project's name to the grant's search Document.
* ?uri is the URI of a grant.
*/
private static String projectsForGrant =
prefix +
"SELECT \n" +
"(str(?rawresult) as ?result) WHERE \n" +
"{\n" +
" ?uri rdf:type core:Grant. \n" +
" ?uri core:relates ?role . \n" +
" ?role obo:BFO_0000054 ?project . \n" +
" ?project rdf:type core:Project . \n" +
" ?project rdfs:label ?rawresult . \n" +
"}";
/**
* Query to add the project's name to the people's search Document.
* ?uri is the URI of a person.
*/
private static String projectsForPerson =
prefix +
"SELECT (str(?rawresult) as ?result) WHERE {\n" +
" ?uri rdf:type foaf:Person . \n" +
" ?uri obo:RO_0000053 ?role . \n" +
" ?role obo:BFO_0000054 ?project . \n" +
" ?project rdf:type core:Project . \n" +
" ?project rdfs:label ?rawresult . \n" +
"}";
static List<String> queries = new ArrayList<String>();
static{
queries.add( peopleForGrant );
queries.add( grantsForPerson );
queries.add( grantsForOrganization );
queries.add( organizationsForGrant );
queries.add( grantsForProject );
queries.add( peopleForProject );
queries.add( projectsForGrant );
queries.add( projectsForPerson );
}
}

View file

@ -1,59 +0,0 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.search.documentBuilding;
import java.util.ArrayList;
import java.util.List;
/**
* This class will:
* add people's names to organization's search Documents.
* add organization names to people's search Documents.
*
* @author bdc34
*
*/
public class VivoISFMemberFields extends ContextNodeFields {
private static String VIVONS = "http://vivoweb.org/ontology/core#";
protected static final String prefix =
" prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n"
+ " prefix core: <" + VIVONS + "> \n"
+ " prefix foaf: <http://xmlns.com/foaf/0.1/> \n"
+ " prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n"
+ " prefix obo: <http://purl.obolibrary.org/obo/> \n" ;
public VivoISFMemberFields(){
super(queries);
}
/**
* Add people's names to organization's search Documents.
*/
private static String peopleForOrganization =
prefix +
"SELECT (str(?rawresult) as ?result) WHERE {\n" +
" ?uri rdf:type foaf:Organization . \n" +
" ?role core:roleContributesTo ?uri . \n" +
" ?person obo:RO_0000053 ?role . \n" +
" ?person rdfs:label ?rawresult .\n" +
"}";
/**
* add organization names to people's search Documents.
*/
private static String organizationForPeople =
prefix +
"SELECT (str(?rawresult) as ?result) WHERE {\n" +
" ?uri rdf:type foaf:Person . \n" +
" ?uri obo:RO_0000053 / core:roleContributesTo / rdfs:label ?rawresult . \n" +
"}";
static List<String> queries = new ArrayList<String>();
static{
queries.add( peopleForOrganization );
queries.add( organizationForPeople );
}
}

View file

@ -1,81 +0,0 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.search.documentBuilding;
import java.util.ArrayList;
import java.util.List;
/**
* Class that adds text from context nodes to search index Documents for
* obo:IAO_0000030 individuals.
*
* @author bdc34
*
*/
public class VivoInformationResourceContextNodeFields extends ContextNodeFields{
static List<String> queriesForInformationResource = new ArrayList<String>();
public VivoInformationResourceContextNodeFields(){
super(queriesForInformationResource);
}
protected static final String prefix =
"prefix owl: <http://www.w3.org/2002/07/owl#> "
+ " prefix vitroDisplay: <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#> "
+ " prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> "
+ " prefix core: <http://vivoweb.org/ontology/core#> "
+ " prefix foaf: <http://xmlns.com/foaf/0.1/> "
+ " prefix obo: <http://purl.obolibrary.org/> "
+ " prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> "
+ " prefix localNav: <http://vitro.mannlib.cornell.edu/ns/localnav#> "
+ " prefix bibo: <http://purl.org/ontology/bibo/> ";
//queries for obo:IAO_0000030
static {
/* linked author labels */
queriesForInformationResource
.add(prefix
+ "SELECT (str(?ContextNodeProperty) as ?contextNodeProperty) WHERE {"
+ "?uri rdf:type obo:IAO_0000030 . "
+ "?uri core:relatedBy ?a . "
+ "?a rdf:type core:Authorship ."
+ "?a core:relates ?b ."
+ "?b rdf:type foaf:Agent ."
+ "?b rdfs:label ?ContextNodeProperty .}");
/* features */
queriesForInformationResource
.add(prefix
+ "SELECT (str(?ContextNodeProperty) as ?contextNodeProperty) WHERE {"
+ "?uri rdf:type obo:IAO_0000030 . "
+ "?uri core:features ?i . ?i rdfs:label ?ContextNodeProperty ."
+ "}");
/* editor */
queriesForInformationResource
.add(prefix
+ "SELECT (str(?ContextNodeProperty) as ?contextNodeProperty) WHERE {"
+ "?uri rdf:type obo:IAO_0000030 . "
+ "?uri core:relatedBy ?e . "
+ "?e rdf:type core:Editorship ."
+ "?e core:relates ?i ."
+ "?i rdf:type foaf:Agent ."
+ "?i rdfs:label ?ContextNodeProperty ."
+ "}");
/* subject area */
queriesForInformationResource
.add(prefix
+ "SELECT (str(?ContextNodeProperty) as ?contextNodeProperty) WHERE {"
+ "?uri rdf:type obo:IAO_0000030 . "
+ "?uri core:hasSubjectArea ?f . ?f rdfs:label ?ContextNodeProperty ."
+ "}");
}
}

View file

@ -1,769 +0,0 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.search.indexing;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.query.QuerySolution;
import com.hp.hpl.jena.query.QuerySolutionMap;
import com.hp.hpl.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.ResourceFactory;
import com.hp.hpl.jena.rdf.model.Statement;
import edu.cornell.mannlib.vitro.webapp.dao.jena.QueryUtils;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import edu.cornell.mannlib.vitro.webapp.search.beans.StatementToURIsToUpdate;
public class AdditionalURIsForContextNodes implements StatementToURIsToUpdate {
private final RDFService rdfService;
private Set<String> alreadyChecked;
private long accumulatedTime = 0;
private static final List<String> multiValuedQueriesForAgent = new ArrayList<String>();
private static final String multiValuedQueryForInformationContentEntity;
private static final List<String> multiValuedQueriesForRole = new ArrayList<String>();
private static final List<String>queryList;
private Log log = LogFactory.getLog(AdditionalURIsForContextNodes.class);
public AdditionalURIsForContextNodes( RDFService rdfService){
this.rdfService = rdfService;
}
@Override
public List<String> findAdditionalURIsToIndex(Statement stmt) {
if( stmt != null ){
long start = System.currentTimeMillis();
List<String>urisToIndex = new ArrayList<String>();
if(stmt.getSubject() != null && stmt.getSubject().isURIResource() ){
String subjUri = stmt.getSubject().getURI();
if( subjUri != null && ! alreadyChecked.contains( subjUri )){
urisToIndex.addAll( findAdditionalURIsToIndex(subjUri));
alreadyChecked.add(subjUri);
}
}
if( stmt.getObject() != null && stmt.getObject().isURIResource() ){
String objUri = stmt.getSubject().getURI();
if( objUri != null && ! alreadyChecked.contains(objUri)){
urisToIndex.addAll( findAdditionalURIsToIndex(objUri));
alreadyChecked.add(objUri);
}
}
accumulatedTime += (System.currentTimeMillis() - start ) ;
return urisToIndex;
}else{
return Collections.emptyList();
}
}
@Override
public void startIndexing() {
alreadyChecked = new HashSet<String>();
accumulatedTime = 0L;
}
@Override
public void endIndxing() {
log.debug( "Accumulated time for this run of the index: " + accumulatedTime + " msec");
alreadyChecked = null;
}
protected List<String> findAdditionalURIsToIndex(String uri) {
List<String> uriList = new ArrayList<String>();
for (String query : queryList) {
QuerySolutionMap initialBinding = new QuerySolutionMap();
Resource uriResource = ResourceFactory.createResource(uri);
initialBinding.add("uri", uriResource);
ResultSet results = QueryUtils.getQueryResults(query,
initialBinding, rdfService);
while (results.hasNext()) {
QuerySolution soln = results.nextSolution();
Iterator<String> iter = soln.varNames();
while (iter.hasNext()) {
String name = iter.next();
RDFNode node = soln.get(name);
if (node != null) {
uriList.add("" + node.toString());
} else {
log.debug(name + " is null");
}
}
}
}
if( log.isDebugEnabled() )
log.debug( "additional uris for " + uri + " are " + uriList);
return uriList;
}
private static final String prefix = "prefix owl: <http://www.w3.org/2002/07/owl#> \n"
+ " prefix vitroDisplay: <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#> \n"
+ " prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n"
+ " prefix core: <http://vivoweb.org/ontology/core#> \n"
+ " prefix foaf: <http://xmlns.com/foaf/0.1/> \n"
+ " prefix obo: <http://purl.obolibrary.org/obo/> \n"
+ " prefix vcard: <http://www.w3.org/2006/vcard/ns#> \n"
+ " prefix event: <http://purl.org/NET/c4dm/event.owl#> \n"
+ " prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n"
+ " prefix localNav: <http://vitro.mannlib.cornell.edu/ns/localnav#> \n"
+ " prefix bibo: <http://purl.org/ontology/bibo/> \n";
static{
// If a person changes then update
// organizations for positions
multiValuedQueriesForAgent.add(prefix +
"SELECT DISTINCT \n" +
" (str(?i) as ?positionInOrganization) \n" +
" WHERE {\n"
+ "?uri rdf:type foaf:Agent ; core:relatedBy ?c . \n"
+ " ?c rdf:type core:Position . \n"
+ " OPTIONAL { ?c core:relates ?i . ?i rdf:type foaf:Organization } . \n"
+ " }");
// If a person changes then update
// advisee, linkedAuthor and informationResource
multiValuedQueriesForAgent.add(prefix +
"SELECT (str(?d) as ?advisee) \n" +
" (str(?f) as ?linkedAuthor) (str(?h) as ?linkedInformationResource) WHERE { {\n"
+ "?uri rdf:type foaf:Agent . \n"
+ "?uri core:relatedBy ?c . \n"
+ "?c rdf:type core:AdvisingRelationship . \n"
+ "?c core:relates ?d . \n"
+ "?d rdf:type core:AdviseeRole . \n"
+ "?d obo:RO_0000052 ?e . \n"
+ "?e rdf:type foaf:Person . \n"
+ "} \n"
+ "UNION { \n"
+ " ?uri rdf:type foaf:Agent . \n"
+ " ?uri core:relatedBy ?c . \n"
+ " ?c rdf:type core:Authorship . \n"
+ " OPTIONAL {?c core:relates ?f . \n"
+ " ?f rdf:type foaf:Person . } \n"
+ " OPTIONAL { ?c core:relates ?h . \n"
+ " ?h rdf:type obo:IAO_0000030 . } \n"
+ " } } ");
// If a person changes then update
// award giver
multiValuedQueriesForAgent.add(prefix +
"SELECT (str(?d) as ?awardConferredBy) \n" +
"WHERE {\n"
+ "?uri rdf:type foaf:Agent ; ?b ?c . \n"
+ " ?c rdf:type core:AwardReceipt . \n"
+ " OPTIONAL { ?c core:assignedBy ?d . } . \n"
+ " }");
// If a person changes then update
// organization for role
multiValuedQueriesForAgent.add(prefix +
"SELECT (str(?Organization) as ?organization) \n" +
"WHERE {\n"
+ "?uri rdf:type foaf:Agent ; ?b ?c . \n"
+ " ?c rdf:type obo:BFO_0000023 ; obo:BFO_0000054 ?Organization .\n"
+ " }");
// If a person changes then update
// organization in educational training
multiValuedQueriesForAgent.add(prefix +
"SELECT \n" +
"(str(?e) as ?trainingAtOrganization) WHERE {\n"
+ " ?uri rdf:type foaf:Agent ; ?b ?c . \n"
+ " ?c rdf:type core:EducationalProcess . \n"
+ " OPTIONAL { ?c obo:RO_0000057 ?e . \n"
+ " ?e rdf:type foaf:Organization . } . "
+"}");
// If an organization changes then update
// people in head of relations
multiValuedQueriesForAgent.add(
" # for organization, get leader \n" +
prefix +
"SELECT \n" +
"(str(?e) as ?LeaderPerson ) WHERE {\n"
+ " ?uri rdf:type foaf:Agent . \n"
+ " ?uri core:contributingRole ?c . \n"
+ " ?c rdf:type core:LeaderRole . \n"
+ " OPTIONAL { ?c obo:RO_0000052 ?e . \n"
+ " ?e rdf:type foaf:Person . } . "
+"}");
}
//multivalued query for obo:IAO_0000030 (Information Content Entity)
static {
multiValuedQueryForInformationContentEntity = prefix +
"SELECT (str(?b) as ?linkedAuthor) (str(?d) as ?linkedInformationResource) \n"
+ "(str(?f) as ?editor) \n" +
"(str(?i) as ?features) WHERE {\n"
+ " ?uri rdf:type obo:IAO_0000030 . \n"
+ " OPTIONAL { ?uri core:relatedBy ?a . \n"
+ " ?a rdf:type core:Authorship . \n"
+ " ?a core:relates ?b . ?b rdf:type foaf:Person .\n"
+ " ?a core:relates ?d . ?d rdf:type obo:IAO_0000030 .\n"
+ "} . "
+ " OPTIONAL { ?uri core:relatedBy ?e . \n"
+ " ?e rdf:type core:Editorship . \n"
+ " ?e core:relates ?f . ?f rdf:type foaf:Person .\n"
+ "} . "
+ " OPTIONAL { ?uri core:features ?i . } . \n"
+"}" ;
}
protected static List<String> queriesForAuthorship(){
List<String> queries = new ArrayList<String>();
//get additional URIs of information resources from author side
queries.add(
prefix
+ "SELECT (str(?a) as ?infoResource) WHERE {\n"
+ " ?uri rdf:type foaf:Person . \n"
+ " ?uri core:relatedBy ?aship .\n"
+ " ?aship rdf:type core:Authorship .\n"
+ "OPTIONAL { ?aship core:relates ?a . ?a rdf:type obo:IAO_0000030 } .\n"
+"}" );
//get additional URIs of authors from information resource side
queries.add(
prefix
+ "SELECT (str(?a) as ?author ) WHERE {\n"
+ " ?uri rdf:type obo:IAO_0000030 . \n"
+ " ?uri core:relatedBy ?aship . ?aship rdf:type core:Authorship . \n"
+ "OPTIONAL { ?aship core:relates ?a . ?a rdf:type foaf:Person } .\n"
+"}" );
return queries;
}
protected static List<String> queriesForURLLink(){
List<String> queries = new ArrayList<String>();
//get additional URIs when URLLink is changed
queries.add(
prefix
+ "SELECT (str(?x) as ?individual) WHERE {\n"
+ " ?i rdf:type vcard:Individual . \n"
+ " ?i vcard:hasURL ?uri . \n"
+ " ?i obo:ARG_2000029 ?x . \n"
+"}" );
return queries;
}
protected static List<String> queriesForEducationalTraining(){
List<String> queries = new ArrayList<String>();
//if person changes, no additional URIs need to be
//changed because the person is not displayed on the
//degree individual or on the degree granting organization
//if the degree changes, the person needs to be updated
//since the degree name is shown on the person page.
queries.add(
prefix
+ " SELECT (str(?person) as ?personUri) WHERE {\n"
+ " ?uri rdf:type core:AcademicDegree . \n"
+ " ?uri core:relatedBy ?awardedDegree .\n"
+ " ?awardedDegree rdf:type core:AwardedDegree .\n"
+ " ?awardedDegree core:relates ?person .\n"
+ " ?person rdf:type foaf:Person .\n"
+"}" );
//if the organization changes the person needs to be updated
//since the organization name is shown on the person page.
queries.add(
prefix
+ " SELECT (str(?person) as ?personUri) WHERE {\n"
+ " ?uri rdf:type foaf:Organization . \n"
+ " ?uri obo:RO_0000056 ?edTrainingNode .\n"
+ " ?edTrainingNode rdf:type core:EducationalProcess . \n"
+ " ?edTrainingNode obo:RO_0000057 ?person . \n"
+ " ?person rdf:type foaf:Person ."
+"}" );
return queries;
}
protected static List<String> queriesForPosition(){
List<String> queries = new ArrayList<String>();
//If an organization changes, update people
queries.add(
prefix
+ " SELECT (str(?person) as ?personUri) WHERE {\n"
+ " ?uri rdf:type foaf:Organization . \n"
+ " ?uri core:relatedBy ?positionNode .\n"
+ " ?positionNode rdf:type core:Position .\n"
+ " ?positionNode core:relates ?person . \n"
+ " ?person rdf:type foaf:Person .\n"
+"}" );
//if people change, update organizations
queries.add(
prefix
+ " SELECT (str(?org) as ?orgUri) WHERE {\n"
+ " ?uri rdf:type foaf:Person . \n"
+ " ?uri core:relatedBy ?positionNode .\n"
+ " ?positionNode rdf:type core:Position .\n"
+ " ?positionNode core:relates ?org . \n"
+ " ?org rdf:type foaf:Organization .\n"
+"}" );
return queries;
}
static{
// core:AttendeeRole
// If the person changes, update the attendee role in organization
// core:AttendeeRole applies to events, not organizations; updating accordingly - tlw72
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?event) \n " +
"WHERE {\n"
+ "?uri rdf:type foaf:Person . \n"
+ "?uri obo:RO_0000053 ?c . \n"
+ "?c rdf:type core:AttendeeRole . \n"
+ "?c obo:BFO_0000054 ?d . \n"
+ "?d rdf:type event:Event .\n"
+ " }");
// If the organization changes, update the attendee role of person
// core:AttendeeRole applies to events, not organizations; updating accordingly - tlw72
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?person) \n" +
"WHERE {\n"
+ "?uri rdf:type event:Event . \n"
+ "?uri obo:BFO_0000055 ?c . \n"
+ "?c rdf:type core:AttendeeRole . \n"
+ "?c obo:RO_0000052 ?d . \n"
+ "?d rdf:type foaf:Person .\n"
+ " }");
// core:ClinicalRole -- core:clinicalRoleOf
// If the person changes, update the clinical role in project
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?project) \n" +
"WHERE {\n"
+ "?uri rdf:type foaf:Person . \n"
+ "?uri obo:RO_0000053 ?c . \n"
+ "?c rdf:type core:ClinicalRole . \n"
+ "?c obo:BFO_0000054 ?d .\n"
+ "?d rdf:type core:Project .\n"
+ " }");
// If the person changes, update the clinical role in service
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?service) \n" +
"WHERE {\n"
+ "?uri rdf:type foaf:Person . \n"
+ "?uri obo:RO_0000053 ?c . \n"
+ "?c rdf:type core:ClinicalRole . \n"
+ "?c core:roleContributesTo ?d .\n"
+ "?d rdf:type obo:ERO_0000005 .\n"
+ " }");
// If the project changes, update the clinical role of person
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?person) \n" +
"WHERE {\n"
+ "?uri rdf:type core:Project . \n"
+ "?uri obo:BFO_0000055 ?c . \n"
+ "?c rdf:type core:ClinicalRole . \n"
+ "?c obo:RO_0000052 ?d .\n "
+ "?d rdf:type foaf:Person .\n "
+ " }");
// If the service changes, update the clinical role of person
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?person) \n" +
"WHERE {\n"
+ "?uri rdf:type obo:ERO_0000005 . \n"
+ "?uri core:contributingRole ?c . \n"
+ "?c rdf:type core:ClinicalRole . \n"
+ "?c obo:RO_0000052 ?d .\n "
+ "?d rdf:type foaf:Person .\n "
+ " }");
// If the person changes, update the leader role in organization
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?organization) \n" +
"WHERE {\n"
+ "?uri rdf:type foaf:Person . \n"
+ "?uri obo:RO_0000053 ?c . \n"
+ "?c rdf:type core:LeaderRole . \n"
+ "?c core:roleContributesTo ?d .\n"
+ "?d rdf:type foaf:Organization .\n "
+ " }");
// If the organization changes, update the leader role of person
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?person) \n" +
"WHERE {\n"
+ "?uri rdf:type foaf:Organization . \n"
+ "?uri core:contributingRole ?c . \n"
+ "?c rdf:type core:LeaderRole . \n"
+ "?c obo:RO_0000052 ?d .\n "
+ "?d rdf:type foaf:Person .\n "
+ " }");
// core:MemberRole -- core:memberRoleOf
// If the person changes, update the member role in organization
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?organization) \n" +
"WHERE \n{"
+ "?uri rdf:type foaf:Person . \n"
+ "?uri obo:RO_0000053 ?c . \n"
+ "?c rdf:type core:MemberRole . \n"
+ "?c core:roleContributesTo ?d .\n"
+ "?d rdf:type foaf:Organization .\n "
+ " }");
// If the organization changes, update the member role of person
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?person) \n" +
"WHERE {"
+ "?uri rdf:type foaf:Organization . \n"
+ "?uri core:contributingRole ?c . \n"
+ "?c rdf:type core:MemberRole . \n"
+ "?c obo:RO_0000052 ?d .\n "
+ "?d rdf:type foaf:Person .\n "
+ " }");
// core:OrganizerRole -- core:organizerRoleOf
// If the person changes, update the organizer role in organization
// organizerRole appplies to events not organizations; updating accordingly - tlw72
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?event) \n" +
"WHERE {"
+ "?uri rdf:type foaf:Person . \n"
+ "?uri obo:RO_0000053 ?c . \n"
+ "?c rdf:type core:OrganizerRole .\n"
+ "?c obo:BFO_0000054 ?d .\n"
+ "?d rdf:type event:Event .\n "
+ " }");
// If the organization changes, update the organizer role of person
// organizerRole appplies to events not organizations; updating accordingly - tlw72
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?person) \n" +
"WHERE {\n"
+ "?uri rdf:type event:Event . \n"
+ "?uri obo:BFO_0000055 ?c . \n"
+ "?c rdf:type core:OrganizerRole . \n"
+ "?c obo:RO_0000052 ?d .\n "
+ "?d rdf:type foaf:Person .\n "
+ " }");
// core:OutreachProviderRole -- core:outreachProviderRoleOf
// If the person changes, update the outreach provider role in organization
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?organization) \n" +
"WHERE {\n"
+ "?uri rdf:type foaf:Person . \n"
+ "?uri obo:RO_0000053 ?c . \n"
+ "?c rdf:type core:OutreachProviderRole .\n"
+ "?c core:roleContributesTo ?d .\n"
+ "?d rdf:type foaf:Organization .\n "
+ " }");
// If the organization changes, update the outreach provider role of person
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?person) \n" +
"WHERE {\n"
+ "?uri rdf:type foaf:Organization . \n"
+ "?uri core:contributingRole ?c . \n"
+ "?c rdf:type core:OutreachProviderRole . \n"
+ "?c obo:RO_0000052 ?d .\n "
+ "?d rdf:type foaf:Person .\n "
+ " }");
// core:PresenterRole -- core:presenterRoleOf
// If the person changes, update the presentation
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?presentation) \n" +
"WHERE {\n"
+ "?uri rdf:type foaf:Person . \n"
+ "?uri obo:RO_0000053 ?c . \n"
+ " ?c rdf:type core:PresenterRole . \n"
+ " ?c obo:BFO_0000054 ?d .\n"
+ " ?d rdf:type core:Presentation . \n"
+ " }");
// If the presentation changes, update the person
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?person) \n" +
"WHERE {\n"
+ "?uri rdf:type core:Presentation . \n"
+ "?uri obo:BFO_0000055 ?c . \n"
+ " ?c rdf:type core:PresenterRole . \n "
+ "?c obo:RO_0000052 ?d .\n "
+ "?d rdf:type foaf:Person .\n "
+ " }");
// core:ResearcherRole -- core:researcherRoleOf
// If the person changes, update the grant
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?grant) \n" +
"WHERE {\n"
+ "?uri rdf:type foaf:Person . \n"
+ "?uri obo:RO_0000053 ?c . \n"
+ " ?c rdf:type core:ResearcherRole . \n "
+ " ?c core:relatedBy ?d .\n"
+ " ?d rdf:type core:Grant . \n"
+ " }");
// If the grant changes, update the researcher
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?person) \n" +
"WHERE {\n"
+ "?uri rdf:type core:Grant . \n"
+ "?uri core:relates ?c . \n"
+ " ?c rdf:type core:ResearcherRole . \n "
+ " ?c obo:RO_0000052 ?d .\n"
+ "?d rdf:type foaf:Person .\n "
+ " }");
// If the grant changes, update the principal investigator
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?person) \n" +
"WHERE {\n"
+ "?uri rdf:type core:Grant . \n"
+ " ?uri core:relates ?c . \n"
+ " ?c rdf:type core:PrincipalInvestigatorRole . \n "
+ " ?c obo:RO_0000052 ?d .\n"
+ "?d rdf:type foaf:Person .\n "
+ " }");
// If the grant changes, update the co-principal investigator
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?person) \n" +
"WHERE {\n"
+ "?uri rdf:type core:Grant . \n"
+ " ?uri core:relates ?c . \n"
+ " ?c rdf:type core:CoPrincipalInvestigatorRole . \n "
+ " ?c obo:RO_0000052 ?d .\n"
+ "?d rdf:type foaf:Person .\n "
+ " }");
// If the grant changes, update the investigator
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?person) \n" +
"WHERE {\n"
+ "?uri rdf:type core:Grant . \n"
+ " ?uri core:relates ?c . \n"
+ " ?c rdf:type core:InvestigatorRole . \n "
+ " ?c obo:RO_0000052 ?d .\n"
+ "?d rdf:type foaf:Person .\n "
+ " }");
// If the person changes, update the project
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?project) \n" +
"WHERE {\n"
+ "?uri rdf:type foaf:Person . \n"
+ "?uri obo:RO_0000053 ?c . \n"
+ " ?c rdf:type core:ResearcherRole . \n "
+ " ?c obo:BFO_0000054 ?d .\n"
+ " ?d rdf:type core:Project . \n"
+ " }");
// If the project changes, update the researcher
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?person) \n" +
"WHERE {\n"
+ "?uri rdf:type core:Project . \n"
+ " ?uri obo:BFO_0000055 ?c .\n"
+ " ?c rdf:type core:ResearcherRole . \n "
+ " ?c obo:RO_0000052 ?d .\n"
+ "?d rdf:type foaf:Person .\n "
+ " }");
// core:EditorRole -- core:editorRoleOf, core:forInformationResource (person, informationresource)
// If the person changes, update the editor role of the info resource
// changing foaf:Organization to info content entity. Org no longer applies here - tlw72
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?informationResource) \n" +
"WHERE {\n"
+ "?uri rdf:type foaf:Person . \n"
+ "?uri obo:RO_0000053 ?c . \n"
+ " ?c rdf:type core:EditorRole . \n "
+ " ?c core:roleContributesTo ?d .\n"
+ "?d rdf:type obo:IAO_0000030 .\n "
+ " }");
// If the info respource changes, update the editor role of person
// changing foaf:Organization to info content entity. Org no longer applies here - tlw72
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?person) \n" +
"WHERE {\n"
+ "?uri rdf:type obo:IAO_0000030 . \n"
+ "?uri core:contributingRole ?c . \n"
+ " ?c rdf:type core:EditorRole . \n "
+ " ?c obo:RO_0000052 ?d .\n"
+ "?d rdf:type foaf:Person .\n "
+ " }");
// Next two queries are covered by the previous two. Commenting them out - tlw72
// If the person changes, update the information resource associated with editor role
/* multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?informationResource) \n" +
"WHERE {\n"
+ "?uri rdf:type foaf:Person ; ?b ?c . \n"
+ " ?c rdf:type core:EditorRole ; core:forInformationResource ?d .\n"
+ " }");
// If the organization changes, update the information resource associated with editor role
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?informationResource) \n" +
"WHERE {\n"
+ "?uri rdf:type foaf:Organization ; ?b ?c . \n"
+ " ?c rdf:type core:EditorRole ; core:forInformationResource ?d .\n"
+ " }");
*/
// core:ServiceProviderRole -- core:serviceProviderRoleOf
// If the person changes, update the service provider role in organization
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?organization) \n" +
"WHERE {\n"
+ "?uri rdf:type foaf:Person . \n"
+ "?uri obo:RO_0000053 ?c . \n"
+ " ?c rdf:type obo:ERO_0000012 . \n"
+ " ?c core:roleContributesTo ?d .\n"
+ " ?d rdf:type foaf:Organization .\n "
+ " }");
// If the organization changes, update the service provider role of person
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?person) \n" +
"WHERE {\n"
+ "?uri rdf:type foaf:Organization . \n"
+ "?uri core:contributingRole ?c . \n"
+ " ?c rdf:type obo:ERO_0000012 . \n "
+ " ?c obo:RO_0000052 ?d .\n"
+ "?d rdf:type foaf:Person .\n "
+ " }");
// core:TeacherRole -- core:teacherRoleOf
// If the person changes, update the teacher role in organization
// updated to make this an Event (e.g., a course) not an organization - tlw72
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?event) \n" +
"WHERE {\n"
+ "?uri rdf:type foaf:Person . \n"
+ "?uri obo:RO_0000053 ?c . \n"
+ " ?c rdf:type core:TeacherRole . \n"
+ " ?c obo:BFO_0000054 ?d .\n"
+ " ?d rdf:type event:Event .\n "
+ " }");
// If the organization changes, update the teacher role of person
// updated to make this an Event (e.g., a course) not an organization - tlw72
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?person) \n" +
"WHERE {\n"
+ "?uri rdf:type event:Event . \n"
+ "?uri obo:BFO_0000055 ?c . \n"
+ " ?c rdf:type core:TeacherRole . \n "
+ " ?c obo:RO_0000052 ?d .\n"
+ "?d rdf:type foaf:Person .\n "
+ " }");
// core:ReviewerRole -- core:forInformationResource, core:reviewerRoleOf
// core:PeerReviewerRole -- core:forInformationResource, core:reviewerRoleOf
// If the person changes, update the information resource associated with reviewer role
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?informationResource) \n " +
"WHERE {\n"
+ "?uri rdf:type foaf:Person . \n"
+ "?uri obo:RO_0000053 ?c . \n"
+ " ?c rdf:type core:ReviewerRole . \n"
+ " ?c core:roleContributesTo ?d .\n"
+ " ?d rdf:type obo:IAO_0000030 .\n "
+ " }");
// If the organization changes, update the information resource associated with reviewer role
multiValuedQueriesForRole.add(prefix +
"SELECT (str(?d) as ?informationResource) \n" +
"WHERE {\n"
+ "?uri rdf:type obo:IAO_0000030 . \n"
+ "?uri core:contributingRole ?c . \n"
+ " ?c rdf:type core:ReviewerRole. \n "
+ " ?c obo:RO_0000052 ?d .\n"
+ "?d rdf:type foaf:Person .\n "
+ " }");
}
static{
List<String> tmpList = new ArrayList<String>();
tmpList.add(multiValuedQueryForInformationContentEntity);
tmpList.addAll(multiValuedQueriesForAgent);
tmpList.addAll(multiValuedQueriesForRole);
tmpList.addAll( queriesForAuthorship());
tmpList.addAll(queriesForURLLink());
tmpList.addAll(queriesForEducationalTraining());
tmpList.addAll(queriesForPosition());
queryList = Collections.unmodifiableList(tmpList);
}
}

View file

@ -1,30 +0,0 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.search.indexing;
import java.util.ArrayList;
import java.util.List;
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import edu.cornell.mannlib.vitro.webapp.search.beans.StatementToURIsToUpdate;
/**
* Make a list of StatementToURIsToUpdate objects for use by the
* IndexBuidler.
*/
public class AdditionalUriFinders {
public static List<StatementToURIsToUpdate> getList(RDFService rdfService,
IndividualDao indDao) {
List<StatementToURIsToUpdate> uriFinders = new ArrayList<>();
uriFinders.add(new AdditionalURIsForDataProperties());
uriFinders.add(new AdditionalURIsForObjectProperties(rdfService));
uriFinders.add(new AdditionalURIsForContextNodes(rdfService));
uriFinders.add(new AdditionalURIsForTypeStatements());
uriFinders.add(new URIsForClassGroupChange(indDao));
uriFinders.add(new AdditionalUrisForVCards(rdfService));
return uriFinders;
}
}

View file

@ -1,122 +0,0 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.search.indexing;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.query.QuerySolution;
import com.hp.hpl.jena.query.QuerySolutionMap;
import com.hp.hpl.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.ResourceFactory;
import com.hp.hpl.jena.rdf.model.Statement;
import edu.cornell.mannlib.vitro.webapp.dao.jena.QueryUtils;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import edu.cornell.mannlib.vitro.webapp.search.beans.StatementToURIsToUpdate;
/**
* If the property of a VCard object is changed, we should re-index the owner of
* that VCard.
*/
public class AdditionalUrisForVCards implements StatementToURIsToUpdate {
private static final Log log = LogFactory
.getLog(AdditionalUrisForVCards.class);
private final String QUERY_FOR_RELATED = "" //
+ "prefix vcard: <http://www.w3.org/2006/vcard/ns#> \n"
+ "prefix obo: <http://purl.obolibrary.org/obo/> \n"
+ "SELECT ?uri WHERE { \n"
+ " ?subject a vcard:Identification . \n "
+ " ?contactInfo ?p ?subject . \n "
+ " ?uri obo:ARG_2000028 ?contactInfo . \n " //
+ "}";
private final RDFService rdfService;
public AdditionalUrisForVCards(RDFService rdfService) {
this.rdfService = rdfService;
}
@Override
public void startIndexing() {
// Nothing to set up.
}
@Override
public List<String> findAdditionalURIsToIndex(Statement stmt) {
if (stmt == null) {
return Collections.emptyList();
}
RDFNode sNode = stmt.getSubject();
if (sNode == null) {
log.warn("subject of modified statement was null.");
return Collections.emptyList();
}
if (!sNode.isURIResource()) {
return Collections.emptyList();
}
Resource subject = sNode.asResource();
String uri = subject.getURI();
if (uri == null) {
log.warn("subject of modified statement had a null URI.");
return Collections.emptyList();
}
return ownersOfVCard(uri);
}
/**
* If the subject of the statement is a vcard:Identification, then we also
* want to index the owner of the vcard:ContactInfo that references this
* vcard:Identification.
*
* vcard:Identification is a superclass of vcard:Name, vcard:Email,
* vcard:Telephone, vcard:Address, and vcard:URL.
*
* @see https://wiki.duraspace.org/display/VIVO/VCard+usage+diagram
*/
private List<String> ownersOfVCard(String subjectUri) {
List<String> additionalUris = new ArrayList<>();
QuerySolutionMap initialBinding = new QuerySolutionMap();
Resource subjectResource = ResourceFactory.createResource(subjectUri);
initialBinding.add("subject", subjectResource);
ResultSet results = QueryUtils.getQueryResults(QUERY_FOR_RELATED,
initialBinding, rdfService);
while (results.hasNext()) {
QuerySolution soln = results.nextSolution();
RDFNode node = soln.get("uri");
if (node != null) {
if (node.isURIResource()) {
additionalUris.add(node.asResource().getURI());
} else {
log.warn("value from query for 'uri'"
+ " was not a URIResource, it was " + node);
}
} else {
log.warn("value for query for 'uri' was null");
}
}
return additionalUris;
}
@Override
public void endIndxing() {
// Nothing to tear down.
}
}

View file

@ -1,6 +1,6 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.search.documentBuilding;
package edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding;
import java.util.ArrayList;
import java.util.HashSet;
@ -36,7 +36,7 @@ import edu.cornell.mannlib.vitro.webapp.utils.configuration.ContextModelsUser;
public class CalculateParameters implements DocumentModifier, ContextModelsUser {
private boolean shutdown = false;
private Dataset dataset;
private volatile Dataset dataset;
// public static int totalInd=1;
private static final String prefix = "prefix owl: <http://www.w3.org/2002/07/owl#> "
@ -254,6 +254,13 @@ public class CalculateParameters implements DocumentModifier, ContextModelsUser
public void shutdown(){
shutdown=true;
}
@Override
public String toString() {
return this.getClass().getSimpleName() + "[]";
}
}
class TotalInd implements Runnable{

View file

@ -0,0 +1,388 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.searchindex.extensions;
import static edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames.ALLTEXT;
import static edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames.ALLTEXTUNSTEMMED;
import static edu.cornell.mannlib.vitro.webapp.utils.sparql.SelectQueryRunner.createQueryContext;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.rdf.model.ResourceFactory;
import com.hp.hpl.jena.rdf.model.Statement;
import com.hp.hpl.jena.vocabulary.RDFS;
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ContextModelAccess;
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchInputDocument;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.DocumentModifier;
import edu.cornell.mannlib.vitro.webapp.searchindex.indexing.IndexingUriFinder;
import edu.cornell.mannlib.vitro.webapp.utils.configuration.ContextModelsUser;
import edu.cornell.mannlib.vitro.webapp.utils.configuration.Property;
import edu.cornell.mannlib.vitro.webapp.utils.configuration.Validation;
/**
* If an individual has context nodes then the search document for that
* individual should include the labels of the partners across those nodes. The
* labels will be added to the ALLTEXT and ALLTEXTUNSTEMMED fields.
*
* We can add restrictions to say that this only applies to individuals of
* certain types. We can also restrict the type of the applicable context nodes.
*
* An instance of this class acts as both a DocumentModifier and an
* IndexingUriFinder:
*
* As a DocumentModifier, it looks across approved context nodes to fetch the
* labels of the partners.
*
* As an IndexingUriFinder, it recognizes that this relationship can be changed
* by a change to a "label" statement, or to a "relates" property, and finds all
* partners as candidates for reindexing.
*
* <pre>
* Configuration:
* rdfs:label -- Optional. Appears in the timings and debug statements.
* :hasTypeRestriction -- Optional. Match any. If none, then no restriction.
* :appliesToContextNodeType -- Optional. Match any. If none, then no restriction.
* </pre>
*/
public class LabelsAcrossContextNodes implements IndexingUriFinder,
DocumentModifier, ContextModelsUser {
private static final Log log = LogFactory
.getLog(LabelsAcrossContextNodes.class);
private RDFService rdfService;
/**
* A name to be used in logging, to identify this instance. If not provided,
* then a descriptive label will be created.
*/
private String label;
/**
* URIs of the types of individuals to whom this instance applies.
*
* If this is not empty and an individual does not have any of these types,
* then skip that individual.
*/
private Set<String> typeRestrictions = new HashSet<>();
/**
* URIs of the types of acceptable context nodes.
*
* If this is not empty and a context node does not have any of these types,
* then skip that context node's label.
*/
private Set<String> contextNodeClasses = new HashSet<>();
@Override
public void setContextModels(ContextModelAccess models) {
this.rdfService = models.getRDFService();
}
@Property(uri = "http://www.w3.org/2000/01/rdf-schema#label")
public void setLabel(String l) {
label = l;
}
@Property(uri = "http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#hasTypeRestriction")
public void addTypeRestriction(String typeUri) {
typeRestrictions.add(typeUri);
}
@Property(uri = "http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#appliesToContextNodeType")
public void addContextNodeClass(String cnc) {
contextNodeClasses.add(cnc);
}
@Validation
public void validate() {
if (label == null) {
label = String.format("%s[types=%s, contextNodeTypes=%s]", this
.getClass().getSimpleName(),
formatRestrictions(typeRestrictions),
formatRestrictions(contextNodeClasses));
}
}
private String formatRestrictions(Set<String> uris) {
if (uris.isEmpty()) {
return "ALL";
} else {
return localNames(uris).toString();
}
}
private Set<String> localNames(Set<String> uris) {
Set<String> names = new HashSet<>();
for (String uri : uris) {
try {
names.add(ResourceFactory.createResource(uri).getLocalName());
} catch (Exception e) {
log.warn("Failed to parse URI: " + uri, e);
names.add(uri);
}
}
return names;
}
@Override
public String toString() {
return (label == null) ? super.toString() : label;
}
// ----------------------------------------------------------------------
// DocumentModifier
// ----------------------------------------------------------------------
private static final String LABELS_WITHOUT_RESTRICTION = ""
+ "PREFIX vivo: <http://vivoweb.org/ontology/core#> \n"
+ "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n"
+ "SELECT ?label \n" //
+ "WHERE { \n" //
+ " ?uri vivo:relatedBy ?contextNode . \n" //
+ " ?contextNode vivo:relates ?partner . \n" //
+ " ?partner rdfs:label ?label . \n" //
+ " FILTER( ?uri != ?partner ) \n" //
+ "} \n";
private static final String LABELS_FOR_SPECIFIC_CONTEXT_NODE_TYPE = ""
+ "PREFIX vivo: <http://vivoweb.org/ontology/core#> \n"
+ "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n"
+ "SELECT ?label \n" //
+ "WHERE { \n" //
+ " ?uri vivo:relatedBy ?contextNode . \n" //
+ " ?contextNode a ?nodeType . \n" //
+ " ?contextNode vivo:relates ?partner . \n" //
+ " ?partner rdfs:label ?label . \n" //
+ " FILTER( ?uri != ?partner ) \n" //
+ "} \n";
/**
* If this individual is acceptable, locate the labels of any context
* partners across acceptable context nodes. Add those labels to the text
* fields of the search document.
*/
@Override
public void modifyDocument(Individual ind, SearchInputDocument doc) {
if (passesTypeRestriction(ind)) {
if (contextNodeClasses.isEmpty()) {
addLabelsFromAllContextNodeClasses(ind, doc);
} else {
for (String contextNodeClass : contextNodeClasses) {
addLabelsFromContextNodeClass(ind, doc, contextNodeClass);
}
}
}
}
private boolean passesTypeRestriction(Individual ind) {
if (typeRestrictions.isEmpty()) {
return true;
} else {
for (VClass type : ind.getVClasses()) {
if (typeRestrictions.contains(type.getURI())) {
return true;
}
}
}
return false;
}
private void addLabelsFromAllContextNodeClasses(Individual ind,
SearchInputDocument doc) {
addValuesToTextFields(doc,
createQueryContext(rdfService, LABELS_WITHOUT_RESTRICTION)
.bindVariableToUri("uri", ind.getURI()).execute()
.getStringFields("label").flatten());
}
private void addLabelsFromContextNodeClass(Individual ind,
SearchInputDocument doc, String contextNodeClass) {
addValuesToTextFields(
doc,
createQueryContext(rdfService,
LABELS_FOR_SPECIFIC_CONTEXT_NODE_TYPE)
.bindVariableToUri("uri", ind.getURI())
.bindVariableToUri("nodeType", contextNodeClass)
.execute().getStringFields("label").flatten());
}
private void addValuesToTextFields(SearchInputDocument doc,
List<String> values) {
for (String value : values) {
doc.addField(ALLTEXT, value);
doc.addField(ALLTEXTUNSTEMMED, value);
}
}
@Override
public void shutdown() {
// Nothing to shut down.
}
// ----------------------------------------------------------------------
// IndexingUriFinder
// ----------------------------------------------------------------------
private static final String URI_VIVO_RELATES = "http://vivoweb.org/ontology/core#relates";
private static final String LOCATE_PARTNERS_WITHOUT_RESTRICTION = ""
+ "PREFIX vivo: <http://vivoweb.org/ontology/core#> \n"
+ "SELECT ?partner \n" //
+ "WHERE { \n" //
+ " ?uri vivo:relatedBy ?contextNode . \n" //
+ " ?contextNode vivo:relates ?partner . \n" //
+ " FILTER( ?uri != ?partner ) \n" //
+ "} \n";
private static final String LOCATE_PARTNERS_ON_CONTEXT_NODE_TYPE = ""
+ "PREFIX vivo: <http://vivoweb.org/ontology/core#> \n"
+ "SELECT ?partner \n" //
+ "WHERE { \n" //
+ " ?uri vivo:relatedBy ?contextNode . \n" //
+ " ?contextNode vivo:relates ?partner . \n" //
+ " ?contextNode a ?nodeType . \n" //
+ " FILTER( ?uri != ?partner ) \n" //
+ "} \n";
private static final String LOCATE_OTHER_PARTNERS_ON_THIS_NODE = ""
+ "PREFIX vivo: <http://vivoweb.org/ontology/core#> \n"
+ "SELECT ?partner \n" //
+ "WHERE { \n" //
+ " ?contextNode vivo:relates ?partner . \n" //
+ " FILTER( ?uri != ?partner ) \n" //
+ "} \n";
private static final String GET_TYPES = "" //
+ "SELECT ?type \n" //
+ "WHERE { \n" //
+ " ?uri a ?type . \n" //
+ "} \n";
@Override
public void startIndexing() {
// Nothing to do.
}
/**
* If this is a "label" statement, check to see if the subject has any
* acceptable partners across acceptable context nodes.
*
* If this is a "relates" statement on an acceptable context node, check to
* see if there are any other acceptable partners on this node.
*
* We could also check for "relatedBy" statements, but they should happen in
* pairs with the "relates" statements.
*/
@Override
public List<String> findAdditionalURIsToIndex(Statement stmt) {
if (isLabelStatement(stmt)) {
return filterByType(locatePartners(stmt));
} else if (isRelatesStatementOnAcceptableContextNode(stmt)) {
return filterByType(locateOtherPartners(stmt));
}
return Collections.emptyList();
}
private boolean isLabelStatement(Statement stmt) {
return RDFS.label.getURI().equals(stmt.getPredicate().getURI());
}
private Set<String> locatePartners(Statement stmt) {
String uri = stmt.getSubject().getURI();
if (contextNodeClasses.isEmpty()) {
return locatePartnersWithoutRestriction(uri);
} else {
Set<String> uris = new HashSet<>();
for (String contextNodeClass : contextNodeClasses) {
uris.addAll(locatePartnersAcrossContextNodeClass(uri,
contextNodeClass));
}
return uris;
}
}
private Set<String> locatePartnersWithoutRestriction(String uri) {
return createQueryContext(rdfService,
LOCATE_PARTNERS_WITHOUT_RESTRICTION)
.bindVariableToUri("uri", uri).execute()
.getStringFields("partner").flattenToSet();
}
private Collection<? extends String> locatePartnersAcrossContextNodeClass(
String uri, String contextNodeClass) {
return createQueryContext(rdfService,
LOCATE_PARTNERS_ON_CONTEXT_NODE_TYPE)
.bindVariableToUri("uri", uri)
.bindVariableToUri("nodeType", contextNodeClass).execute()
.getStringFields("partner").flattenToSet();
}
private boolean isRelatesStatementOnAcceptableContextNode(Statement stmt) {
String subjectUri = stmt.getSubject().getURI();
String predicateUri = stmt.getPredicate().getURI();
if (URI_VIVO_RELATES.equals(predicateUri)
&& (contextNodeClasses.isEmpty() || isAnyMatch(
contextNodeClasses, getTypes(subjectUri)))) {
return true;
} else {
return false;
}
}
private boolean isAnyMatch(Set<String> set1, Set<String> set2) {
Set<String> matches = new HashSet<>(set1);
matches.retainAll(set2);
return !matches.isEmpty();
}
private Set<String> getTypes(String uri) {
return createQueryContext(rdfService, GET_TYPES)
.bindVariableToUri("uri", uri).execute()
.getStringFields("type").flattenToSet();
}
private Set<String> locateOtherPartners(Statement stmt) {
if (!stmt.getSubject().isURIResource()) {
return Collections.emptySet();
}
String nodeUri = stmt.getSubject().getURI();
String objectUri = (stmt.getObject().isURIResource()) ? stmt
.getObject().asResource().getURI() : "NO_MATCH";
return createQueryContext(rdfService,
LOCATE_OTHER_PARTNERS_ON_THIS_NODE)
.bindVariableToUri("contextNode", nodeUri)
.bindVariableToUri("uri", objectUri).execute()
.getStringFields("partner").flattenToSet();
}
private List<String> filterByType(Collection<String> uris) {
if (typeRestrictions.isEmpty()) {
return new ArrayList<>(uris);
} else {
List<String> filtered = new ArrayList<>();
for (String uri : uris) {
if (isAnyMatch(typeRestrictions, getTypes(uri))) {
filtered.add(uri);
}
}
return filtered;
}
}
@Override
public void endIndexing() {
// Nothing to do.
}
}

View file

@ -37,6 +37,8 @@ public class IndividualTemplateModel extends BaseIndividualTemplateModel {
private static final String CREDENTIAL_CLASS = "http://vivoweb.org/ontology/core#Credential";
private static final String DTP_CLASS = "http://vivoweb.org/ontology/core#DateTimeValuePrecision";
private static final String ORGANIZATION_CLASS = FOAF + "Organization";
private static final String EVENT_CLASS = "http://purl.org/NET/c4dm/event.owl#Event";
private static final String INFO_CONTENT_ENTITY_CLASS = "http://purl.obolibrary.org/obo/IAO_0000030";
private static final String BASE_VISUALIZATION_URL =
UrlBuilder.getUrl(Route.VISUALIZATION_SHORT.path());
@ -79,6 +81,14 @@ public class IndividualTemplateModel extends BaseIndividualTemplateModel {
return isVClass(ORGANIZATION_CLASS);
}
public boolean event() {
return isVClass(EVENT_CLASS);
}
public boolean infoContentEntity() {
return isVClass(INFO_CONTENT_ENTITY_CLASS);
}
public String coAuthorVisUrl() {
String url = BASE_VISUALIZATION_URL + "/" + VisualizationFrameworkConstants.COAUTHORSHIP_VIS_SHORT_URL + "/";
return getVisUrl(url);

View file

@ -1,97 +0,0 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.search.documentBuilding;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.io.InputStream;
import org.junit.BeforeClass;
import org.junit.Test;
import stubs.edu.cornell.mannlib.vitro.webapp.modelaccess.ContextModelAccessStub;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.ResourceFactory;
import edu.cornell.mannlib.vitro.testing.AbstractTestClass;
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.beans.IndividualImpl;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.WhichService;
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.jena.model.RDFServiceModel;
public class VivoAgentContextNodeFieldsTest extends AbstractTestClass{
static String SPCA = "http://vivo.mydomain.edu/individual/n8087";
static ContextModelAccessStub contextModels;
@BeforeClass
public static void setup(){
Model m = ModelFactory.createDefaultModel();
InputStream stream = VivoAgentContextNodeFieldsTest
.class.getResourceAsStream("./NIHVIVO3853_DataSet1.rdf");
long preloadSize = m.size();
m.read(stream, null);
assertTrue("expected to load statements from file", m.size() > preloadSize );
assertTrue("expect statements about SPCA",
m.contains(ResourceFactory.createResource(SPCA),(Property) null,(RDFNode) null));
contextModels = new ContextModelAccessStub();
contextModels.setRDFService(WhichService.CONTENT, new RDFServiceModel(m));
}
@Test
public void testJane(){
Individual ind = new IndividualImpl();
ind.setURI(SPCA);
VivoAgentContextNodeFields vacnf = new VivoAgentContextNodeFields();
vacnf.setContextModels(contextModels);
StringBuffer sb = vacnf.getValues( ind );
assertNotNull( sb );
String values = sb.toString();
boolean hasJane = values.toLowerCase().indexOf("jane") > 0;
assertTrue("expected to have jane because SPCA advises jane", hasJane);
}
@Test
public void testWonder(){
Individual ind = new IndividualImpl();
ind.setURI(SPCA);
VivoAgentContextNodeFields vacnf = new VivoAgentContextNodeFields();
vacnf.setContextModels(contextModels);
StringBuffer sb = vacnf.getValues( ind );
assertNotNull( sb );
String values = sb.toString();
boolean hasWonder = values.toLowerCase().indexOf("wonders") > 0;
assertTrue("expected to have jane because SPCA won wonders award", hasWonder);
}
@Test
public void testChimp(){
Individual ind = new IndividualImpl();
ind.setURI(SPCA);
VivoAgentContextNodeFields vacnf = new VivoAgentContextNodeFields();
vacnf.setContextModels(contextModels);
StringBuffer sb = vacnf.getValues( ind );
assertNotNull( sb );
String values = sb.toString();
boolean hasNotChimp = ! (values.toLowerCase().indexOf("chimp") > 0);
assertTrue("expected to not have chimp because jane won chimp award, not SPCA", hasNotChimp);
}
}

View file

@ -1,82 +0,0 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.search.documentBuilding;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.io.InputStream;
import org.apache.commons.lang.StringUtils;
import org.junit.BeforeClass;
import org.junit.Test;
import stubs.edu.cornell.mannlib.vitro.webapp.modelaccess.ContextModelAccessStub;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.ResourceFactory;
import edu.cornell.mannlib.vitro.testing.AbstractTestClass;
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.beans.IndividualImpl;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.WhichService;
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.jena.model.RDFServiceModel;
/**
* Second test for VivoAgentContextNodeFields. This is duplicated
* due to using a different data set in the test.
*
*/
public class VivoAgentContextNodeFieldsTest2 extends AbstractTestClass{
static String HISTORY_DEPT = "http://vivo.colorado.edu/deptid_10238" ;
static ContextModelAccessStub contextModels;
@BeforeClass
public static void setup(){
Model m = ModelFactory.createDefaultModel();
InputStream stream = VivoAgentContextNodeFieldsTest2
.class.getResourceAsStream("./VIVO146_DataSet1.n3");
assertTrue("Expected to find RDF data file " , stream != null );
long preloadSize = m.size();
m.read(stream, null, "N3");
assertTrue("expected to load statements from file", m.size() > preloadSize );
System.out.println("size of m : " + m.size());
assertTrue("expect statements about HISTORY_DEPT",
m.contains(ResourceFactory.createResource(HISTORY_DEPT),(Property) null,(RDFNode) null));
contextModels = new ContextModelAccessStub();
contextModels.setRDFService(WhichService.CONTENT, new RDFServiceModel(m));
}
/**
* Test how many times history is returned for context nodes
* of the History department.
*/
@Test
public void testHistory(){
Individual ind = new IndividualImpl();
ind.setURI(HISTORY_DEPT);
VivoAgentContextNodeFields vacnf = new VivoAgentContextNodeFields();
vacnf.setContextModels(contextModels);
StringBuffer sb = vacnf.getValues( ind );
assertNotNull( sb );
String value = sb.toString();
assertTrue("Expected to get some text back from "
+ "VivoAgentContextNodeFields but got none" , !value.trim().isEmpty());
int count = StringUtils.countMatches(value.toLowerCase(),"history");
System.out.println("histories: " + count);
System.out.println("'" + value + "'");
// assertTrue("expected to have jane because SPCA advises jane", hasJane);
}
}

View file

@ -1,79 +0,0 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.search.documentBuilding;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
import org.junit.Assert;
import org.junit.Test;
import stubs.edu.cornell.mannlib.vitro.webapp.modelaccess.ContextModelAccessStub;
import stubs.edu.cornell.mannlib.vitro.webapp.modules.ApplicationStub;
import stubs.edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchEngineStub;
import stubs.javax.servlet.ServletContextStub;
import com.hp.hpl.jena.ontology.OntModel;
import com.hp.hpl.jena.ontology.OntModelSpec;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import edu.cornell.mannlib.vitro.testing.AbstractTestClass;
import edu.cornell.mannlib.vitro.webapp.application.ApplicationUtils;
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
import edu.cornell.mannlib.vitro.webapp.dao.jena.WebappDaoFactoryJena;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.WhichService;
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchInputDocument;
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.jena.model.RDFServiceModel;
public class VivoInformationResourceContextNodeFieldsTest extends AbstractTestClass {
String TEST_NO_LABLE_N3_FILE = "VivoInformationResourceContextNodeFieldsTest.n3";
String RDFS_LABEL_VALUE = "Test Document X";
String DOCUMENT_URI = "http://example.com/vivo/individual/n7474";
@Test
public void testNoLabel() throws IOException{
ApplicationStub.setup(new ServletContextStub(), new SearchEngineStub());
//Test that rdfs:label is NOT added by the VivoInformationResourceContextNodeFields
//setup a model & wdf with test RDF file
InputStream stream = VivoInformationResourceContextNodeFieldsTest.class.getResourceAsStream(TEST_NO_LABLE_N3_FILE);
Model model = ModelFactory.createDefaultModel();
model.read(stream, null, "N3");
stream.close();
OntModel ontModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM,model);
ontModel.prepare();
Assert.assertTrue("ontModel had no statements" , ontModel.size() > 0 );
WebappDaoFactory wadf = new WebappDaoFactoryJena(ontModel);
Individual ind = wadf.getIndividualDao().getIndividualByURI(DOCUMENT_URI);
Assert.assertNotNull(ind);
ContextModelAccessStub contextModels = new ContextModelAccessStub();
contextModels.setRDFService(WhichService.CONTENT, new RDFServiceModel(ontModel));
SearchInputDocument doc = ApplicationUtils.instance().getSearchEngine().createInputDocument();
doc.addField("ALLTEXT", "");
VivoInformationResourceContextNodeFields vircnf = new VivoInformationResourceContextNodeFields();
vircnf.setContextModels(contextModels);
vircnf.modifyDocument(ind, doc);
Collection<Object> values = doc.getField("ALLTEXT").getValues();
for( Object value : values){
Assert.assertFalse("rdf:label erroneously added by document modifier:", value.toString().contains(RDFS_LABEL_VALUE));
}
VivoAgentContextNodeFields vacnf = new VivoAgentContextNodeFields();
vacnf.setContextModels(contextModels);
vacnf.modifyDocument(ind, doc);
}
}

View file

@ -1,19 +0,0 @@
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
<http://example.com/vivo/individual/n7474>
a <http://purl.org/ontology/bibo/Document> , owl:Thing , <http://purl.org/ontology/bibo/AudioDocument> , <http://vivoweb.org/ontology/core#InformationResource> ;
rdfs:label "Test Document X"@en-US ;
<http://purl.org/dc/terms/creator>
<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n4782> ;
<http://purl.org/dc/terms/title>
"Test Document X"@en-US ;
vitro:modTime "2011-11-01T11:11:49"^^xsd:dateTime ;
vitro:mostSpecificType
<http://purl.org/ontology/bibo/AudioDocument> ;
<http://vivoweb.org/ontology/core#informationResourceInAuthorship>
<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n7484> .

View file

@ -1,604 +0,0 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.search.indexing;
import static org.junit.Assert.assertTrue;
import java.io.StringReader;
import java.util.List;
import org.junit.Test;
import com.hp.hpl.jena.ontology.OntModel;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.jena.model.RDFServiceModel;
public class AdditionalURIsForContextNodesTest {
private AdditionalURIsForContextNodes uriFinder;
@Test
public void testPositionChanges(){
String n3 =
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5423> <http://vivoweb.org/ontology/core#relatedBy> <http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5431> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5423> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://vivoweb.org/ontology/core#AcademicDepartment> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5423> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Department> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5423> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Agent> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5423> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5423> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Organization> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5423> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#AcademicDepartment> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5431> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#DependentResource> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5431> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#DependentResource> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5431> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Position> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5431> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5431> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#FacultyPosition> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5431> <http://vivoweb.org/ontology/core#relates> <http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5423> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5431> <http://vivoweb.org/ontology/core#relates> <http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n932> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n932> <http://vivoweb.org/ontology/core#relatedBy> <http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5431> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n932> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://vivoweb.org/ontology/core#FacultyMember> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n932> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Agent> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n932> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n932> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n932> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#FacultyMember> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5398> <http://vivoweb.org/ontology/core#start> <http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5425> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5398> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://vivoweb.org/ontology/core#DateTimeInterval> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5398> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5398> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#DateTimeInterval> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5425> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5425> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#DateTimeValue> . \n" +
"<http://vivoweb.org/ontology/core#AcademicDepartment> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> . \n" +
"<http://vivoweb.org/ontology/core#Position> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> . \n" +
"<http://vivoweb.org/ontology/core#FacultyMember> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> . \n" +
"<http://xmlns.com/foaf/0.1/Organization> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> . \n" +
"<http://xmlns.com/foaf/0.1/Person> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> . \n" +
"<http://xmlns.com/foaf/0.1/Agent> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> . \n" +
"<http://vivoweb.org/ontology/core#DateTimeInterval> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> . \n" +
"<http://vivoweb.org/ontology/core#Department> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> . \n" ;
populateModelAndCreateUriFinder(n3);
//if the person changes then the org needs to be updated
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n932");
assertTrue("did not find org for context node", uris.contains("http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5423" ));
//if the org changes then the person needs to be updated
uris = uriFinder.findAdditionalURIsToIndex( "http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5423");
assertTrue("did not find person for context node", uris.contains("http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n932" ));
}
@Test
public void testPersonOnOrgChange() {
String n3 ="@prefix dc: <http://purl.org/dc/elements/1.1/> . \n" +
"@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . \n" +
"@prefix swrl: <http://www.w3.org/2003/11/swrl#> . \n" +
"@prefix vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> . \n" +
"@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . \n" +
"@prefix swrlb: <http://www.w3.org/2003/11/swrlb#> . \n" +
"@prefix owl: <http://www.w3.org/2002/07/owl#> . \n" +
"@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . \n" +
"@prefix core: <http://vivoweb.org/ontology/core#> . \n" +
"@prefix vivo: <http://vivo.library.cornell.edu/ns/0.1#> . \n" +
"@prefix obo: <http://purl.obolibrary.org/obo/> . \n" +
" " +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n2577> \n" +
" a owl:Thing , core:Role , core:LeaderRole ; \n" +
" rdfs:label \"head\"^^xsd:string ; \n" +
" vitro:mostSpecificType \n" +
" core:LeaderRole ; \n" +
" core:dateTimeInterval \n" +
" <http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n2594> ; \n" +
" obo:RO_0000052 <http://vivo.scripps.edu/individual/n14979> ; \n" +
" core:roleContributesTo <http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n2592> . \n" +
"<http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n2592> \n" +
" a <http://xmlns.com/foaf/0.1/Organization> , owl:Thing , <http://xmlns.com/foaf/0.1/Agent> , core:ClinicalOrganization ; \n" +
" rdfs:label \"Organization XYZ\"^^xsd:string ; \n" +
" vitro:mostSpecificType \n" +
" core:ClinicalOrganization ; \n" +
" core:contributingRole <http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n2577> . \n" +
" <http://vivo.scripps.edu/individual/n14979> a <http://xmlns.com/foaf/0.1/Person> , owl:Thing , <http://xmlns.com/foaf/0.1/Agent> . \n";
//make a test model with an person, an authorship context node and a book
populateModelAndCreateUriFinder(n3);
//get additional uris for org
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n2592");
assertTrue("did not find person for context node", uris.contains("http://vivo.scripps.edu/individual/n14979" ));
}
@Test
public void testLeaderRoleChanges(){
String n3=
"<http://vivo.scripps.edu/individual/n2027> <http://www.w3.org/2000/01/rdf-schema#label> \"1, Test\" . \n " +
// "<http://vivo.scripps.edu/individual/n2027> <http://xmlns.com/foaf/0.1/lastName> \"1\"^^<http://www.w3.org/2001/XMLSchema#string> . \n " +
// "<http://vivo.scripps.edu/individual/n2027> <http://xmlns.com/foaf/0.1/firstName> \"Test\"^^<http://www.w3.org/2001/XMLSchema#string> . \n " +
"<http://vivo.scripps.edu/individual/n2027> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://xmlns.com/foaf/0.1/Person> . \n " +
"<http://vivo.scripps.edu/individual/n2027> <http://purl.obolibrary.org/obo/RO_0000053> <http://vivo.scripps.edu/individual/n7067> . \n " +
"<http://vivo.scripps.edu/individual/n2027> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Agent> . \n " +
"<http://vivo.scripps.edu/individual/n2027> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> . \n " +
"<http://vivo.scripps.edu/individual/n2027> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n " +
"<http://vivo.scripps.edu/individual/n7067> <http://www.w3.org/2000/01/rdf-schema#label> \"Leader Role\"^^<http://www.w3.org/2001/XMLSchema#string> . \n " +
"<http://vivo.scripps.edu/individual/n7067> <http://purl.obolibrary.org/obo/RO_0000052> <http://vivo.scripps.edu/individual/n2027> . \n " +
"<http://vivo.scripps.edu/individual/n7067> <http://vivoweb.org/ontology/core#dateTimeInterval> <http://vivo.scripps.edu/individual/n7083> . \n " +
"<http://vivo.scripps.edu/individual/n7067> <http://vivoweb.org/ontology/core#roleContributesTo> <http://vivo.scripps.edu/individual/n7080> . \n " +
"<http://vivo.scripps.edu/individual/n7067> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://vivoweb.org/ontology/core#LeaderRole> . \n " +
"<http://vivo.scripps.edu/individual/n7067> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#LeaderRole> . \n " +
"<http://vivo.scripps.edu/individual/n7067> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n " +
"<http://vivo.scripps.edu/individual/n7080> <http://www.w3.org/2000/01/rdf-schema#label> \"University1\"^^<http://www.w3.org/2001/XMLSchema#string> . \n " +
"<http://vivo.scripps.edu/individual/n7080> <http://vivoweb.org/ontology/core#contributingRole> <http://vivo.scripps.edu/individual/n7067> . \n " +
"<http://vivo.scripps.edu/individual/n7080> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://vivoweb.org/ontology/core#University> .\n " +
"<http://vivo.scripps.edu/individual/n7080> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#University> . \n " +
"<http://vivo.scripps.edu/individual/n7080> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Agent> . \n " +
"<http://vivo.scripps.edu/individual/n7080> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n " +
"<http://vivo.scripps.edu/individual/n7080> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Organization> . \n " ;
populateModelAndCreateUriFinder(n3);
//if the person changes then the university needs to be updated
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n2027");
assertTrue("did not find org for context node", uris.contains("http://vivo.scripps.edu/individual/n7080" ));
//if the university changes then the person needs to be updated
uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n7080");
assertTrue("did not find person for context node", uris.contains("http://vivo.scripps.edu/individual/n2027" ));
}
@Test
public void testMemberRoleChanges(){
String n3 =
"<http://vivo.scripps.edu/individual/n4519> <http://purl.obolibrary.org/obo/RO_0000053> <http://vivo.scripps.edu/individual/n6040> . \n " +
"<http://vivo.scripps.edu/individual/n4519> <http://www.w3.org/2000/01/rdf-schema#label> \"2, Test\" . \n " +
// "<http://vivo.scripps.edu/individual/n4519> <http://xmlns.com/foaf/0.1/lastName> \"2\"^^<http://www.w3.org/2001/XMLSchema#string> . \n " +
// "<http://vivo.scripps.edu/individual/n4519> <http://xmlns.com/foaf/0.1/firstName> \"Test\"^^<http://www.w3.org/2001/XMLSchema#string> . \n " +
"<http://vivo.scripps.edu/individual/n4519> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://xmlns.com/foaf/0.1/Person> . \n " +
"<http://vivo.scripps.edu/individual/n4519> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Agent> . \n " +
"<http://vivo.scripps.edu/individual/n4519> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> . \n " +
"<http://vivo.scripps.edu/individual/n4519> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n " +
"<http://vivo.scripps.edu/individual/n6040> <http://www.w3.org/2000/01/rdf-schema#label> \"Member Role\"^^<http://www.w3.org/2001/XMLSchema#string> . \n " +
"<http://vivo.scripps.edu/individual/n6040> <http://vivoweb.org/ontology/core#dateTimeInterval> <http://vivo.scripps.edu/individual/n6031> . \n " +
"<http://vivo.scripps.edu/individual/n6040> <http://vivoweb.org/ontology/core#roleContributesTo> <http://vivo.scripps.edu/individual/n6004> . \n " +
"<http://vivo.scripps.edu/individual/n6040> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://vivoweb.org/ontology/core#MemberRole> . \n " +
"<http://vivo.scripps.edu/individual/n6040> <http://purl.obolibrary.org/obo/RO_0000052> <http://vivo.scripps.edu/individual/n4519> . \n " +
"<http://vivo.scripps.edu/individual/n6040> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#MemberRole> . \n " +
"<http://vivo.scripps.edu/individual/n6040> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Role> . \n " +
"<http://vivo.scripps.edu/individual/n6040> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n " +
"<http://vivo.scripps.edu/individual/n6004> <http://www.w3.org/2000/01/rdf-schema#label> \"University2\"^^<http://www.w3.org/2001/XMLSchema#string> . \n " +
"<http://vivo.scripps.edu/individual/n6004> <http://vivoweb.org/ontology/core#contributingRole> <http://vivo.scripps.edu/individual/n6040> . \n " +
"<http://vivo.scripps.edu/individual/n6004> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://vivoweb.org/ontology/core#University> . \n " +
"<http://vivo.scripps.edu/individual/n6004> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#University> . \n " +
"<http://vivo.scripps.edu/individual/n6004> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Agent> . \n " +
"<http://vivo.scripps.edu/individual/n6004> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n " +
"<http://vivo.scripps.edu/individual/n6004> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Organization> . \n " ;
populateModelAndCreateUriFinder(n3);
//if the person changes then the university needs to be updated
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n4519");
assertTrue("did not find org for context node", uris.contains("http://vivo.scripps.edu/individual/n6004" ));
//if the university changes then the person needs to be updated
uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n6004");
assertTrue("did not find person for context node", uris.contains("http://vivo.scripps.edu/individual/n4519" ));
}
@Test
public void testClinicalRoleChangesForProject(){
String n3 =
"<http://vivo.scripps.edu/individual/n4858> <http://www.w3.org/2000/01/rdf-schema#label> \"3, Test\" . \n" +
// "<http://vivo.scripps.edu/individual/n4858> <http://xmlns.com/foaf/0.1/lastName> \"3\"^^<http://www.w3.org/2001/XMLSchema#string> .\n" +
// "<http://vivo.scripps.edu/individual/n4858> <http://xmlns.com/foaf/0.1/firstName> \"Test\"^^<http://www.w3.org/2001/XMLSchema#string> . \n" +
"<http://vivo.scripps.edu/individual/n4858> <http://purl.obolibrary.org/obo/RO_0000053> <http://vivo.scripps.edu/individual/n5185> . \n" +
"<http://vivo.scripps.edu/individual/n4858> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://xmlns.com/foaf/0.1/Person> . \n" +
"<http://vivo.scripps.edu/individual/n4858> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Agent> . \n" +
"<http://vivo.scripps.edu/individual/n4858> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> . \n" +
"<http://vivo.scripps.edu/individual/n4858> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://vivo.scripps.edu/individual/n5185> <http://purl.obolibrary.org/obo/RO_0000052> <http://vivo.scripps.edu/individual/n4858> . \n" +
"<http://vivo.scripps.edu/individual/n5185> <http://www.w3.org/2000/01/rdf-schema#label> \"Clinical Role\"^^<http://www.w3.org/2001/XMLSchema#string> . \n" +
"<http://vivo.scripps.edu/individual/n5185> <http://vivoweb.org/ontology/core#dateTimeInterval> <http://vivo.scripps.edu/individual/n5180> . \n" +
"<http://vivo.scripps.edu/individual/n5185> <http://purl.obolibrary.org/obo/BFO_0000054> <http://vivo.scripps.edu/individual/n5177> . \n" +
"<http://vivo.scripps.edu/individual/n5185> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://vivoweb.org/ontology/core#ClinicalRole> . \n" +
"<http://vivo.scripps.edu/individual/n5185> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Role> . \n" +
"<http://vivo.scripps.edu/individual/n5185> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://vivo.scripps.edu/individual/n5185> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#ClinicalRole> . \n" +
"<http://vivo.scripps.edu/individual/n5177> <http://www.w3.org/2000/01/rdf-schema#label> \"Project1\"^^<http://www.w3.org/2001/XMLSchema#string> . \n" +
"<http://vivo.scripps.edu/individual/n5177> <http://purl.obolibrary.org/obo/BFO_0000055> <http://vivo.scripps.edu/individual/n5185> . \n" +
"<http://vivo.scripps.edu/individual/n5177> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://vivoweb.org/ontology/core#Project> . \n" +
"<http://vivo.scripps.edu/individual/n5177> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Project> . \n" +
"<http://vivo.scripps.edu/individual/n5177> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://vivo.scripps.edu/individual/n5177> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Process> . \n" ;
populateModelAndCreateUriFinder(n3);
//if the person changes then the project needs to be updated
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n4858");
assertTrue("did not find project for clinical role", uris.contains("http://vivo.scripps.edu/individual/n5177" ));
//if the project changes then the person needs to be updated
uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n5177");
assertTrue("did not find person for clinical role", uris.contains("http://vivo.scripps.edu/individual/n4858" ));
}
@Test
public void testClinicalRoleChangesForService(){
String n3 =
"<http://vivo.scripps.edu/individual/n5651> <http://www.w3.org/2000/01/rdf-schema#label> \"4, Test\" . \n" +
// "<http://vivo.scripps.edu/individual/n5651> <http://xmlns.com/foaf/0.1/lastName> \"4\"^^<http://www.w3.org/2001/XMLSchema#string> . \n" +
// "<http://vivo.scripps.edu/individual/n5651> <http://xmlns.com/foaf/0.1/firstName> \"Test\"^^<http://www.w3.org/2001/XMLSchema#string> . \n" +
"<http://vivo.scripps.edu/individual/n5651> <http://purl.obolibrary.org/obo/RO_0000053> <http://vivo.scripps.edu/individual/n4428> . \n" +
"<http://vivo.scripps.edu/individual/n5651> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://xmlns.com/foaf/0.1/Person> . \n" +
"<http://vivo.scripps.edu/individual/n5651> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Agent> . \n" +
"<http://vivo.scripps.edu/individual/n5651> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> . \n" +
"<http://vivo.scripps.edu/individual/n5651> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://vivo.scripps.edu/individual/n4428> <http://purl.obolibrary.org/obo/RO_0000052> <http://vivo.scripps.edu/individual/n5651> . \n" +
"<http://vivo.scripps.edu/individual/n4428> <http://www.w3.org/2000/01/rdf-schema#label> \"Clinical Role 2\"^^<http://www.w3.org/2001/XMLSchema#string> . \n" +
"<http://vivo.scripps.edu/individual/n4428> <http://vivoweb.org/ontology/core#dateTimeInterval> <http://vivo.scripps.edu/individual/n4444> . \n" +
"<http://vivo.scripps.edu/individual/n4428> <http://vivoweb.org/ontology/core#roleContributesTo> <http://vivo.scripps.edu/individual/n4442> . \n" +
"<http://vivo.scripps.edu/individual/n4428> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://vivoweb.org/ontology/core#ClinicalRole> . \n" +
"<http://vivo.scripps.edu/individual/n4428> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Role> . \n" +
"<http://vivo.scripps.edu/individual/n4428> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://vivo.scripps.edu/individual/n4428> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#ClinicalRole> . \n" +
"<http://vivo.scripps.edu/individual/n4442> <http://www.w3.org/2000/01/rdf-schema#label> \"Service1\"^^<http://www.w3.org/2001/XMLSchema#string> . \n" +
"<http://vivo.scripps.edu/individual/n4442> <http://vivoweb.org/ontology/core#contributingRole> <http://vivo.scripps.edu/individual/n4428> . \n" +
"<http://vivo.scripps.edu/individual/n4442> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://purl.obolibrary.org/obo/ERO_0000005> . \n" +
"<http://vivo.scripps.edu/individual/n4442> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://vivo.scripps.edu/individual/n4442> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.obolibrary.org/obo/ERO_0000005> . \n" ;
populateModelAndCreateUriFinder(n3);
//if the person changes then the service needs to be updated
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n5651");
assertTrue("did not find service for clinical role", uris.contains("http://vivo.scripps.edu/individual/n4442" ));
//if the service changes then the person needs to be updated
uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n4442");
assertTrue("did not find person for clinical role", uris.contains("http://vivo.scripps.edu/individual/n5651" ));
}
@Test
public void testPresenterRoleChangesForPresentation(){
String n3 =
"<http://vivo.scripps.edu/individual/n5596> <http://purl.obolibrary.org/obo/RO_0000053> <http://vivo.scripps.edu/individual/n1294> . \n" +
"<http://vivo.scripps.edu/individual/n5596> <http://www.w3.org/2000/01/rdf-schema#label> \"5, Test\" . \n" +
// "<http://vivo.scripps.edu/individual/n5596> <http://xmlns.com/foaf/0.1/lastName> \"5\"^^<http://www.w3.org/2001/XMLSchema#string> . \n" +
// "<http://vivo.scripps.edu/individual/n5596> <http://xmlns.com/foaf/0.1/firstName> \"Test\"^^<http://www.w3.org/2001/XMLSchema#string> . \n" +
"<http://vivo.scripps.edu/individual/n5596> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://xmlns.com/foaf/0.1/Person> . \n" +
"<http://vivo.scripps.edu/individual/n5596> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Agent> . \n" +
"<http://vivo.scripps.edu/individual/n5596> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> . \n" +
"<http://vivo.scripps.edu/individual/n5596> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://vivo.scripps.edu/individual/n1294> <http://purl.obolibrary.org/obo/RO_0000052> <http://vivo.scripps.edu/individual/n5596> . \n" +
"<http://vivo.scripps.edu/individual/n1294> <http://www.w3.org/2000/01/rdf-schema#label> \"Presenter Role\"^^<http://www.w3.org/2001/XMLSchema#string> . \n" +
"<http://vivo.scripps.edu/individual/n1294> <http://vivoweb.org/ontology/core#dateTimeInterval> <http://vivo.scripps.edu/individual/n1304> . \n" +
"<http://vivo.scripps.edu/individual/n1294> <http://purl.obolibrary.org/obo/BFO_0000054> <http://vivo.scripps.edu/individual/n1305> . \n" +
"<http://vivo.scripps.edu/individual/n1294> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://vivoweb.org/ontology/core#PresenterRole> . \n" +
"<http://vivo.scripps.edu/individual/n1294> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Role> . \n" +
"<http://vivo.scripps.edu/individual/n1294> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#PresenterRole> . \n" +
"<http://vivo.scripps.edu/individual/n1294> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://vivo.scripps.edu/individual/n1305> <http://www.w3.org/2000/01/rdf-schema#label> \"Presentation 1\"^^<http://www.w3.org/2001/XMLSchema#string> . \n" +
"<http://vivo.scripps.edu/individual/n1305> <http://purl.obolibrary.org/obo/BFO_0000055> <http://vivo.scripps.edu/individual/n1294> . \n" +
"<http://vivo.scripps.edu/individual/n1305> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://vivoweb.org/ontology/core#Presentation> . \n" +
"<http://vivo.scripps.edu/individual/n1305> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Presentation> . \n" +
"<http://vivo.scripps.edu/individual/n1305> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.org/NET/c4dm/event.owl#Event> . \n" +
"<http://vivo.scripps.edu/individual/n1305> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" ;
populateModelAndCreateUriFinder(n3);
//if the person changes then the presentation needs to be updated
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n5596");
assertTrue("did not find service for clinical role", uris.contains("http://vivo.scripps.edu/individual/n1305" ));
//if the presentation changes then the person needs to be updated
uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n1305");
assertTrue("did not find person for clinical role", uris.contains("http://vivo.scripps.edu/individual/n5596" ));
}
@Test
public void testPresenterRoleChangesForInvitedTalk(){
String n3 =
"<http://vivo.scripps.edu/individual/n4112> <http://purl.obolibrary.org/obo/RO_0000053> <http://vivo.scripps.edu/individual/n4144> . \n " +
"<http://vivo.scripps.edu/individual/n4112> <http://www.w3.org/2000/01/rdf-schema#label> \"6, Test\" . \n " +
// "<http://vivo.scripps.edu/individual/n4112> <http://xmlns.com/foaf/0.1/lastName> \"6\"^^<http://www.w3.org/2001/XMLSchema#string> . \n " +
// "<http://vivo.scripps.edu/individual/n4112> <http://xmlns.com/foaf/0.1/firstName> \"Test\"^^<http://www.w3.org/2001/XMLSchema#string> . \n " +
"<http://vivo.scripps.edu/individual/n4112> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://xmlns.com/foaf/0.1/Person> . \n " +
"<http://vivo.scripps.edu/individual/n4112> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Agent> . \n " +
"<http://vivo.scripps.edu/individual/n4112> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> . \n " +
"<http://vivo.scripps.edu/individual/n4112> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n " +
"<http://vivo.scripps.edu/individual/n4144> <http://purl.obolibrary.org/obo/RO_0000052> <http://vivo.scripps.edu/individual/n4112> . \n " +
"<http://vivo.scripps.edu/individual/n4144> <http://www.w3.org/2000/01/rdf-schema#label> \"Presenter Role 2\"^^<http://www.w3.org/2001/XMLSchema#string> . \n " +
"<http://vivo.scripps.edu/individual/n4144> <http://vivoweb.org/ontology/core#dateTimeInterval> <http://vivo.scripps.edu/individual/n4136> . \n " +
"<http://vivo.scripps.edu/individual/n4144> <http://purl.obolibrary.org/obo/BFO_0000054> <http://vivo.scripps.edu/individual/n4107> . \n " +
"<http://vivo.scripps.edu/individual/n4144> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://vivoweb.org/ontology/core#PresenterRole> . \n " +
"<http://vivo.scripps.edu/individual/n4144> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Role> . \n " +
"<http://vivo.scripps.edu/individual/n4144> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#PresenterRole> . \n " +
"<http://vivo.scripps.edu/individual/n4144> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n " +
"<http://vivo.scripps.edu/individual/n4107> <http://www.w3.org/2000/01/rdf-schema#label> \"Invited Talk 1\"^^<http://www.w3.org/2001/XMLSchema#string> . \n " +
"<http://vivo.scripps.edu/individual/n4107> <http://purl.obolibrary.org/obo/BFO_0000055> <http://vivo.scripps.edu/individual/n4144> . \n " +
"<http://vivo.scripps.edu/individual/n4107> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://vivoweb.org/ontology/core#InvitedTalk> . \n " +
"<http://vivo.scripps.edu/individual/n4107> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Presentation> . \n " +
"<http://vivo.scripps.edu/individual/n4107> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.org/NET/c4dm/event.owl#Event> . \n " +
"<http://vivo.scripps.edu/individual/n4107> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n " +
"<http://vivo.scripps.edu/individual/n4107> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#InvitedTalk> . \n " ;
populateModelAndCreateUriFinder(n3);
//if the person changes then the invited talk needs to be updated
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n4112");
assertTrue("did not find invited talk for person", uris.contains("http://vivo.scripps.edu/individual/n4107" ));
//if the invited talk changes then the person needs to be updated
uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n4107");
assertTrue("did not find person for invited talk", uris.contains("http://vivo.scripps.edu/individual/n4112" ));
}
@Test
public void testResearcherRoleForGrant(){
String n3 =
"<http://vivo.scripps.edu/individual/n4957> <http://www.w3.org/2000/01/rdf-schema#label> \"7, Test\" . \n" +
// "<http://vivo.scripps.edu/individual/n4957> <http://xmlns.com/foaf/0.1/lastName> \"7\"^^<http://www.w3.org/2001/XMLSchema#string> . \n" +
// "<http://vivo.scripps.edu/individual/n4957> <http://xmlns.com/foaf/0.1/firstName> \"Test\"^^<http://www.w3.org/2001/XMLSchema#string> . \n" +
"<http://vivo.scripps.edu/individual/n4957> <http://purl.obolibrary.org/obo/RO_0000053> <http://vivo.scripps.edu/individual/n4288> . \n" +
"<http://vivo.scripps.edu/individual/n4957> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://xmlns.com/foaf/0.1/Person> . \n" +
"<http://vivo.scripps.edu/individual/n4957> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Agent> . \n" +
"<http://vivo.scripps.edu/individual/n4957> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> . \n" +
"<http://vivo.scripps.edu/individual/n4957> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://vivo.scripps.edu/individual/n4288> <http://www.w3.org/2000/01/rdf-schema#label> \"Researcher Role\"^^<http://www.w3.org/2001/XMLSchema#string> . \n" +
"<http://vivo.scripps.edu/individual/n4288> <http://vivoweb.org/ontology/core#dateTimeInterval> <http://vivo.scripps.edu/individual/n4251> . \n" +
"<http://vivo.scripps.edu/individual/n4288> <http://vivoweb.org/ontology/core#relatedBy> <http://vivo.scripps.edu/individual/n4252> . \n" +
"<http://vivo.scripps.edu/individual/n4288> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://vivoweb.org/ontology/core#ResearcherRole> . \n" +
"<http://vivo.scripps.edu/individual/n4288> <http://purl.obolibrary.org/obo/RO_0000052> <http://vivo.scripps.edu/individual/n4957> . \n" +
"<http://vivo.scripps.edu/individual/n4288> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Role> . \n" +
"<http://vivo.scripps.edu/individual/n4288> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#ResearcherRole> . \n" +
"<http://vivo.scripps.edu/individual/n4288> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://vivo.scripps.edu/individual/n4252> <http://www.w3.org/2000/01/rdf-schema#label> \"Grant1\"^^<http://www.w3.org/2001/XMLSchema#string> . \n" +
"<http://vivo.scripps.edu/individual/n4252> <http://vivoweb.org/ontology/core#relates> <http://vivo.scripps.edu/individual/n4288> . \n" +
"<http://vivo.scripps.edu/individual/n4252> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://vivoweb.org/ontology/core#Grant> . \n" +
"<http://vivo.scripps.edu/individual/n4252> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Agreement> . \n" +
"<http://vivo.scripps.edu/individual/n4252> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://vivo.scripps.edu/individual/n4252> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Grant> . \n" ;
populateModelAndCreateUriFinder(n3);
//if the person changes then the grant needs to be updated
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n4957");
assertTrue("did not find service for clinical role", uris.contains("http://vivo.scripps.edu/individual/n4252" ));
//if the grant changes then the person needs to be updated
uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n4252");
assertTrue("did not find person for clinical role", uris.contains("http://vivo.scripps.edu/individual/n4957" ));
}
@Test
public void testResearcherRoleForProject(){
String n3 =
"<http://vivo.scripps.edu/individual/n2029> <http://www.w3.org/2000/01/rdf-schema#label> \"8, Test\" . \n " +
// "<http://vivo.scripps.edu/individual/n2029> <http://xmlns.com/foaf/0.1/lastName> \"8\"^^<http://www.w3.org/2001/XMLSchema#string> . \n " +
// "<http://vivo.scripps.edu/individual/n2029> <http://xmlns.com/foaf/0.1/firstName> \"Test\"^^<http://www.w3.org/2001/XMLSchema#string> . \n " +
"<http://vivo.scripps.edu/individual/n2029> <http://purl.obolibrary.org/obo/RO_0000053> <http://vivo.scripps.edu/individual/n556> . \n " +
"<http://vivo.scripps.edu/individual/n2029> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://xmlns.com/foaf/0.1/Person> . \n " +
"<http://vivo.scripps.edu/individual/n2029> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Agent> . \n " +
"<http://vivo.scripps.edu/individual/n2029> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> . \n " +
"<http://vivo.scripps.edu/individual/n2029> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n " +
"<http://vivo.scripps.edu/individual/n556> <http://www.w3.org/2000/01/rdf-schema#label> \"Researcher Role 2\"^^<http://www.w3.org/2001/XMLSchema#string> . \n " +
"<http://vivo.scripps.edu/individual/n556> <http://vivoweb.org/ontology/core#dateTimeInterval> <http://vivo.scripps.edu/individual/n568> . \n " +
"<http://vivo.scripps.edu/individual/n556> <http://purl.obolibrary.org/obo/BFO_0000054> <http://vivo.scripps.edu/individual/n564> . \n " +
"<http://vivo.scripps.edu/individual/n556> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://vivoweb.org/ontology/core#ResearcherRole> . \n " +
"<http://vivo.scripps.edu/individual/n556> <http://purl.obolibrary.org/obo/RO_0000052> <http://vivo.scripps.edu/individual/n2029> . \n " +
"<http://vivo.scripps.edu/individual/n556> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Role> . \n " +
"<http://vivo.scripps.edu/individual/n556> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#ResearcherRole> . \n " +
"<http://vivo.scripps.edu/individual/n556> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n " +
"<http://vivo.scripps.edu/individual/n564> <http://www.w3.org/2000/01/rdf-schema#label> \"Project2\"^^<http://www.w3.org/2001/XMLSchema#string> . \n " +
"<http://vivo.scripps.edu/individual/n564> <http://purl.obolibrary.org/obo/BFO_0000055> <http://vivo.scripps.edu/individual/n556> . \n " +
"<http://vivo.scripps.edu/individual/n564> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://vivoweb.org/ontology/core#Project> . \n " +
"<http://vivo.scripps.edu/individual/n564> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Project> . \n " +
"<http://vivo.scripps.edu/individual/n564> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n " +
"<http://vivo.scripps.edu/individual/n564> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Process> . \n " ;
populateModelAndCreateUriFinder(n3);
//if the person changes then the project needs to be updated
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n2029");
assertTrue("did not find service for clinical role", uris.contains("http://vivo.scripps.edu/individual/n564" ));
//if the project changes then the person needs to be updated
uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n564");
assertTrue("did not find person for clinical role", uris.contains("http://vivo.scripps.edu/individual/n2029" ));
}
@Test
public void testPrincipalInvestigatorRoleChanges(){
String n3 =
"<http://vivo.scripps.edu/individual/n2368> <http://purl.obolibrary.org/obo/RO_0000053> <http://vivo.scripps.edu/individual/n1740> . \n" +
"<http://vivo.scripps.edu/individual/n2368> <http://www.w3.org/2000/01/rdf-schema#label> \"8, Test\" . \n" +
// "<http://vivo.scripps.edu/individual/n2368> <http://xmlns.com/foaf/0.1/lastName> \"8\"^^<http://www.w3.org/2001/XMLSchema#string> . \n" +
// "<http://vivo.scripps.edu/individual/n2368> <http://xmlns.com/foaf/0.1/firstName> \"Test\"^^<http://www.w3.org/2001/XMLSchema#string> . \n" +
"<http://vivo.scripps.edu/individual/n2368> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://xmlns.com/foaf/0.1/Person> . \n" +
"<http://vivo.scripps.edu/individual/n2368> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Agent> . \n" +
"<http://vivo.scripps.edu/individual/n2368> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> . \n" +
"<http://vivo.scripps.edu/individual/n2368> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://vivo.scripps.edu/individual/n1740> <http://purl.obolibrary.org/obo/RO_0000052> <http://vivo.scripps.edu/individual/n2368> . \n" +
"<http://vivo.scripps.edu/individual/n1740> <http://vivoweb.org/ontology/core#dateTimeInterval> <http://vivo.scripps.edu/individual/n1756> . \n" +
"<http://vivo.scripps.edu/individual/n1740> <http://vivoweb.org/ontology/core#relatedBy> <http://vivo.scripps.edu/individual/n1742> . \n" +
"<http://vivo.scripps.edu/individual/n1740> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://vivoweb.org/ontology/core#PrincipalInvestigatorRole> . \n" +
"<http://vivo.scripps.edu/individual/n1740> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Role> . \n" +
"<http://vivo.scripps.edu/individual/n1740> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#PrincipalInvestigatorRole> . \n" +
"<http://vivo.scripps.edu/individual/n1740> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#ResearcherRole> . \n" +
"<http://vivo.scripps.edu/individual/n1740> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://vivo.scripps.edu/individual/n1740> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#InvestigatorRole> . \n" +
"<http://vivo.scripps.edu/individual/n1742> <http://www.w3.org/2000/01/rdf-schema#label> \"Grant 2\"^^<http://www.w3.org/2001/XMLSchema#string> . \n" +
"<http://vivo.scripps.edu/individual/n1742> <http://vivoweb.org/ontology/core#relates> <http://vivo.scripps.edu/individual/n1740> . \n" +
"<http://vivo.scripps.edu/individual/n1742> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://vivoweb.org/ontology/core#Grant> . \n" +
"<http://vivo.scripps.edu/individual/n1742> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Agreement> . \n" +
"<http://vivo.scripps.edu/individual/n1742> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://vivo.scripps.edu/individual/n1742> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Grant> . \n" ;
populateModelAndCreateUriFinder(n3);
//if the person changes then the grant needs to be updated
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n2368");
assertTrue("did not find grant for pi", uris.contains("http://vivo.scripps.edu/individual/n1742" ));
//if the grant changes then the person needs to be updated
uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n1742");
assertTrue("did not find pi for grant", uris.contains("http://vivo.scripps.edu/individual/n2368" ));
}
@Test
public void testCoPrincipalInvestigatorRoleChanges(){
String n3 =
"<http://vivo.scripps.edu/individual/n1373> <http://www.w3.org/2000/01/rdf-schema#label> \"9, Test\" . \n" +
// "<http://vivo.scripps.edu/individual/n1373> <http://xmlns.com/foaf/0.1/lastName> \"9\"^^<http://www.w3.org/2001/XMLSchema#string> . \n" +
// "<http://vivo.scripps.edu/individual/n1373> <http://xmlns.com/foaf/0.1/firstName> \"Test\"^^<http://www.w3.org/2001/XMLSchema#string> . \n" +
"<http://vivo.scripps.edu/individual/n1373> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://xmlns.com/foaf/0.1/Person> . \n" +
"<http://vivo.scripps.edu/individual/n1373> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Agent> . \n" +
"<http://vivo.scripps.edu/individual/n1373> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> . \n" +
"<http://vivo.scripps.edu/individual/n1373> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://vivo.scripps.edu/individual/n1373> <http://purl.obolibrary.org/obo/RO_0000053> <http://vivo.scripps.edu/individual/n4928> . \n" +
"<http://vivo.scripps.edu/individual/n4928> <http://purl.obolibrary.org/obo/RO_0000052> <http://vivo.scripps.edu/individual/n1373> . \n" +
"<http://vivo.scripps.edu/individual/n4928> <http://vivoweb.org/ontology/core#dateTimeInterval> <http://vivo.scripps.edu/individual/n4895> . \n" +
"<http://vivo.scripps.edu/individual/n4928> <http://vivoweb.org/ontology/core#relatedBy> <http://vivo.scripps.edu/individual/n4931> . \n" +
"<http://vivo.scripps.edu/individual/n4928> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://vivoweb.org/ontology/core#CoPrincipalInvestigatorRole> . \n" +
"<http://vivo.scripps.edu/individual/n4928> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#CoPrincipalInvestigatorRole> . \n" +
"<http://vivo.scripps.edu/individual/n4928> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Role> . \n" +
"<http://vivo.scripps.edu/individual/n4928> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#ResearcherRole> . \n" +
"<http://vivo.scripps.edu/individual/n4928> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://vivo.scripps.edu/individual/n4928> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#InvestigatorRole> . \n" +
"<http://vivo.scripps.edu/individual/n4931> <http://www.w3.org/2000/01/rdf-schema#label> \"Grant 3\"^^<http://www.w3.org/2001/XMLSchema#string> . \n" +
"<http://vivo.scripps.edu/individual/n4931> <http://vivoweb.org/ontology/core#relates> <http://vivo.scripps.edu/individual/n4928> . \n" +
"<http://vivo.scripps.edu/individual/n4931> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://vivoweb.org/ontology/core#Grant> . \n" +
"<http://vivo.scripps.edu/individual/n4931> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Agreement> . \n" +
"<http://vivo.scripps.edu/individual/n4931> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://vivo.scripps.edu/individual/n4931> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Grant> . \n" ;
populateModelAndCreateUriFinder(n3);
//if the copi changes then the grant needs to be updated
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n1373");
assertTrue("did not find grant for co-pi", uris.contains("http://vivo.scripps.edu/individual/n4931" ));
//if the grant changes then the copi needs to be updated
uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n4931");
assertTrue("did not find co-pi for grant", uris.contains("http://vivo.scripps.edu/individual/n1373" ));
}
@Test
public void testInvestigatorRoleChanges(){
String n3 =
"<http://vivo.scripps.edu/individual/n5282> <http://www.w3.org/2000/01/rdf-schema#label> \"10, Test\" . \n" +
// "<http://vivo.scripps.edu/individual/n5282> <http://xmlns.com/foaf/0.1/lastName> \"10\"^^<http://www.w3.org/2001/XMLSchema#string> . \n" +
// "<http://vivo.scripps.edu/individual/n5282> <http://xmlns.com/foaf/0.1/firstName> \"Test\"^^<http://www.w3.org/2001/XMLSchema#string> . \n" +
"<http://vivo.scripps.edu/individual/n5282> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://xmlns.com/foaf/0.1/Person> . \n" +
"<http://vivo.scripps.edu/individual/n5282> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Agent> . \n" +
"<http://vivo.scripps.edu/individual/n5282> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> . \n" +
"<http://vivo.scripps.edu/individual/n5282> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://vivo.scripps.edu/individual/n5282> <http://purl.obolibrary.org/obo/RO_0000053> <http://vivo.scripps.edu/individual/n157> . \n" +
"<http://vivo.scripps.edu/individual/n157> <http://vivoweb.org/ontology/core#dateTimeInterval> <http://vivo.scripps.edu/individual/n127> . \n" +
"<http://vivo.scripps.edu/individual/n157> <http://vivoweb.org/ontology/core#relatedBy> <http://vivo.scripps.edu/individual/n160> . \n" +
"<http://vivo.scripps.edu/individual/n157> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://vivoweb.org/ontology/core#InvestigatorRole> . \n" +
"<http://vivo.scripps.edu/individual/n157> <http://purl.obolibrary.org/obo/RO_0000052> <http://vivo.scripps.edu/individual/n5282> . \n" +
"<http://vivo.scripps.edu/individual/n157> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Role> . \n" +
"<http://vivo.scripps.edu/individual/n157> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#ResearcherRole> . \n" +
"<http://vivo.scripps.edu/individual/n157> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://vivo.scripps.edu/individual/n157> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#InvestigatorRole> . \n" +
"<http://vivo.scripps.edu/individual/n160> <http://www.w3.org/2000/01/rdf-schema#label> \"Grant 4\"^^<http://www.w3.org/2001/XMLSchema#string> . \n" +
"<http://vivo.scripps.edu/individual/n160> <http://vivoweb.org/ontology/core#relates> <http://vivo.scripps.edu/individual/n157> . \n" +
"<http://vivo.scripps.edu/individual/n160> <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> <http://vivoweb.org/ontology/core#Grant> . \n" +
"<http://vivo.scripps.edu/individual/n160> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Agreement> . \n" +
"<http://vivo.scripps.edu/individual/n160> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
"<http://vivo.scripps.edu/individual/n160> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Grant> . \n" ;
populateModelAndCreateUriFinder(n3);
//if the investigator changes then the grant needs to be updated
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n5282");
assertTrue("did not find grant for investigator", uris.contains("http://vivo.scripps.edu/individual/n160" ));
//if the grant changes then the investigator needs to be updated
uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n160");
assertTrue("did not find investigator for grant", uris.contains("http://vivo.scripps.edu/individual/n5282" ));
}
// ----------------------------------------------------------------------
// Helper methods
// ----------------------------------------------------------------------
/**
* Build a Model from this N3 string, and create a URI Finder based on that
* Model.
*/
private void populateModelAndCreateUriFinder(String n3String) {
OntModel model = ModelFactory.createOntologyModel();
model.read(new StringReader(n3String), null, "N3");
uriFinder = new AdditionalURIsForContextNodes(
new RDFServiceModel(model));
}
}

View file

@ -0,0 +1,492 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.searchindex.extensions;
import static com.hp.hpl.jena.rdf.model.ResourceFactory.createPlainLiteral;
import static com.hp.hpl.jena.rdf.model.ResourceFactory.createProperty;
import static com.hp.hpl.jena.rdf.model.ResourceFactory.createResource;
import static com.hp.hpl.jena.rdf.model.ResourceFactory.createStatement;
import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.WhichService.CONTENT;
import static edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames.ALLTEXT;
import static edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames.ALLTEXTUNSTEMMED;
import static org.junit.Assert.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.junit.Before;
import org.junit.Test;
import stubs.edu.cornell.mannlib.vitro.webapp.modelaccess.ContextModelAccessStub;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.Statement;
import com.hp.hpl.jena.vocabulary.RDF;
import com.hp.hpl.jena.vocabulary.RDFS;
import edu.cornell.mannlib.vitro.testing.AbstractTestClass;
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.beans.IndividualImpl;
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchInputDocument;
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchInputField;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.jena.model.RDFServiceModel;
/**
* TODO
*/
public class LabelsAcrossContextNodesTest extends AbstractTestClass {
// Types
private static final String CORE_ACADEMIC_DEGREE = "http://vivoweb.org/ontology/core#AcademicDegree";
private static final String CORE_ADVISING_RELATIONSHIP = "http://vivoweb.org/ontology/core#AdvisingRelationship";
private static final String CORE_POSITION = "http://vivoweb.org/ontology/core#Position";
private static final String FOAF_PERSON = "http://xmlns.com/foaf/0.1/#Person";
private static final String FOAF_ORGANIZATION = "http://xmlns.com/foaf/0.1/#Organization";
// Individuals
// Note: Person3 has no label and so no effect, but doesn't cause a problem.
private static final String URI_PERSON1 = "http://ns#Person1";
private static final String NAME_PERSON1 = "Person1";
private static final String URI_PERSON2 = "http://ns#Person2";
private static final String NAME_PERSON2 = "Person2";
private static final String URI_PERSON3 = "http://ns#Person3";
private static final String NAME_PERSON3 = null;
private static final String URI_PERSON4 = "http://ns#Person4";
private static final String NAME_PERSON4 = "Person4";
private static final String URI_ORGANIZATION1 = "http://ns#Organization1";
private static final String NAME_ORGANIZATION1 = "Organization1";
// Context nodes
private static final String URI_POSITION1 = "http://ns#Position1";
private static final String NAME_POSITION1 = "Position1";
private static final String URI_POSITION2 = "http://ns#Position2";
private static final String NAME_POSITION2 = "Position2";
private static final String URI_ADVISING1 = "http://ns#Advising1";
private static final String NAME_ADVISING1 = "Advising1";
private static final String URI_ADVISING2 = "http://ns#Advising2";
private static final String NAME_ADVISING2 = "Advising2";
// Properties
private static final String CORE_RELATED_BY = "http://vivoweb.org/ontology/core#relatedBy";
private static final String CORE_RELATES = "http://vivoweb.org/ontology/core#relates";
private static final String CORE_ASSIGNED_BY = "http://vivoweb.org/ontology/core#assignedBy";
private Model m;
private RDFService rdfService;
private LabelsAcrossContextNodes lacn;
private MockSearchInputDocument doc;
private List<String> foundUris;
/**
* Create these relationships (where "r/r" denotes "relatedBy/relates"
* combination.
*
* <pre>
* Person1 r/r Position1 r/r Organization1
* Person1 r/r AdvisingRelationship1 r/r Person2
* Person1 r/r AdvisingRelationship2 r/r Person3(no label!)
* Person2 r/r Position2 r/r Organization1
* Person4
* </pre>
*/
@Before
public void populateModel() {
m = ModelFactory.createDefaultModel();
addIndividual(URI_PERSON1, NAME_PERSON1, FOAF_PERSON);
addIndividual(URI_PERSON2, NAME_PERSON2, FOAF_PERSON);
addIndividual(URI_PERSON3, NAME_PERSON3, FOAF_PERSON);
addIndividual(URI_PERSON4, NAME_PERSON4, FOAF_PERSON);
addIndividual(URI_ORGANIZATION1, NAME_ORGANIZATION1, FOAF_ORGANIZATION);
addIndividual(URI_POSITION1, NAME_POSITION1, CORE_POSITION);
addIndividual(URI_POSITION2, NAME_POSITION2, CORE_POSITION);
addIndividual(URI_ADVISING1, NAME_ADVISING1, CORE_ADVISING_RELATIONSHIP);
addIndividual(URI_ADVISING2, NAME_ADVISING2, CORE_ADVISING_RELATIONSHIP);
addRelationship(URI_PERSON1, URI_POSITION1, URI_ORGANIZATION1);
addRelationship(URI_PERSON1, URI_ADVISING1, URI_PERSON2);
addRelationship(URI_PERSON1, URI_ADVISING2, URI_PERSON3);
addRelationship(URI_PERSON2, URI_POSITION2, URI_ORGANIZATION1);
rdfService = new RDFServiceModel(m);
ContextModelAccessStub models = new ContextModelAccessStub();
models.setRDFService(CONTENT, rdfService);
lacn = new LabelsAcrossContextNodes();
lacn.setContextModels(models);
}
// ----------------------------------------------------------------------
// Test DocumentModifier
// ----------------------------------------------------------------------
/*
* If there is a type restriction and the individual does not meet it, no
* change.
*
* If contextNodeClasses are not specified, get labels from all context
* nodes. note that a partner without a label should just be a no-op.
*
* If contextNodeClasses are specified, accept some and ignore others.
*
* Confirm that the expected data is written to the text fields.
*/
@Test
public void noRestrictions_returnLabelsOfAllPartners() {
setTypeRestrictions();
setContextNodeTypes();
exerciseDocumentModifier(URI_PERSON1);
assertExpectedFieldValues(NAME_ORGANIZATION1, NAME_PERSON2);
}
@Test
public void typeRestrictionOnCorrectType_returnAll() {
setTypeRestrictions(FOAF_PERSON);
setContextNodeTypes();
exerciseDocumentModifier(URI_PERSON1);
assertExpectedFieldValues(NAME_ORGANIZATION1, NAME_PERSON2);
}
@Test
public void typeRestrictionOnWrongType_returnNothing() {
setTypeRestrictions(FOAF_ORGANIZATION);
setContextNodeTypes();
exerciseDocumentModifier(URI_PERSON1);
assertExpectedFieldValues();
}
@Test
public void limitByContextNodeType_returnLimited() {
setTypeRestrictions();
setContextNodeTypes(CORE_POSITION);
exerciseDocumentModifier(URI_PERSON1);
assertExpectedFieldValues(NAME_ORGANIZATION1);
}
@Test
public void inclusiveContextNodeTypes_returnAll() {
setTypeRestrictions();
setContextNodeTypes(CORE_POSITION, CORE_ADVISING_RELATIONSHIP);
exerciseDocumentModifier(URI_PERSON1);
assertExpectedFieldValues(NAME_ORGANIZATION1, NAME_PERSON2);
}
@Test
public void noContextNodes_noResultsNoProblem() {
setTypeRestrictions();
setContextNodeTypes();
exerciseDocumentModifier(URI_PERSON4);
assertExpectedFieldValues();
}
// ----------------------------------------------------------------------
// Test IndexingUriFinder
// ----------------------------------------------------------------------
/**
* <pre>
* If neither a label nor a relates, ignore it.
*
* If label, test if no partners, if some partners, if some partners restricted by type.
* test with both contextNodeClasses and not.
* Test with typeRestrictions or without.
*
* If relates, and fails contextNodeClasses, ignore it.
* Test with contextNodeClasses and without.
* Find partners, both with typeRestrictions and without.
* </pre>
*/
@Test
public void irrelevantStatement_returnsNothing() {
setTypeRestrictions();
setContextNodeTypes();
exerciseUriFinder(stmt(URI_POSITION1, CORE_ASSIGNED_BY, URI_PERSON4));
assertExpectedUris();
}
@Test
public void label_noPartners_returnsNothing() {
setTypeRestrictions();
setContextNodeTypes();
exerciseUriFinder(labelStmt(URI_PERSON4, "New Name"));
assertExpectedUris();
}
@Test
public void label_returnsAllPartners() {
setTypeRestrictions();
setContextNodeTypes();
exerciseUriFinder(labelStmt(URI_PERSON1, "New Name"));
assertExpectedUris(URI_PERSON2, URI_PERSON3, URI_ORGANIZATION1);
}
@Test
public void label_restrictByContextNode_returnEligiblePartners() {
setTypeRestrictions();
setContextNodeTypes(CORE_ADVISING_RELATIONSHIP);
exerciseUriFinder(labelStmt(URI_PERSON1, "New Name"));
assertExpectedUris(URI_PERSON2, URI_PERSON3);
}
@Test
public void label_restrictByContextNodes_returnEligiblePartners() {
setTypeRestrictions();
setContextNodeTypes(CORE_ADVISING_RELATIONSHIP, CORE_POSITION);
exerciseUriFinder(labelStmt(URI_PERSON1, "New Name"));
assertExpectedUris(URI_PERSON2, URI_PERSON3, URI_ORGANIZATION1);
}
@Test
public void label_typeRestriction_limitsResults() {
setTypeRestrictions(FOAF_PERSON);
setContextNodeTypes();
exerciseUriFinder(labelStmt(URI_PERSON1, "New Name"));
assertExpectedUris(URI_PERSON2, URI_PERSON3);
}
@Test
public void label_inclusiveTypeRestrictions_allResults() {
setTypeRestrictions(FOAF_PERSON, FOAF_ORGANIZATION);
setContextNodeTypes();
exerciseUriFinder(labelStmt(URI_PERSON1, "New Name"));
assertExpectedUris(URI_PERSON2, URI_PERSON3, URI_ORGANIZATION1);
}
@Test
public void label_prohibitiveTypeRestrictions_nothing() {
setTypeRestrictions(CORE_ACADEMIC_DEGREE);
setContextNodeTypes();
exerciseUriFinder(labelStmt(URI_PERSON1, "New Name"));
assertExpectedUris();
}
@Test
public void relates_returnsPartner() {
setTypeRestrictions();
setContextNodeTypes();
exerciseUriFinder(stmt(URI_POSITION1, CORE_RELATES, URI_PERSON1));
assertExpectedUris(URI_ORGANIZATION1);
}
@Test
public void relates_inclusiveTypeRestriction_returnsPartner() {
setTypeRestrictions(FOAF_ORGANIZATION);
setContextNodeTypes();
exerciseUriFinder(stmt(URI_POSITION1, CORE_RELATES, URI_PERSON1));
assertExpectedUris(URI_ORGANIZATION1);
}
@Test
public void relates_exclusiveTypeRestriction_returnsNothing() {
setTypeRestrictions(CORE_ADVISING_RELATIONSHIP);
setContextNodeTypes();
exerciseUriFinder(stmt(URI_POSITION1, CORE_RELATES, URI_PERSON1));
assertExpectedUris();
}
@Test
public void relates_inclusiveContextType_returnsPartner() {
setTypeRestrictions();
setContextNodeTypes(CORE_POSITION);
exerciseUriFinder(stmt(URI_POSITION1, CORE_RELATES, URI_PERSON1));
assertExpectedUris(URI_ORGANIZATION1);
}
@Test
public void relates_exclusiveContextType_returnsNothing() {
setTypeRestrictions();
setContextNodeTypes(CORE_ADVISING_RELATIONSHIP);
exerciseUriFinder(stmt(URI_POSITION1, CORE_RELATES, URI_PERSON1));
assertExpectedUris();
}
// ----------------------------------------------------------------------
// Helper methods
// ----------------------------------------------------------------------
private void addIndividual(String uri, String label, String... types) {
Resource subject = createResource(uri);
if (label != null) {
m.add(subject, RDFS.label, label);
}
for (String type : types) {
m.add(subject, RDF.type, createResource(type));
}
}
private void addRelationship(String ind1Uri, String contextNodeUri,
String ind2Uri) {
Resource ind1 = createResource(ind1Uri);
Resource contextNode = createResource(contextNodeUri);
Resource ind2 = createResource(ind2Uri);
Property relatedBy = createProperty(CORE_RELATED_BY);
Property relates = createProperty(CORE_RELATES);
m.add(ind1, relatedBy, contextNode);
m.add(contextNode, relates, ind1);
m.add(ind2, relatedBy, contextNode);
m.add(contextNode, relates, ind2);
}
private void setTypeRestrictions(String... uris) {
for (String uri : uris) {
lacn.addTypeRestriction(uri);
}
}
private void setContextNodeTypes(String... uris) {
for (String uri : uris) {
lacn.addContextNodeClass(uri);
}
}
private void exerciseDocumentModifier(String individualUri) {
Individual ind = createIndividual(individualUri);
doc = new MockSearchInputDocument();
lacn.modifyDocument(ind, doc);
}
private Individual createIndividual(String individualUri) {
Individual ind = new IndividualImpl(individualUri);
List<VClass> vclasses = new ArrayList<>();
for (RDFNode node : m.listObjectsOfProperty(
createResource(individualUri), RDF.type).toList()) {
if (node.isURIResource()) {
vclasses.add(new VClass(node.asResource().getURI()));
}
}
ind.setVClasses(vclasses, false);
return ind;
}
private void assertExpectedFieldValues(String... values) {
List<String> expected = new ArrayList<>(Arrays.asList(values));
Collections.sort(expected);
List<String> actual1 = doc.getValues(ALLTEXT);
Collections.sort(actual1);
assertEquals("ALLTEXT", expected, actual1);
List<String> actual2 = doc.getValues(ALLTEXTUNSTEMMED);
Collections.sort(actual2);
assertEquals("ALLTEXTUNSTEMMED", expected, actual2);
}
private void exerciseUriFinder(Statement stmt) {
foundUris = lacn.findAdditionalURIsToIndex(stmt);
}
private Statement stmt(String subjectUri, String predicateUri,
String objectUri) {
return createStatement(createResource(subjectUri),
createProperty(predicateUri), createResource(objectUri));
}
private Statement labelStmt(String subjectUri, String labelText) {
return createStatement(createResource(subjectUri), RDFS.label,
createPlainLiteral(labelText));
}
private void assertExpectedUris(String... expectedArray) {
Set<String> expected = new HashSet<>(Arrays.asList(expectedArray));
Set<String> actual = new HashSet<>(foundUris);
assertEquals("found URIs", expected, actual);
}
// ----------------------------------------------------------------------
// Helper classes
// ----------------------------------------------------------------------
private static class MockSearchInputDocument implements SearchInputDocument {
// ----------------------------------------------------------------------
// Stub infrastructure
// ----------------------------------------------------------------------
private Map<String, List<String>> fieldValues = new HashMap<>();
public List<String> getValues(String fieldName) {
if (fieldValues.containsKey(fieldName)) {
return new ArrayList<>(fieldValues.get(fieldName));
} else {
return new ArrayList<>();
}
}
// ----------------------------------------------------------------------
// Stub methods
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
// Un-implemented methods
// ----------------------------------------------------------------------
@Override
public void addField(SearchInputField arg0) {
throw new RuntimeException("addField() not implemented.");
}
@Override
public void addField(String name, Object... values) {
List<String> stringValues = getValues(name);
for (Object value : values) {
stringValues.add(String.valueOf(value));
}
fieldValues.put(name, stringValues);
}
@Override
public void addField(String arg0, Collection<Object> arg1) {
throw new RuntimeException("addField() not implemented.");
}
@Override
public void addField(String arg0, float arg1, Object... arg2) {
throw new RuntimeException("addField() not implemented.");
}
@Override
public void addField(String arg0, float arg1, Collection<Object> arg2) {
throw new RuntimeException("addField() not implemented.");
}
@Override
public SearchInputField createField(String arg0) {
throw new RuntimeException("createField() not implemented.");
}
@Override
public float getDocumentBoost() {
throw new RuntimeException("getDocumentBoost() not implemented.");
}
@Override
public SearchInputField getField(String arg0) {
throw new RuntimeException("getField() not implemented.");
}
@Override
public Map<String, SearchInputField> getFieldMap() {
throw new RuntimeException("getFieldMap() not implemented.");
}
@Override
public void setDocumentBoost(float arg0) {
throw new RuntimeException("setDocumentBoost() not implemented.");
}
}
}

View file

@ -17,7 +17,7 @@ import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import stubs.edu.cornell.mannlib.vitro.webapp.auth.policy.bean.PropertyRestrictionPolicyHelperStub;
import stubs.edu.cornell.mannlib.vitro.webapp.auth.policy.bean.PropertyRestrictionBeanStub;
import stubs.javax.servlet.ServletContextStub;
import com.hp.hpl.jena.ontology.OntModel;
@ -31,7 +31,6 @@ import edu.cornell.mannlib.vitro.testing.AbstractTestClass;
import edu.cornell.mannlib.vitro.webapp.auth.identifier.ArrayIdentifierBundle;
import edu.cornell.mannlib.vitro.webapp.auth.identifier.IdentifierBundle;
import edu.cornell.mannlib.vitro.webapp.auth.identifier.common.HasProfile;
import edu.cornell.mannlib.vitro.webapp.auth.policy.bean.PropertyRestrictionPolicyHelper;
import edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.Authorization;
import edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.PolicyDecision;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.RequestedAction;
@ -123,9 +122,7 @@ public class SelfEditorRelationshipPolicyTest extends AbstractTestClass {
@Before
public void setupPolicy() {
ServletContextStub ctx = new ServletContextStub();
PropertyRestrictionPolicyHelper prph = PropertyRestrictionPolicyHelperStub
.getInstance(new String[] { NS_RESTRICTED });
PropertyRestrictionPolicyHelper.setBean(ctx, prph);
PropertyRestrictionBeanStub.getInstance(new String[] { NS_RESTRICTED });
policy = new SelfEditorRelationshipPolicy(ctx);
}

View file

@ -887,4 +887,5 @@ editor_of_entry = editor of entry for
role_type = Role type
add_capitalized = Add
researcher_role = Researcher Role
search_service_btn = Search Service
search_service_btn = Search Service
through_today = through today's date

View file

@ -27,7 +27,6 @@ utilities/ISF-transition/obsoleteUris
# 7498 89730 2277668 first_pass.output
#
test/edu/cornell/mannlib/vitro/webapp/search/solr/NIHVIVO3853_DataSet1.rdf
productMods/WEB-INF/ontologies/update/oldVersion/vivo-event-1.5.owl
productMods/WEB-INF/ontologies/update/oldAnnotations/vivo-core-1.5-annotations.rdf
productMods/WEB-INF/ontologies/update/diff.tab.txt

View file

@ -21,7 +21,6 @@
# 7498 89730 2277668 first_pass.output
#
test/edu/cornell/mannlib/vitro/webapp/search/solr/NIHVIVO3853_DataSet1.rdf
productMods/WEB-INF/ontologies/update/oldVersion/vivo-event-1.5.owl
productMods/WEB-INF/ontologies/update/oldAnnotations/vivo-core-1.5-annotations.rdf
productMods/WEB-INF/ontologies/update/diff.tab.txt

View file

@ -7,11 +7,11 @@
<#if (individual.thumbUrl)??>
<img src="${individual.thumbUrl}" width="90" alt="${individual.name}" />
<h1 class="thumb">
<a href="${individual.profileUrl}" title="View the profile page for ${individual.name}}">${individual.name}</a>
<a href="${individual.profileUrl}" title="View the profile page for ${individual.name}">${individual.name}</a>
</h1>
<#else>
<h1>
<a href="${individual.profileUrl}" title="View the profile page for ${individual.name}}">${individual.name}</a>
<a href="${individual.profileUrl}" title="View the profile page for ${individual.name}">${individual.name}</a>
</h1>
</#if>