@Component public class SemanticSearchServiceHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_NUM_TAGS |
static Set<String> |
STOP_WORDS |
| Constructor and Description |
|---|
SemanticSearchServiceHelper(OntologyTagService ontologyTagService,
DataService dataService,
OntologyService ontologyService,
TermFrequencyService termFrequencyService) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,String> |
collectExpandedQueryMap(EntityMetaData targetEntityMetaData,
AttributeMetaData targetAttribute)
This function creates a map that contains the expanded query as key and original tag label as the value.
|
void |
collectOntologyTermQueryMap(Map<String,String> expanedQueryMap,
OntologyTerm ontologyTerm) |
QueryRule |
createDisMaxQueryRuleForAttribute(EntityMetaData targetEntityMetaData,
AttributeMetaData targetAttribute)
Create a disMaxJunc query rule based on the label and description from target attribute as well as the
information from ontology term tags
|
QueryRule |
createDisMaxQueryRuleForTerms(List<String> queryTerms)
Create disMaxJunc query rule based a list of queryTerm.
|
QueryRule |
createDisMaxQueryRuleForTermsWithBoost(List<String> queryTerms,
Double boostValue)
Create a disMaxQueryRule with corresponding boosted value
|
QueryRule |
createShouldQueryRule(String multiOntologyTermIri)
Create a boolean should query for composite tags containing multiple ontology terms
|
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 |
parseQueryString(String queryString) |
Set<String> |
removeStopWords(String description) |
String |
reverseEscapeLuceneChar(String string) |
public static final int MAX_NUM_TAGS
@Autowired public SemanticSearchServiceHelper(OntologyTagService ontologyTagService, DataService dataService, OntologyService ontologyService, TermFrequencyService termFrequencyService)
public QueryRule createDisMaxQueryRuleForAttribute(EntityMetaData targetEntityMetaData, AttributeMetaData targetAttribute)
targetEntityMetaData - targetAttribute - public QueryRule createDisMaxQueryRuleForTerms(List<String> queryTerms)
queryTerms - public QueryRule createDisMaxQueryRuleForTermsWithBoost(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(EntityMetaData targetEntityMetaData, AttributeMetaData targetAttribute)
targetEntityMetaData - targetAttribute - 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 © 2015. All Rights Reserved.