public class SemanticSearchServiceImpl extends Object implements SemanticSearchService
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_NUM_TAGS |
| Constructor and Description |
|---|
SemanticSearchServiceImpl(DataService dataService,
OntologyService ontologyService,
MetaDataService metaDataService,
SemanticSearchServiceHelper semanticSearchServiceHelper,
ElasticSearchExplainService elasticSearchExplainService) |
| Modifier and Type | Method and Description |
|---|---|
Hit<String> |
bestMatchingSynonym(OntologyTerm ontologyTerm,
Set<String> searchTerms)
Computes the best matching synonym which is closest to a set of search terms.
Will stem the OntologyTerm 's synonyms and the search terms, and then compute the maximum
StringDistance between them. |
Set<ExplainedQueryString> |
convertAttributeEntityToExplainedAttribute(Entity attributeEntity,
EntityMetaData sourceEntityMetaData,
Map<String,String> collectExpanedQueryMap,
List<QueryRule> finalQueryRules)
A helper function to explain each of the matched attributes returned by the explain-API
|
Set<String> |
createLexicalSearchQueryTerms(AttributeMetaData targetAttribute,
Set<String> searchTerms)
A helper function to create a list of queryTerms based on the information from the targetAttribute as well as
user defined searchTerms.
|
Map<AttributeMetaData,ExplainedAttributeMetaData> |
decisionTreeToFindRelevantAttributes(EntityMetaData sourceEntityMetaData,
AttributeMetaData targetAttribute,
Collection<OntologyTerm> ontologyTermsFromTags,
Set<String> searchTerms)
A decision tree for getting the relevant attributes
1.
|
Map<AttributeMetaData,ExplainedAttributeMetaData> |
findAttributes(EntityMetaData sourceEntityMetaData,
Set<String> queryTerms,
Collection<OntologyTerm> ontologyTerms)
Find all relevant source attributes with an explanation based on ontology terms and search terms
|
Hit<OntologyTerm> |
findTags(AttributeMetaData attribute,
List<String> ontologyIds)
Finds
OntologyTerms for an attribute. |
Map<AttributeMetaData,Hit<OntologyTerm>> |
findTags(String entity,
List<String> ontologyIds)
Finds
OntologyTerms that can be used to tag an attribute. |
public static final int MAX_NUM_TAGS
@Autowired public SemanticSearchServiceImpl(DataService dataService, OntologyService ontologyService, MetaDataService metaDataService, SemanticSearchServiceHelper semanticSearchServiceHelper, ElasticSearchExplainService elasticSearchExplainService)
public Map<AttributeMetaData,ExplainedAttributeMetaData> findAttributes(EntityMetaData sourceEntityMetaData, Set<String> queryTerms, Collection<OntologyTerm> ontologyTerms)
SemanticSearchServicefindAttributes in interface SemanticSearchServicepublic Map<AttributeMetaData,ExplainedAttributeMetaData> decisionTreeToFindRelevantAttributes(EntityMetaData sourceEntityMetaData, AttributeMetaData targetAttribute, Collection<OntologyTerm> ontologyTermsFromTags, Set<String> searchTerms)
SemanticSearchServicedecisionTreeToFindRelevantAttributes in interface SemanticSearchServicepublic Set<String> createLexicalSearchQueryTerms(AttributeMetaData targetAttribute, Set<String> searchTerms)
targetAttribute - searchTerms - public Set<ExplainedQueryString> convertAttributeEntityToExplainedAttribute(Entity attributeEntity, EntityMetaData sourceEntityMetaData, Map<String,String> collectExpanedQueryMap, List<QueryRule> finalQueryRules)
attributeEntity - sourceEntityMetaData - collectExpanedQueryMap - finalQueryRules - public Map<AttributeMetaData,Hit<OntologyTerm>> findTags(String entity, List<String> ontologyIds)
SemanticSearchServiceOntologyTerms that can be used to tag an attribute.findTags in interface SemanticSearchServiceentity - name of the entityMap of Hits for OntologyTerm resultspublic Hit<OntologyTerm> findTags(AttributeMetaData attribute, List<String> ontologyIds)
SemanticSearchServiceOntologyTerms for an attribute.findTags in interface SemanticSearchServiceattribute - AttributeMetaData to tagontologyIds - IDs of ontologies to take the OntologyTerms from.List of Hits for OntologyTerms found, most relevant firstpublic Hit<String> bestMatchingSynonym(OntologyTerm ontologyTerm, Set<String> searchTerms)
OntologyTerm 's synonyms and the search terms, and then compute the maximum
StringDistance between them. 0 means disjunct, 1 means identicalontologyTerm - the OntologyTermsearchTerms - the search termsStringDistance between the ontologyterm and the search termsCopyright © 2016. All Rights Reserved.