Class SemanticSearchServiceImpl
- java.lang.Object
-
- org.molgenis.semanticsearch.service.impl.SemanticSearchServiceImpl
-
- All Implemented Interfaces:
SemanticSearchService
public class SemanticSearchServiceImpl extends Object implements SemanticSearchService
-
-
Constructor Summary
Constructors Constructor Description SemanticSearchServiceImpl(org.molgenis.data.DataService dataService, org.molgenis.ontology.core.service.OntologyService ontologyService, SemanticSearchServiceHelper semanticSearchServiceHelper, ElasticSearchExplainService elasticSearchExplainService, OntologyTagService ontologyTagService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<ExplainedQueryString>convertAttributeToExplainedAttribute(org.molgenis.data.meta.model.Attribute attribute, Map<String,String> collectExpandedQueryMap, org.molgenis.data.Query<org.molgenis.data.Entity> query)A helper function to explain each of the matched attributes returned by the explain-APISet<String>createLexicalSearchQueryTerms(org.molgenis.data.meta.model.Attribute 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.Hits<ExplainedAttribute>findAttributes(org.molgenis.data.meta.model.EntityType sourceEntityType, Set<String> queryTerms, Collection<org.molgenis.ontology.core.model.OntologyTerm> ontologyTerms)public for testabilityEntityTypeSearchResultsfindAttributes(org.molgenis.data.meta.model.EntityType sourceEntityType, org.molgenis.data.meta.model.EntityType targetEntityType, Set<String> searchTerms)Findattributesin a sourceentity typethat match attributes in a target entity type.AttributeSearchResultsfindAttributes(org.molgenis.data.meta.model.EntityType sourceEntityType, org.molgenis.data.meta.model.EntityType targetEntityType, org.molgenis.data.meta.model.Attribute targetAttribute, Set<String> searchTerms)Findattributesin anentity typethat match the given target attribute in the target entity type.Hits<org.molgenis.ontology.core.model.OntologyTerm>findOntologyTerms(org.molgenis.data.meta.model.Attribute attribute, Collection<org.molgenis.ontology.core.model.Ontology> ontologies)Findsontology termsin the given ontologies that can be used to tag an attribute.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.molgenis.semanticsearch.service.SemanticSearchService
findAttributes, findAttributes
-
-
-
-
Constructor Detail
-
SemanticSearchServiceImpl
public SemanticSearchServiceImpl(org.molgenis.data.DataService dataService, org.molgenis.ontology.core.service.OntologyService ontologyService, SemanticSearchServiceHelper semanticSearchServiceHelper, ElasticSearchExplainService elasticSearchExplainService, OntologyTagService ontologyTagService)
-
-
Method Detail
-
findAttributes
public Hits<ExplainedAttribute> findAttributes(org.molgenis.data.meta.model.EntityType sourceEntityType, Set<String> queryTerms, Collection<org.molgenis.ontology.core.model.OntologyTerm> ontologyTerms)
public for testability
-
findAttributes
public EntityTypeSearchResults findAttributes(org.molgenis.data.meta.model.EntityType sourceEntityType, org.molgenis.data.meta.model.EntityType targetEntityType, Set<String> searchTerms)
Description copied from interface:SemanticSearchServiceFindattributesin a sourceentity typethat match attributes in a target entity type. Optionally constrain the search using one or more search terms.- Specified by:
findAttributesin interfaceSemanticSearchService
-
findAttributes
public AttributeSearchResults findAttributes(org.molgenis.data.meta.model.EntityType sourceEntityType, org.molgenis.data.meta.model.EntityType targetEntityType, org.molgenis.data.meta.model.Attribute targetAttribute, Set<String> searchTerms)
Description copied from interface:SemanticSearchServiceFindattributesin anentity typethat match the given target attribute in the target entity type. Optionally constrain the search using one or more search terms.- Specified by:
findAttributesin interfaceSemanticSearchService
-
createLexicalSearchQueryTerms
public Set<String> createLexicalSearchQueryTerms(org.molgenis.data.meta.model.Attribute 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. If the user defined searchTerms exist, the targetAttribute information will not be used.- Returns:
- list of queryTerms
-
convertAttributeToExplainedAttribute
public Set<ExplainedQueryString> convertAttributeToExplainedAttribute(org.molgenis.data.meta.model.Attribute attribute, Map<String,String> collectExpandedQueryMap, org.molgenis.data.Query<org.molgenis.data.Entity> query)
A helper function to explain each of the matched attributes returned by the explain-API- Parameters:
attribute- The attribute foundcollectExpandedQueryMap- ?query- the query used to find the attribute- Returns:
- Set of explained query strings
-
findOntologyTerms
public Hits<org.molgenis.ontology.core.model.OntologyTerm> findOntologyTerms(org.molgenis.data.meta.model.Attribute attribute, Collection<org.molgenis.ontology.core.model.Ontology> ontologies)
Description copied from interface:SemanticSearchServiceFindsontology termsin the given ontologies that can be used to tag an attribute.- Specified by:
findOntologyTermsin interfaceSemanticSearchService
-
-