java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.external.services.labelToConcept.LinksToFile

public class LinksToFile extends Object
Service class writing the links of a test case / track to a file. (This can be helpful in some situations e.g. when pre-downloading certain external information or for analyses.)
If you are interest in linker coverage, use Coverage.
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
  • Constructor Details

    • LinksToFile

      public LinksToFile()
  • Method Details

    • writeLinksToFile

      public static <T> void writeLinksToFile(@NotNull @NotNull String fileToWrite, @NotNull @NotNull List<T> list, @NotNull @NotNull LabelToConceptLinker linker)
      Write all links of the tracks/testcases to one file (UTF-8 encoded).
      Type Parameters:
      T - T must be Track or TestCase - otherwise this method will not work.
      Parameters:
      fileToWrite - The file that shall be written.
      list - List of tracks or test cases (you cannot mix them).
      linker - The linker that shall be used.
    • writeLinksToFile

      public static <T> void writeLinksToFile(@NotNull @NotNull File fileToWrite, @NotNull @NotNull List<T> list, @NotNull @NotNull LabelToConceptLinker linker)
      Write all links of the tracks/testcases to one file (UTF-8 encoded).
      Type Parameters:
      T - T must be Track or TestCase - otherwise this method will not work.
      Parameters:
      fileToWrite - The file that shall be written.
      list - List of tracks or test cases (you cannot mix them).
      linker - The linker that shall be used.
    • writeLinksToFile

      public static <T> void writeLinksToFile(@NotNull @NotNull File fileToWrite, @NotNull @NotNull List<T> list, @NotNull @NotNull TextExtractor extractor, @NotNull @NotNull LabelToConceptLinker linker, int maxLabelTokenLength)
      Write all links of the tracks/testcases to one file (UTF-8 encoded).
      Type Parameters:
      T - T must be Track or TestCase - otherwise this method will not work.
      Parameters:
      fileToWrite - The file that shall be written.
      list - List of tracks or test cases (you cannot mix them).
      extractor - The extractor that shall be used to extract labels.
      linker - The linker that shall be used.
      maxLabelTokenLength - The maximum token length for token linking (to avoid linking description texts).
    • getLinksTracks

      static Set<String> getLinksTracks(@NotNull @NotNull List<Track> trackList, @NotNull @NotNull TextExtractor extractor, @NotNull @NotNull LabelToConceptLinker linker, int maxLabelTokenLength)
    • writeLinksToFile

      public static void writeLinksToFile(@NotNull @NotNull File fileToWrite, @NotNull @NotNull Track track, @NotNull @NotNull TextExtractor extractor, @NotNull @NotNull LabelToConceptLinker linker, int maxLabelTokenLength)
      Write all links of a track to file (UTF-8 encoded).
      Parameters:
      fileToWrite - The file that shall be written.
      track - The track that shall be linked.
      extractor - The extractor that shall be used to extract labels.
      linker - The linker that shall be used.
      maxLabelTokenLength - The maximum token length for token linking (to avoid linking description texts).
    • getLinksTestcases

      static Set<String> getLinksTestcases(@NotNull @NotNull List<TestCase> testCaseList, @NotNull @NotNull TextExtractor extractor, @NotNull @NotNull LabelToConceptLinker linker, int maxLabelTokenLength)
    • writeLinksToFile

      public static void writeLinksToFile(@NotNull @NotNull File fileToWrite, @NotNull @NotNull TestCase testCase, @NotNull @NotNull TextExtractor extractor, @NotNull @NotNull LabelToConceptLinker linker, int maxLabelTokenLength)
      Write all links of a track to file (UTF-8 encoded).
      Parameters:
      fileToWrite - The file that shall be written.
      testCase - The testCase that shall be linked.
      extractor - The extractor that shall be used to extract labels.
      linker - The linker that shall be used.
      maxLabelTokenLength - The maximum token length for token linking (to avoid linking description texts).
    • getLinks

      static Set<String> getLinks(TestCase testCase, TextExtractor extractor, LabelToConceptLinker linker, int maxLabelTokenLength)
    • getLinksForOntModel

      @NotNull static @NotNull Set<String> getLinksForOntModel(org.apache.jena.ontology.OntModel ontModel, TextExtractor extractor, LabelToConceptLinker linker, int maxLabelTokenLength)
    • getLinksForIterator

      @NotNull static @NotNull Set<String> getLinksForIterator(org.apache.jena.util.iterator.ExtendedIterator<? extends org.apache.jena.ontology.OntResource> iterator, TextExtractor valueExtractor, LabelToConceptLinker linker, int maxLabelTokenLength)
    • getUris

      @NotNull static @NotNull Set<String> getUris(String link, LabelToConceptLinker linker)