Class TextExtractorLabelAndDirectSuperclass

java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.util.textExtractors.TextExtractorLabelAndDirectSuperclass
All Implemented Interfaces:
TextExtractor

public class TextExtractorLabelAndDirectSuperclass extends Object implements TextExtractor
Extracts a label for the given resource and also creates a text for the superclass such that more context is provided.
  • Field Details

    • labelExtractor

      private final TextExtractorOnlyLabel labelExtractor
    • subClassText

      private final String subClassText
    • includeQuotes

      private final boolean includeQuotes
  • Constructor Details

    • TextExtractorLabelAndDirectSuperclass

      public TextExtractorLabelAndDirectSuperclass(String subClassText, boolean includeQuotes)
    • TextExtractorLabelAndDirectSuperclass

      public TextExtractorLabelAndDirectSuperclass()
  • Method Details

    • extract

      public Set<String> extract(org.apache.jena.rdf.model.Resource r)
      Description copied from interface: TextExtractor
      Given a Jena resource this method extracts textual/string representations from it.
      Specified by:
      extract in interface TextExtractor
      Parameters:
      r - the jena resource which also allows to traverse the whole rdf graph
      Returns:
      a set of textual representations of the given resource.
    • getSuperclassLabels

      protected Set<String> getSuperclassLabels(org.apache.jena.rdf.model.Resource r)
      Returns for each superclass at maximum one label. If a label for a super class cannot be extracted, it will also not be in the set.
      Parameters:
      r - the resource to extract the superclass labels
      Returns:
      the superclass labels
    • optionallyQuote

      protected String optionallyQuote(String text)
    • optionallyQuote

      protected Set<String> optionallyQuote(Set<String> texts)