Class WikidataEmbeddingLinker
java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.external.wikidata.WikidataEmbeddingLinker
- All Implemented Interfaces:
LabelToConceptLinker
,MultiConceptLinker
public class WikidataEmbeddingLinker
extends Object
implements LabelToConceptLinker, MultiConceptLinker
Link to Wikidata embeddings using the "normal" Wikidata linker (
WikidataLinker
.
This linker is suited for RDF2Vec Light embeddings.
The linker is conceptually similar to
DBpediaEmbeddingLinker
.-
Field Summary
Modifier and TypeFieldDescriptionprivate String
private static final org.slf4j.Logger
Set of URIs for which an embedding is available.Just for debugging and analysis: A data structure to store URIs that were not found.private static final WikidataLinker
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet instance specific name of the linker.Given a link, multiple identifiers may be returned.boolean
isMultiConceptLink
(String link) Determine whether the link at hand is a multi-concept link.linkToPotentiallyMultipleConcepts
(String labelToBeLinked) This method tries to linklabelToBeLinked
to one concept if possible.linkToSingleConcept
(String labelToBeLinked) Queries for a concept and returns a link that represents an entity in the background knowledge source such as theSemanticWordRelationDictionary
.void
setNameOfLinker
(String nameOfLinker) Set instance specific name of the linker.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
WIKIDATA_LINKER
-
uris
Set of URIs for which an embedding is available. -
linkerName
-
urisNotFound
Just for debugging and analysis: A data structure to store URIs that were not found.
-
-
Constructor Details
-
WikidataEmbeddingLinker
Constructor- Parameters:
filePathToEntityFile
- A file holding the URIs for which an embedding exists.
-
-
Method Details
-
linkToSingleConcept
Description copied from interface:LabelToConceptLinker
Queries for a concept and returns a link that represents an entity in the background knowledge source such as theSemanticWordRelationDictionary
. 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 interfaceLabelToConceptLinker
- Parameters:
labelToBeLinked
- The label which shall be linked to a single concept.- Returns:
- Concept or null if no link could be found.
-
linkToPotentiallyMultipleConcepts
Description copied from interface:LabelToConceptLinker
This method tries to linklabelToBeLinked
to one concept if possible. If it fails, it will try to link it to multiple concepts.- Specified by:
linkToPotentiallyMultipleConcepts
in interfaceLabelToConceptLinker
- 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
Description copied from interface:LabelToConceptLinker
Get instance specific name of the linker.- Specified by:
getNameOfLinker
in interfaceLabelToConceptLinker
- Returns:
- Name as String.
-
setNameOfLinker
Description copied from interface:LabelToConceptLinker
Set instance specific name of the linker.- Specified by:
setNameOfLinker
in interfaceLabelToConceptLinker
- Parameters:
nameOfLinker
- Name to be set.
-
getUrisNotFound
-
getUris
Description copied from interface:MultiConceptLinker
Given a link, multiple identifiers may be returned.- Specified by:
getUris
in interfaceMultiConceptLinker
- Parameters:
multiConceptLink
- The link.- Returns:
- Multiple concepts (typically URIs).
-
isMultiConceptLink
Description copied from interface:MultiConceptLinker
Determine whether the link at hand is a multi-concept link.- Specified by:
isMultiConceptLink
in interfaceMultiConceptLinker
- Parameters:
link
- Link to be checked.- Returns:
- True if multi-concept link, else false.
-