NIHVIVO-2847, NIHVIVO-2827, NIHVIVO-2862
1) The ArrayList that was used for checking blacklisted classes has been removed from IndividualToSolrDoc. Now, any change in search.n3 is reflected on deploying vivo with a fresh database. 2) core:URLLink (NIHVIVO-2847) and Class URI(NIHVIVO-2827) don't appear in search results anymore. 3) File and FileByteStream are also added to the blacklisted class list (search.n3)
This commit is contained in:
parent
d53ac74350
commit
7ce7f7a1ac
2 changed files with 17 additions and 45 deletions
|
@ -57,18 +57,28 @@ public class IndividualProhibitedFromSearchImpl implements IndividualProhibitedF
|
|||
private Query makeAskQueryForUri( String uri ){
|
||||
String queryString =
|
||||
"PREFIX fn: <http://www.w3.org/2005/xpath-functions#> \n" +
|
||||
|
||||
"ASK { \n" +
|
||||
" <"+uri+"> <" + RDF.type.getURI() + "> ?type . \n" +
|
||||
|
||||
" FILTER ( \n" +
|
||||
|
||||
" ( fn:starts-with( str(?type), \"" + VitroVocabulary.vitroURI + "\" ) \n" +
|
||||
" && \n"+
|
||||
" ! fn:starts-with( str(?type), \"" + VitroVocabulary.vitroURI + "Flag\" ) ) || \n" +
|
||||
" ! fn:starts-with( str(?type), \"" + VitroVocabulary.vitroURI + "Flag\" ) ) || \n" +
|
||||
|
||||
" fn:starts-with( str(?type), \"" + VitroVocabulary.PUBLIC + "\" ) || \n" +
|
||||
|
||||
" str(?type) = \"" + OWL.ObjectProperty.getURI() + "\" || \n" +
|
||||
|
||||
" str(?type) = \"" + OWL.DatatypeProperty.getURI() + "\" || \n" +
|
||||
|
||||
" str(?type) = \"" + OWL.AnnotationProperty.getURI() + "\" \n" +
|
||||
|
||||
" )\n" +
|
||||
"}" ;
|
||||
|
||||
|
||||
return QueryFactory.create( queryString );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,10 +40,6 @@ public class IndividualToSolrDocument {
|
|||
|
||||
public List<DocumentModifier> documentModifiers = new ArrayList<DocumentModifier>();
|
||||
|
||||
private static List<String> contextNodeClassNames = new ArrayList<String>();
|
||||
|
||||
private static List<String> blackListedClasses = new ArrayList<String>();
|
||||
|
||||
public IndividualToSolrDocument(
|
||||
ClassProhibitedFromSearch classesProhibitedFromSearch,
|
||||
IndividualProhibitedFromSearch individualProhibitedFromSearch){
|
||||
|
@ -60,8 +56,7 @@ public class IndividualToSolrDocument {
|
|||
this.classesProhibitedFromSearch = classesProhibitedFromSearch;
|
||||
this.individualProhibitedFromSearch = individualProhibitedFromSearch;
|
||||
this.documentModifiers = docModifiers;
|
||||
fillContextNodes();
|
||||
fillInBlackListedClasses();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -259,9 +254,11 @@ public class IndividualToSolrDocument {
|
|||
//index individuals of type owl:Thing, just don't add owl:Thing as the type field in the index
|
||||
continue;
|
||||
} else if(clz.getURI().startsWith(OWL.NS)){
|
||||
throw new SkipIndividualException("not indexing " + ind.getURI() + " because of type " + clz.getURI() );
|
||||
} else if(contextNodeClassNames.contains(superLclName) || blackListedClasses.contains(superLclName)) { // check to see if context node is being indexed.
|
||||
throw new SkipIndividualException("not indexing " + ind.getURI() + " because of context node type " + clz.getURI() );
|
||||
throw new SkipIndividualException("not indexing " + ind.getURI() + " because of type " + clz.getURI() );
|
||||
}
|
||||
// do not index individuals of type Role, AdvisingRelationShip, Authorship, etc.(see search.n3 for more information)
|
||||
else if(classesProhibitedFromSearch.isClassProhibitedFromSearch(clz.getURI())){
|
||||
throw new SkipIndividualException("not indexing " + ind.getURI() + " because of prohibited type " + clz.getURI() );
|
||||
} else {
|
||||
if( !prohibited && classesProhibitedFromSearch.isClassProhibitedFromSearch(clz.getURI()))
|
||||
prohibited = true;
|
||||
|
@ -334,41 +331,6 @@ public class IndividualToSolrDocument {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void fillContextNodes(){
|
||||
IndividualToSolrDocument.contextNodeClassNames.add("Role");
|
||||
IndividualToSolrDocument.contextNodeClassNames.add("AttendeeRole");
|
||||
IndividualToSolrDocument.contextNodeClassNames.add("ClinicalRole");
|
||||
IndividualToSolrDocument.contextNodeClassNames.add("LeaderRole");
|
||||
IndividualToSolrDocument.contextNodeClassNames.add("MemberRole");
|
||||
IndividualToSolrDocument.contextNodeClassNames.add("OutreachProviderRole");
|
||||
IndividualToSolrDocument.contextNodeClassNames.add("PresenterRole");
|
||||
IndividualToSolrDocument.contextNodeClassNames.add("ResearcherRole");
|
||||
IndividualToSolrDocument.contextNodeClassNames.add("InvestigatorRole");
|
||||
IndividualToSolrDocument.contextNodeClassNames.add("CoPrincipalInvestigatorRole");
|
||||
IndividualToSolrDocument.contextNodeClassNames.add("PrincipalInvestigatorRole");
|
||||
IndividualToSolrDocument.contextNodeClassNames.add("ServiceProviderRole");
|
||||
IndividualToSolrDocument.contextNodeClassNames.add("TeacherRole");
|
||||
IndividualToSolrDocument.contextNodeClassNames.add("Position");
|
||||
IndividualToSolrDocument.contextNodeClassNames.add("FacultyAdministrativePosition");
|
||||
IndividualToSolrDocument.contextNodeClassNames.add("FacultyPosition");
|
||||
IndividualToSolrDocument.contextNodeClassNames.add("LibrarianPosition");
|
||||
IndividualToSolrDocument.contextNodeClassNames.add("Non-AcademicPosition");
|
||||
IndividualToSolrDocument.contextNodeClassNames.add("Non-FacultyAcademicPosition");
|
||||
IndividualToSolrDocument.contextNodeClassNames.add("PostdoctoralPosition");
|
||||
IndividualToSolrDocument.contextNodeClassNames.add("AdvisingRelationship");
|
||||
IndividualToSolrDocument.contextNodeClassNames.add("Authorship");
|
||||
IndividualToSolrDocument.contextNodeClassNames.add("AcademicDegree");
|
||||
|
||||
}
|
||||
|
||||
// bk392 : Ideally this needs to be removed and the check for a blacklisted class
|
||||
// has to made by firing a query against the display model which contains
|
||||
// blacklisted classes (grabbed from search.n3)
|
||||
private void fillInBlackListedClasses() {
|
||||
//class that needs to be excluded from search
|
||||
IndividualToSolrDocument.blackListedClasses.add("URLLink");
|
||||
}
|
||||
|
||||
public static float NAME_BOOST = 1.2F;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue