Package org.aksw.qa.commons.sparql
Class AnswerSyncer
java.lang.Object
org.aksw.qa.commons.sparql.AnswerSyncer
Fires
IQuestions against an endpoint and sets the endpoint's answers as golden answers.- Author:
- jhuth
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidanswer(ThreadedSPARQL sp, IQuestion q)static voidsyncAnswers(List<IQuestion> questions, String endpoint)Retrieves answers for the sparql in all IQuestions from given endpoint, and sets it as goldenAnswers.static voidsyncAnswers(List<IQuestion> questions, String endpoint, int queryTimeoutInSecs)Retrieves answers for the sparql in all IQuestions from given endpoint, and sets it as goldenAnswers.static voidsyncAnswers(IQuestion q, String endpoint)Retrieves answers for the sparql in this IQuestion from given endpoint, and sets it as goldenAnswers.static voidsyncAnswers(IQuestion q, String endpoint, int queryTimeoutInSecs)Retrieves answers for the sparql in this IQuestion from given endpoint, and sets it as goldenAnswers.
-
Constructor Details
-
AnswerSyncer
public AnswerSyncer()
-
-
Method Details
-
syncAnswers
Retrieves answers for the sparql in this IQuestion from given endpoint, and sets it as goldenAnswers.If the resultSet of server is null(e.g. sparql timed out) golden answers will be an empty Set.
Using
syncAnswers(List, String)for multiple questions may increase performance.- Parameters:
q-endpoint- an endpoint e.g.SPARQLEndpoints.DBPEDIA_ORG- Throws:
ExecutionException- e.g. server error, times out, thread gets interrupted....
-
syncAnswers
public static void syncAnswers(IQuestion q, String endpoint, int queryTimeoutInSecs) throws ExecutionExceptionRetrieves answers for the sparql in this IQuestion from given endpoint, and sets it as goldenAnswers.If the resultSet of server is null(e.g. sparql timed out) golden answers will be an empty Set.
Using
syncAnswers(List, String)for multiple questions may increase performance.- Parameters:
q-endpoint- an endpoint e.g.SPARQLEndpoints.DBPEDIA_ORGqueryTimeoutInSecs- Self-explanatory. if ! > 0 it will be ignored. (default 10secs)- Throws:
ExecutionException- e.g. server error, times out, thread gets interrupted....
-
syncAnswers
public static void syncAnswers(List<IQuestion> questions, String endpoint) throws ExecutionExceptionRetrieves answers for the sparql in all IQuestions from given endpoint, and sets it as goldenAnswers.If the resultSet of server is null(e.g. sparql timed out) golden answers will be an empty Set.
- Parameters:
q-endpoint- an endpoint e.g.SPARQLEndpoints.DBPEDIA_ORGqueryTimeoutInSecs- Self-explanatory. if ! > 0 it will be ignored. (default 10secs)- Throws:
ExecutionException- e.g. server error, times out, thread gets interrupted....
-
syncAnswers
public static void syncAnswers(List<IQuestion> questions, String endpoint, int queryTimeoutInSecs) throws ExecutionExceptionRetrieves answers for the sparql in all IQuestions from given endpoint, and sets it as goldenAnswers.If the resultSet of server is null(e.g. sparql timed out) golden answers will be an empty Set.
- Parameters:
q-endpoint- an endpoint e.g.SPARQLEndpoints.DBPEDIA_ORG- Throws:
ExecutionException- e.g. server error, times out, thread gets interrupted....
-
answer
- Throws:
ExecutionException
-