sofie.maxsat
Class HypothesisStore

java.lang.Object
  extended by sofie.maxsat.HypothesisStore

public class HypothesisStore
extends java.lang.Object

Class HypothesisStore This class is part of the SOFIE system (http://mpii.de/yago-naga/sofie). It is licensed under the Creative Commons Attribution-Noncommercial-Share-Alike 3.0 Unported License (http://creativecommons.org/licenses/by-nc-sa/3.0/) by Fabian M. Suchanek (http://suchanek.name). If you use this class for scientific purposes, please cite Fabian M. Suchanek, Mauro Sozio, Gerhard Weikum "SOFIE: A Self-Organizing Framework for Information Extraction" (International World Wide Web Conference 2009) This class stores all hypotheses.


Field Summary
protected static java.util.SortedSet<Hypothesis> hypotheses
          Holds the hypotheses
protected static boolean isGenerating
          A flag that stores whether we are in generation mode
 
Constructor Summary
HypothesisStore()
           
 
Method Summary
static void add(java.util.Collection<Hypothesis> hyps)
          Adds a set of hypotheses to the hypothesis store
static Measures computeMeasures(Hypothesis hyp)
          Computes the measures for a hypothesis
static boolean generateHypotheses()
          Generate hypotheses, return TRUE if any
static Hypothesis getHypothesisToSet()
          Returns the hypothesis that is not set and has highest priority (or null).
static java.util.SortedSet<Hypothesis> hypotheses()
          Returns the set of hypotheses
static void main(java.lang.String[] args)
          Test method
static java.util.List<Hypothesis> matchingUnhappyHypotheses(Literal lit)
          Returns hypotheses that match a literal and that are unsatisfied or unknown.
static int numHypotheses()
          Returns number of hypotheses
static void saveToFile(java.io.File file)
          Writes the hypotheses to a file
static void saveToYAGO()
          Writes the true hypotheses to YAGO, excluding hypotheses with polysems
static void saveToYAGO(long startId)
          Writes the true hypotheses to YAGO, excluding hypotheses with polysems
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hypotheses

protected static java.util.SortedSet<Hypothesis> hypotheses
Holds the hypotheses


isGenerating

protected static boolean isGenerating
A flag that stores whether we are in generation mode

Constructor Detail

HypothesisStore

public HypothesisStore()
Method Detail

hypotheses

public static java.util.SortedSet<Hypothesis> hypotheses()
Returns the set of hypotheses


getHypothesisToSet

public static Hypothesis getHypothesisToSet()
Returns the hypothesis that is not set and has highest priority (or null). Runs linear time.


numHypotheses

public static int numHypotheses()
Returns number of hypotheses


add

public static void add(java.util.Collection<Hypothesis> hyps)
Adds a set of hypotheses to the hypothesis store


matchingUnhappyHypotheses

public static java.util.List<Hypothesis> matchingUnhappyHypotheses(Literal lit)
                                                            throws java.sql.SQLException
Returns hypotheses that match a literal and that are unsatisfied or unknown. Runs log+linear time

Throws:
java.sql.SQLException

saveToYAGO

public static void saveToYAGO()
                       throws java.lang.Exception
Writes the true hypotheses to YAGO, excluding hypotheses with polysems

Throws:
java.lang.Exception

saveToYAGO

public static void saveToYAGO(long startId)
                       throws java.lang.Exception
Writes the true hypotheses to YAGO, excluding hypotheses with polysems

Throws:
java.lang.Exception

saveToFile

public static void saveToFile(java.io.File file)
                       throws java.io.IOException
Writes the hypotheses to a file

Throws:
java.io.IOException

computeMeasures

public static Measures computeMeasures(Hypothesis hyp)
                                throws java.sql.SQLException
Computes the measures for a hypothesis

Throws:
java.sql.SQLException

generateHypotheses

public static boolean generateHypotheses()
                                  throws java.sql.SQLException
Generate hypotheses, return TRUE if any

Throws:
java.sql.SQLException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Test method

Throws:
java.lang.Exception