java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.external.dbpedia.DBpediaEmbeddingLinker
All Implemented Interfaces:
LabelToConceptLinker, MultiConceptLinker

public class DBpediaEmbeddingLinker extends Object implements LabelToConceptLinker, MultiConceptLinker
Link DBpedia embeddings using the "normal" DBpedia linker (DBpediaLinker. This linker is suited for RDF2Vec Light embeddings. The linker is conceptually similar to WikidataEmbeddingLinker.
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • dbpediaLinker

      private static DBpediaLinker dbpediaLinker
    • linkerName

      private String linkerName
    • urisNotFound

      private final Set<String> urisNotFound
      Just for debugging and analysis: A data structure to store URIs that were not found.
    • uris

      Set<String> uris
      Set of URIs for which an embedding is available.
  • Constructor Details

    • DBpediaEmbeddingLinker

      public DBpediaEmbeddingLinker(DBpediaLinker linker, @NotNull @NotNull String filePathToUriFile)
      Main Constructor
      Parameters:
      linker - The desired DBpedia linker configuration.
      filePathToUriFile - UTF-8 encoded file holding the URIs for which an embedding exists.
    • DBpediaEmbeddingLinker

      public DBpediaEmbeddingLinker(String filePathToUriFile)
      Constructor
      Parameters:
      filePathToUriFile - UTF-8 encoded file holding the URIs for which an embedding exists.
  • Method Details

    • linkToSingleConcept

      public String linkToSingleConcept(String labelToBeLinked)
      Description copied from interface: LabelToConceptLinker
      Queries for a concept and returns a link that represents an entity in the background knowledge source such as the SemanticWordRelationDictionary. Note that the link may not always be something intuitive such as a URI but may also be an artificial identifier that is understood by the corresponding background knowledge source.
      Specified by:
      linkToSingleConcept in interface LabelToConceptLinker
      Parameters:
      labelToBeLinked - The label which shall be linked to a single concept.
      Returns:
      Concept or null if no link could be found.
    • linkToPotentiallyMultipleConcepts

      public Set<String> linkToPotentiallyMultipleConcepts(String labelToBeLinked)
      Description copied from interface: LabelToConceptLinker
      This method tries to link labelToBeLinked to one concept if possible. If it fails, it will try to link it to multiple concepts.
      Specified by:
      linkToPotentiallyMultipleConcepts in interface LabelToConceptLinker
      Parameters:
      labelToBeLinked - The label which shall be linked.
      Returns:
      One or multiple linked concepts in a set. Null if it could not fully link the label.
    • getNameOfLinker

      public String getNameOfLinker()
      Description copied from interface: LabelToConceptLinker
      Get instance specific name of the linker.
      Specified by:
      getNameOfLinker in interface LabelToConceptLinker
      Returns:
      Name as String.
    • setNameOfLinker

      public void setNameOfLinker(String nameOfLinker)
      Description copied from interface: LabelToConceptLinker
      Set instance specific name of the linker.
      Specified by:
      setNameOfLinker in interface LabelToConceptLinker
      Parameters:
      nameOfLinker - Name to be set.
    • getDbpediaLinker

      public static DBpediaLinker getDbpediaLinker()
    • setDbpediaLinker

      public static void setDbpediaLinker(DBpediaLinker dbpediaLinker)
    • getUrisNotFound

      public Set<String> getUrisNotFound()
    • getUris

      public Set<String> getUris(String multiConceptLink)
      Description copied from interface: MultiConceptLinker
      Given a link, multiple identifiers may be returned.
      Specified by:
      getUris in interface MultiConceptLinker
      Parameters:
      multiConceptLink - The link.
      Returns:
      Multiple concepts (typically URIs).
    • isMultiConceptLink

      public boolean isMultiConceptLink(String link)
      Description copied from interface: MultiConceptLinker
      Determine whether the link at hand is a multi-concept link.
      Specified by:
      isMultiConceptLink in interface MultiConceptLinker
      Parameters:
      link - Link to be checked.
      Returns:
      True if multi-concept link, else false.