Skip to content

Commit a22412f

Browse files
committed
Fixed qanaryMesssage null when first approach fails
1 parent 070c645 commit a22412f

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

qanary-component-QB-BirthDataWikidata/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>eu.wdaqua.qanary.component</groupId>
77
<artifactId>qanary-component-QB-BirthDataWikidata</artifactId>
8-
<version>3.4.2</version>
8+
<version>3.4.3</version>
99
<parent>
1010
<groupId>eu.wdaqua.qanary</groupId>
1111
<artifactId>qa.qanarycomponent-parent</artifactId>

qanary-component-QB-BirthDataWikidata/src/main/java/eu/wdaqua/component/qb/birthdata/wikidata/BirthDataQueryBuilder.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -142,21 +142,21 @@ public QanaryMessage process(QanaryMessage myQanaryMessage) throws Exception {
142142
this.myQuestion = myQanaryQuestion.getTextualRepresentation(); // get the question as String
143143

144144
// STEP 1-3 have two options
145-
145+
QanaryMessage qanaryMessageNew = myQanaryMessage;
146146
// first, try to use a named entity annotation because it is more precise if it
147147
// works, then stop
148-
myQanaryMessage = this.processForExistingNamedEntity(myQanaryMessage);
149-
if (myQanaryMessage != null) {
148+
qanaryMessageNew = this.processForExistingNamedEntity(myQanaryMessage);
149+
if (qanaryMessageNew != null) {
150150
logger.info("Found a named entity annotation. Processing finished.");
151-
return myQanaryMessage;
151+
return qanaryMessageNew;
152152
}
153153

154-
// second, let's try to find a firstname and lastname, if that works we stop
155-
myQanaryMessage = this.processForFirstNameAndLastName(myQanaryMessage);
156-
if( myQanaryMessage != null ) {
157-
logger.info("Found firstname and lastname. Processing finished.");
158-
return myQanaryMessage;
159-
}
154+
// second, let's try to find a firstname and lastname, if that works we stop
155+
qanaryMessageNew = this.processForFirstNameAndLastName(myQanaryMessage);
156+
if( qanaryMessageNew != null ) {
157+
logger.info("Found firstname and lastname. Processing finished.");
158+
return qanaryMessageNew;
159+
}
160160

161161
logger.warn("Nothing could be done here.");
162162
return myQanaryMessage;

0 commit comments

Comments
 (0)