All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.molgenis.ontology.SortaConfig Maven / Gradle / Ivy

Go to download

Plugin module containing SORTA (system for ontology-based re-coding and technical annotation) plugins.

There is a newer version: 8.4.5
Show newest version
package org.molgenis.ontology;

import static java.util.Objects.requireNonNull;

import org.molgenis.data.DataService;
import org.molgenis.ontology.core.ic.OntologyTermFrequencyServiceImpl;
import org.molgenis.ontology.core.meta.OntologyTermSynonymFactory;
import org.molgenis.ontology.roc.InformationContentService;
import org.molgenis.ontology.sorta.meta.OntologyTermHitMetaData;
import org.molgenis.ontology.sorta.service.SortaService;
import org.molgenis.ontology.sorta.service.impl.SortaServiceImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Import(OntologyTermFrequencyServiceImpl.class)
@Configuration
public class SortaConfig {
  private final DataService dataService;
  private final OntologyTermHitMetaData ontologyTermHitMetaData;
  private final OntologyTermSynonymFactory ontologyTermSynonymFactory;

  public SortaConfig(
      DataService dataService,
      OntologyTermHitMetaData ontologyTermHitMetaData,
      OntologyTermSynonymFactory ontologyTermSynonymFactory) {
    System.setProperty("jdk.xml.entityExpansionLimit", "1280000");
    this.dataService = requireNonNull(dataService);
    this.ontologyTermHitMetaData = requireNonNull(ontologyTermHitMetaData);
    this.ontologyTermSynonymFactory = requireNonNull(ontologyTermSynonymFactory);
  }

  @Bean
  public SortaService sortaService() {
    return new SortaServiceImpl(
        dataService,
        informationContentService(),
        ontologyTermHitMetaData,
        ontologyTermSynonymFactory);
  }

  @Bean
  public InformationContentService informationContentService() {
    return new InformationContentService(dataService);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy