Class IDLabelDistance
- java.lang.Object
 - 
- com.complexible.stardog.docs.nlp.impl.IDLabelDistance
 
 
- 
- All Implemented Interfaces:
 FeatureGenerator,java.util.function.Consumer<CandidateMention>
public class IDLabelDistance extends java.lang.Object implements FeatureGenerator
Measures the string distance between the mention and the label/ID of the candidate IRI. Labels are acquired through a SPARQL query, such as:SELECT * FROM <tag:stardog:api:context:all> WHERE { OPTIONAL { ?subj rdfs:label ?0 } OPTIONAL { ?subj foaf:name ?1 } OPTIONAL { ?subj dc:title ?2 } }- Since:
 - 5.2
 - Version:
 - 5.2
 - Author:
 - Pedro Oliveira
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static IRI[]DEFAULT_CONTEXTSstatic IRI[]DEFAULT_LABEL_PROPERTIESstatic org.apache.lucene.search.spell.StringDistanceDEFAULT_STRING_DISTANCEstatic java.lang.StringID_DISTANCEstatic java.lang.StringLABEL_DISTANCE 
- 
Constructor Summary
Constructors Constructor Description IDLabelDistance(Connection theConnection)IDLabelDistance(Connection theConnection, org.apache.lucene.search.spell.StringDistance theStringDistance, IRI... theLabelProperties) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(CandidateMention theCandidate)IRI[]getContexts()voidsetContexts(IRI... theContexts) 
 - 
 
- 
- 
Field Detail
- 
ID_DISTANCE
public static final java.lang.String ID_DISTANCE
- See Also:
 - Constant Field Values
 
 
- 
LABEL_DISTANCE
public static final java.lang.String LABEL_DISTANCE
- See Also:
 - Constant Field Values
 
 
- 
DEFAULT_STRING_DISTANCE
public static final org.apache.lucene.search.spell.StringDistance DEFAULT_STRING_DISTANCE
 
- 
DEFAULT_CONTEXTS
public static final IRI[] DEFAULT_CONTEXTS
 
- 
DEFAULT_LABEL_PROPERTIES
public static final IRI[] DEFAULT_LABEL_PROPERTIES
 
 - 
 
- 
Constructor Detail
- 
IDLabelDistance
public IDLabelDistance(Connection theConnection)
 
- 
IDLabelDistance
public IDLabelDistance(Connection theConnection, org.apache.lucene.search.spell.StringDistance theStringDistance, IRI... theLabelProperties)
 
 - 
 
- 
Method Detail
- 
getContexts
public IRI[] getContexts()
 
- 
setContexts
public void setContexts(IRI... theContexts)
 
- 
accept
public void accept(CandidateMention theCandidate)
- Specified by:
 acceptin interfacejava.util.function.Consumer<CandidateMention>
 
 - 
 
 -