public class SemanticSearchServiceHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_NUM_TAGS |
| Constructor and Description |
|---|
SemanticSearchServiceHelper(DataService dataService,
OntologyService ontologyService,
TermFrequencyService termFrequencyService) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,String> |
collectExpandedQueryMap(Set<String> queryTerms,
Collection<OntologyTerm> ontologyTerms) |
void |
collectOntologyTermQueryMap(Map<String,String> expanedQueryMap,
OntologyTerm ontologyTerm) |
QueryRule |
createBoostedDisMaxQueryRuleForTerms(List<String> queryTerms,
Double boostValue)
Create a disMaxQueryRule with corresponding boosted value
|
QueryRule |
createDisMaxQueryRuleForAttribute(Set<String> searchTerms,
Collection<OntologyTerm> ontologyTerms)
Create a disMaxJunc query rule based on the given search terms as well as the information from given ontology
terms
|
QueryRule |
createDisMaxQueryRuleForTerms(List<String> queryTerms)
Create disMaxJunc query rule based a list of queryTerm.
|
QueryRule |
createShouldQueryRule(String multiOntologyTermIri)
Create a boolean should query for composite tags containing multiple ontology terms
|
String |
escapeCharsExcludingCaretChar(String string) |
List<OntologyTerm> |
findTags(String description,
List<String> ontologyIds) |
List<String> |
getAttributeIdentifiers(EntityMetaData sourceEntityMetaData)
A helper function that gets identifiers of all the attributes from one entityMetaData
|
Set<String> |
getOtLabelAndSynonyms(OntologyTerm ontologyTerm)
A helper function to collect synonyms as well as label of ontologyterm
|
String |
parseBoostQueryString(String queryString,
double boost) |
List<String> |
parseOntologyTermQueries(OntologyTerm ontologyTerm)
Create a list of string queries based on the information collected from current ontologyterm including label,
synonyms and child ontologyterms
|
String |
processQueryString(String queryString) |
Set<String> |
removeStopWords(String description) |
public static final int MAX_NUM_TAGS
@Autowired public SemanticSearchServiceHelper(DataService dataService, OntologyService ontologyService, TermFrequencyService termFrequencyService)
public QueryRule createDisMaxQueryRuleForAttribute(Set<String> searchTerms, Collection<OntologyTerm> ontologyTerms)
ontologyTerms - searchTerms - public QueryRule createDisMaxQueryRuleForTerms(List<String> queryTerms)
queryTerms - public QueryRule createBoostedDisMaxQueryRuleForTerms(List<String> queryTerms, Double boostValue)
queryTerms - boostValue - public QueryRule createShouldQueryRule(String multiOntologyTermIri)
multiOntologyTermIri - public List<String> parseOntologyTermQueries(OntologyTerm ontologyTerm)
ontologyTerm - public Set<String> getOtLabelAndSynonyms(OntologyTerm ontologyTerm)
ontologyTerm - public Map<String,String> collectExpandedQueryMap(Set<String> queryTerms, Collection<OntologyTerm> ontologyTerms)
public void collectOntologyTermQueryMap(Map<String,String> expanedQueryMap, OntologyTerm ontologyTerm)
public List<String> getAttributeIdentifiers(EntityMetaData sourceEntityMetaData)
sourceEntityMetaData - public List<OntologyTerm> findTags(String description, List<String> ontologyIds)
Copyright © 2016. All Rights Reserved.