Class 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 Detail

      • 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)