From 4653fd9e64774ee4b94232d7aa0027687394e9c7 Mon Sep 17 00:00:00 2001 From: briancaruso Date: Thu, 14 Jul 2011 15:21:48 +0000 Subject: [PATCH] Working on context node update during incremental search update. NIHVIVO-2834 --- .../AdditionalURIsForContextNodes.java | 42 +++++++++++++++---- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/indexing/AdditionalURIsForContextNodes.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/indexing/AdditionalURIsForContextNodes.java index 9e3046884..f36d1179e 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/indexing/AdditionalURIsForContextNodes.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/indexing/AdditionalURIsForContextNodes.java @@ -81,6 +81,9 @@ public class AdditionalURIsForContextNodes implements AdditionalURIsToIndex { } } + if( log.isDebugEnabled() ) + log.debug( "additional uris for " + uri + " are " + uriList); + return uriList; } @@ -95,18 +98,22 @@ public class AdditionalURIsForContextNodes implements AdditionalURIsToIndex { + " prefix bibo: "; static{ + + // If a person changes then update + // organizations for positions multiValuedQueriesForAgent.add(prefix + "SELECT " + - " (str(?f) as ?positionForPerson) (str(?i) as ?positionInOrganization) " + + " (str(?i) as ?positionInOrganization) " + " WHERE {" + "?uri rdf:type foaf:Agent ; ?b ?c . " + " ?c rdf:type core:Position . " - - + " OPTIONAL { ?c core:positionForPerson ?f . } . " + + " OPTIONAL { ?c core:positionInOrganization ?i . } . " + " }"); + // If a person changes then update + // advisee, linkedAuthor and informationResource multiValuedQueriesForAgent.add(prefix + "SELECT (str(?d) as ?advisee) " + " (str(?f) as ?linkedAuthor) (str(?h) as ?linkedInformationResource) WHERE {" @@ -120,23 +127,30 @@ public class AdditionalURIsForContextNodes implements AdditionalURIsToIndex { + " } "); + // If a person changes then update + // award giver multiValuedQueriesForAgent.add(prefix + - "SELECT (str(?d) as ?awardConferredBy) (str(?e) as ?awardOrHonorFor) " + + "SELECT (str(?d) as ?awardConferredBy) " + "WHERE {" + "?uri rdf:type foaf:Agent ; ?b ?c . " + " ?c rdf:type core:AwardReceipt . " + " OPTIONAL { ?c core:awardConferredBy ?d . } . " - + " OPTIONAL { ?c core:awardOrHonorFor ?e . } ." + " }"); + // If a person changes then update + // organization for role multiValuedQueriesForAgent.add(prefix + - "SELECT (str(?Organization) as ?organization) WHERE {" + "SELECT (str(?Organization) as ?organization) " + + "WHERE {" + + "?uri rdf:type foaf:Agent ; ?b ?c . " + " ?c rdf:type core:Role ; core:roleIn ?Organization ." + " }"); + // If a person changes then update + // organization in educational training multiValuedQueriesForAgent.add(prefix + "SELECT " + "(str(?e) as ?trainingAtOrganization) WHERE {" @@ -144,10 +158,22 @@ public class AdditionalURIsForContextNodes implements AdditionalURIsToIndex { + " ?uri rdf:type foaf:Agent ; ?b ?c . " + " ?c rdf:type core:EducationalTraining . " - + " OPTIONAL { ?c core:trainingAtOrganization ?e . } . " - + + " OPTIONAL { ?c core:trainingAtOrganization ?e . } . " +"}"); + // If an organizatoin changes then update + // people in head of relations + multiValuedQueriesForAgent.add( + " # for organization, get leader \n" + + prefix + + "SELECT " + + "(str(?e) as ?LeaderPerson ) WHERE {" + + + " ?uri rdf:type foaf:Agent ; ?b ?c . " + + " ?c rdf:type core:LeaderRole . " + + + " OPTIONAL { ?c core:leaderRoleOf ?e . } . " + +"}"); } //multivalued query for core:InformationResource