From 92b4a07c042c4baaa23bb8433b3bfeb9e969703d Mon Sep 17 00:00:00 2001 From: gadelrab Date: Mon, 13 May 2019 11:44:21 -0700 Subject: [PATCH] pass elastic search url through config files --- Demo | 2 +- FactSpotting | 2 +- .../datastructure/EvidenceNode.java | 31 +++++++++---------- Utils | 2 +- WebService2/conf/factspotting_demo.properties | 2 ++ WebService2/conf/routes | 2 +- scripts/run_webservice2.sh | 6 ++-- 7 files changed, 25 insertions(+), 22 deletions(-) diff --git a/Demo b/Demo index 2038d23..6bb88cb 160000 --- a/Demo +++ b/Demo @@ -1 +1 @@ -Subproject commit 2038d2319674a8dd57e98b3ff479cd6cb75c1cbb +Subproject commit 6bb88cb6e8ae7be8bc0ee6faa80cfb4973a32e8e diff --git a/FactSpotting b/FactSpotting index 886df79..257b5c8 160000 --- a/FactSpotting +++ b/FactSpotting @@ -1 +1 @@ -Subproject commit 886df790e2427b18e3eccb60c0746050bf55c23e +Subproject commit 257b5c823d1d1fabab63064d4ad8adcaddcfd2f6 diff --git a/QueryRewriting/src/main/java/extendedsldnf/datastructure/EvidenceNode.java b/QueryRewriting/src/main/java/extendedsldnf/datastructure/EvidenceNode.java index f94bea5..8cd9171 100755 --- a/QueryRewriting/src/main/java/extendedsldnf/datastructure/EvidenceNode.java +++ b/QueryRewriting/src/main/java/extendedsldnf/datastructure/EvidenceNode.java @@ -24,41 +24,45 @@ */ public class EvidenceNode{ +// @JsonAdapter(ILiteralAdapter.class) + ILiteral queryLiteral; + Enums.ActionType sourceActionType = Enums.ActionType.ORG; // @JsonAdapter(IRuleAdapter.class) private IRule rule; //TODO to be fixed later //@Expose(deserialize = false) //private Map variableBindingMap; private FactSpottingResult textResults; - -// @JsonAdapter(ILiteralAdapter.class) - ILiteral queryLiteral; - Enums.ActionType sourceActionType = Enums.ActionType.ORG; private int treeDepth; private int rulesDepth; private double quality; + public EvidenceNode(ILiteral queryLiteral, Enums.ActionType sourceActionType) { + this.queryLiteral = queryLiteral; + this.sourceActionType = sourceActionType; + } + public IRule getRule() { return rule; } + public void setRule(IRule rule) { + this.rule = rule; + } + public FactSpottingResult getTextResults() { return textResults; } - public void setRule(IRule rule) { - this.rule = rule; + public void setTextResults(FactSpottingResult textResults){ + this.textResults=textResults; + } public void setVariableBindingMap(Map variableBindingMap) { //this.variableBindingMap = variableBindingMap; } - public EvidenceNode(ILiteral queryLiteral, Enums.ActionType sourceActionType) { - this.queryLiteral = queryLiteral; - this.sourceActionType = sourceActionType; - } - public ILiteral getQueryLiteral() { return queryLiteral; } @@ -75,11 +79,6 @@ public void setSourceActionType(Enums.ActionType sourceActionType) { this.sourceActionType = sourceActionType; } - public void setTextResults(FactSpottingResult textResults){ - this.textResults=textResults; - - } - @Override public String toString() { return "Evidence{" + diff --git a/Utils b/Utils index 8754d5d..9a457a3 160000 --- a/Utils +++ b/Utils @@ -1 +1 @@ -Subproject commit 8754d5de9f684aca72942adf346b0c94822f7a0c +Subproject commit 9a457a3e32b63c605165c1fc73c4649724462255 diff --git a/WebService2/conf/factspotting_demo.properties b/WebService2/conf/factspotting_demo.properties index 789527e..0ea3cab 100755 --- a/WebService2/conf/factspotting_demo.properties +++ b/WebService2/conf/factspotting_demo.properties @@ -10,12 +10,14 @@ argumentsDictionaries=/GW/D5data-7/gadelrab/demo_data/dicts/entities_manual.tsv #perItemParaphrases=10 + # Elasticsearch #evidencePerFactSize=5 #only 1 corpus is supported now textCorpora=wiki_sent fieldsToSearch=sent,title elastic.queryStyle=SPLIT_QUERY +elastic.url=http://localhost:36550 matchingThresholdPercentage=90% #bing.cacheFile= diff --git a/WebService2/conf/routes b/WebService2/conf/routes index baa13ec..8a7b57c 100755 --- a/WebService2/conf/routes +++ b/WebService2/conf/routes @@ -7,7 +7,7 @@ GET / controllers.Explanations.index # An example controller showing how to use dependency injection #GET /count controllers.CountController.count # An example controller showing how to write asynchronous code -GET /message controllers.AsyncController.message +#GET /message controllers.AsyncController.message POST / controllers.Explanations.explain diff --git a/scripts/run_webservice2.sh b/scripts/run_webservice2.sh index d61a06f..f576857 100755 --- a/scripts/run_webservice2.sh +++ b/scripts/run_webservice2.sh @@ -1,10 +1,12 @@ #!/usr/bin/env bash +SERVER_ELASTIC=$1 +PORT=$2 #connect to server hosting ELASTIC -ssh -f sedna.mpi-inf.mpg.de -L 9200:localhost:9200 -N +ssh -f $SERVER_ELASTIC -L ${PORT}:localhost:${PORT} -N # we need locations of data and configurations -DEMO_DATA_FOLDER=$1 +DEMO_DATA_FOLDER=$3 echo $DEMO_DATA_FOLDER