org.molgenis.semanticsearch.service.SemanticSearchService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of molgenis-semantic-search Show documentation
Show all versions of molgenis-semantic-search Show documentation
Semantic data search service functionality.
The newest version!
package org.molgenis.semanticsearch.service;
import static java.util.Collections.emptySet;
import java.util.Collection;
import java.util.Set;
import org.molgenis.data.meta.model.Attribute;
import org.molgenis.data.meta.model.EntityType;
import org.molgenis.ontology.core.model.Ontology;
import org.molgenis.ontology.core.model.OntologyTerm;
import org.molgenis.semanticsearch.explain.bean.AttributeSearchResults;
import org.molgenis.semanticsearch.explain.bean.EntityTypeSearchResults;
import org.molgenis.semanticsearch.semantic.Hits;
public interface SemanticSearchService {
/**
* Find {@link Attribute attributes} in a source {@link EntityType entity type} that match
* attributes in a target entity type.
*/
default EntityTypeSearchResults findAttributes(
EntityType sourceEntityType, EntityType targetEntityType) {
return findAttributes(sourceEntityType, targetEntityType, emptySet());
}
/**
* Find {@link Attribute attributes} in an {@link EntityType entity type} that match the given
* target attribute in the target entity type. Optionally constrain the search using one or more
* search terms.
*/
AttributeSearchResults findAttributes(
EntityType sourceEntityType,
EntityType targetEntityType,
Attribute targetAttribute,
Set searchTerms);
/**
* Find {@link Attribute attributes} in a source {@link EntityType entity type} that match
* attributes in a target entity type. Optionally constrain the search using one or more search
* terms.
*/
EntityTypeSearchResults findAttributes(
EntityType sourceEntityType, EntityType targetEntityType, Set searchTerms);
/**
* Finds {@link OntologyTerm ontology terms} in the given ontologies that can be used to tag an
* attribute.
*/
Hits findOntologyTerms(Attribute attribute, Collection ontologies);
}