@@ -92,18 +92,23 @@ public QanaryMessage process(QanaryMessage myQanaryMessage) throws Exception {
92
92
// component
93
93
94
94
QuerySolutionMap bindingsForGetAnnotationOfNamedEntities = new QuerySolutionMap ();
95
- bindingsForGetAnnotationOfNamedEntities .add ("graph" , ResourceFactory .createResource (myQanaryQuestion .getOutGraph ().toASCIIString ()));
96
- bindingsForGetAnnotationOfNamedEntities .add ("hasSource" , ResourceFactory .createResource (myQanaryQuestion .getUri ().toASCIIString ()));
97
- bindingsForGetAnnotationOfNamedEntities .add ("start" , ResourceFactory .createTypedLiteral (String .valueOf (supportedQuestionPrefix .length ()), XSDDatatype .XSDnonNegativeInteger ));
95
+ bindingsForGetAnnotationOfNamedEntities .add ("graph" ,
96
+ ResourceFactory .createResource (myQanaryQuestion .getOutGraph ().toASCIIString ()));
97
+ bindingsForGetAnnotationOfNamedEntities .add ("hasSource" ,
98
+ ResourceFactory .createResource (myQanaryQuestion .getUri ().toASCIIString ()));
99
+ bindingsForGetAnnotationOfNamedEntities .add ("start" , ResourceFactory .createTypedLiteral (
100
+ String .valueOf (supportedQuestionPrefix .length ()), XSDDatatype .XSDnonNegativeInteger ));
98
101
99
102
// get the template of the INSERT query
100
- String sparqlGetAnnotation = this .loadQueryFromFile (FILENAME_GET_ANNOTATION_OF_NAMED_ENTITIES , bindingsForGetAnnotationOfNamedEntities );
103
+ String sparqlGetAnnotation = this .loadQueryFromFile (FILENAME_GET_ANNOTATION_OF_NAMED_ENTITIES ,
104
+ bindingsForGetAnnotationOfNamedEntities );
101
105
logger .info ("sparqlGetAnnotation: {}" , sparqlGetAnnotation );
102
106
ResultSet resultset = triplestoreConnector .select (sparqlGetAnnotation );
103
107
104
108
while (resultset .hasNext ()) {
109
+ logger .info ("Next resultset processing: {}" , resultset );
105
110
QuerySolution tupel = resultset .next ();
106
- int start = tupel . get ( "start" ). asLiteral (). getInt ();
111
+ int start = supportedQuestionPrefix . length ();
107
112
int end = tupel .get ("end" ).asLiteral ().getInt ();
108
113
String dbpediaResource = tupel .get ("hasBody" ).toString ();
109
114
logger .warn ("found matching resource <{}> at ({},{})" , dbpediaResource , start , end );
@@ -165,7 +170,8 @@ public String getInsertQuery(QanaryMessage myQanaryMessage, QanaryQuestion<Strin
165
170
166
171
QuerySolutionMap bindingsForInsert = new QuerySolutionMap ();
167
172
bindingsForInsert .add ("graph" , ResourceFactory .createResource (myQanaryQuestion .getOutGraph ().toASCIIString ()));
168
- bindingsForInsert .add ("targetQuestion" , ResourceFactory .createResource (myQanaryQuestion .getUri ().toASCIIString ()));
173
+ bindingsForInsert .add ("targetQuestion" ,
174
+ ResourceFactory .createResource (myQanaryQuestion .getUri ().toASCIIString ()));
169
175
bindingsForInsert .add ("body" , ResourceFactory .createTypedLiteral (createdDBpediaQuery , XSDDatatype .XSDstring ));
170
176
bindingsForInsert .add ("application" , ResourceFactory .createResource ("urn:qanary:" + this .applicationName ));
171
177
0 commit comments