14
14
import org .apache .jena .sparql .core .TriplePath ;
15
15
import org .apache .jena .sparql .core .Var ;
16
16
import org .apache .jena .sparql .graph .PrefixMappingZero ;
17
+ import org .apache .jena .sparql .serializer .SerializationContext ;
17
18
import org .apache .jena .sparql .syntax .ElementPathBlock ;
18
19
import org .apache .jena .sparql .util .FmtUtils ;
19
20
import org .slf4j .Logger ;
@@ -265,13 +266,17 @@ private void continueReasoningForward(eu.knowledge.engine.reasoner.api.BindingSe
265
266
* @param bs a reasoner bindingset
266
267
* @return a ke bindingset
267
268
*/
268
- private BindingSet translateBindingSetFrom (eu .knowledge .engine .reasoner .api .BindingSet bs ) {
269
+ protected BindingSet translateBindingSetFrom (eu .knowledge .engine .reasoner .api .BindingSet bs ) {
269
270
BindingSet newBS = new BindingSet ();
270
271
Binding newB ;
272
+
273
+ SerializationContext context = new SerializationContext ();
274
+ context .setUsePlainLiterals (false );
275
+
271
276
for (eu .knowledge .engine .reasoner .api .Binding b : bs ) {
272
277
newB = new Binding ();
273
278
for (Map .Entry <Var , Node_Concrete > entry : b .entrySet ()) {
274
- newB .put (entry .getKey ().getName (), FmtUtils .stringForNode (entry .getValue ()));
279
+ newB .put (entry .getKey ().getName (), FmtUtils .stringForNode (entry .getValue (), context ));
275
280
}
276
281
newBS .add (newB );
277
282
}
@@ -284,7 +289,7 @@ private BindingSet translateBindingSetFrom(eu.knowledge.engine.reasoner.api.Bind
284
289
* @param bs a ke bindingset
285
290
* @return a reasoner bindingset
286
291
*/
287
- private eu .knowledge .engine .reasoner .api .BindingSet translateBindingSetTo (BindingSet someBindings ) {
292
+ protected eu .knowledge .engine .reasoner .api .BindingSet translateBindingSetTo (BindingSet someBindings ) {
288
293
289
294
eu .knowledge .engine .reasoner .api .BindingSet newBindingSet = new eu .knowledge .engine .reasoner .api .BindingSet ();
290
295
eu .knowledge .engine .reasoner .api .Binding newBinding ;
@@ -432,7 +437,8 @@ public CompletableFuture<eu.knowledge.engine.reasoner.api.BindingSet> handle(
432
437
});
433
438
434
439
} catch (IOException e ) {
435
- LOG .warn ("Errors like '{}' should not occur while sending: {}" , e .getMessage (), askMessage .getMessageId ());
440
+ LOG .warn ("Errors like '{}' should not occur while sending: {}" , e .getMessage (),
441
+ askMessage .getMessageId ());
436
442
LOG .debug ("" , e );
437
443
bsFuture = new CompletableFuture <eu .knowledge .engine .reasoner .api .BindingSet >();
438
444
bsFuture .complete (new eu .knowledge .engine .reasoner .api .BindingSet ());
@@ -494,7 +500,8 @@ public CompletableFuture<eu.knowledge.engine.reasoner.api.BindingSet> handle(
494
500
});
495
501
496
502
} catch (IOException e ) {
497
- LOG .warn ("Errors like '{}' should not occur while sending: {}" , e .getMessage (), postMessage .getMessageId ());
503
+ LOG .warn ("Errors like '{}' should not occur while sending: {}" , e .getMessage (),
504
+ postMessage .getMessageId ());
498
505
LOG .debug ("" , e );
499
506
bsFuture = new CompletableFuture <eu .knowledge .engine .reasoner .api .BindingSet >();
500
507
bsFuture .complete (new eu .knowledge .engine .reasoner .api .BindingSet ());
0 commit comments