Class WaldoCandidateGenerator

  • All Implemented Interfaces:
    CandidateGenerator, java.util.function.Function<Span,​java.util.List<CandidateMention>>

    public class WaldoCandidateGenerator
    extends java.lang.Object
    implements CandidateGenerator
    Uses Waldo to search for entities that match with the mention.
     
    
      SELECT DISTINCT ?subj
      FROM <tag:stardog:api:context:all>
      WHERE {
          ?subj ?prop ?object .
          (?object ?score) stardog:textMatch (?query ?threshold)
          MINUS { [] bites:hasEntity ?subj }
      }
      ORDER BY DESC(?score)
     
     
    Since:
    5.2
    Version:
    5.2
    Author:
    Pedro Oliveira
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<CandidateMention> apply​(Span theMention)  
      protected SelectQuery query​(java.lang.String theText)
      Create waldo query, based on given parameters
      void setContexts​(IRI... theContexts)  
      void setLimit​(int theLimit)
      Set the maximum amount of candidates generated for a mention
      void setThreshold​(double theThreshold)
      Set the minimum score of an entity in order for it be considered a candidate
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.function.Function

        andThen, compose
    • Constructor Detail

      • WaldoCandidateGenerator

        public WaldoCandidateGenerator​(Connection theConnection)
    • Method Detail

      • setLimit

        public void setLimit​(int theLimit)
        Set the maximum amount of candidates generated for a mention
      • setThreshold

        public void setThreshold​(double theThreshold)
        Set the minimum score of an entity in order for it be considered a candidate
      • setContexts

        public void setContexts​(IRI... theContexts)
      • query

        protected SelectQuery query​(java.lang.String theText)
        Create waldo query, based on given parameters