-
Hi, I'm struggling in parsing a sparql json result string to a TupleQueryResult. Can someone help me out? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Sure, is there some part of the code you'd be willing to share ? FWIW, depending on what you want to achieve, it could be worthwhile to look into some of the Repositories convenience methods (e.g just getting the results as a list: https://rdf4j.org/documentation/programming/repository/#a-tuple-query-in-a-single-line-of-code-the-repositories-utility) |
Beta Was this translation helpful? Give feedback.
-
Hi : ), sorry ... there is not so much code to share. I have a file containing something like this: { and I want to get out of it a TupleQueryResult? |
Beta Was this translation helpful? Give feedback.
-
@hmottestad thank you for the pointer! I managed with SPARQLResultsJSONParser sparqlResultsJSONParser = new SPARQLResultsJSONParser(); |
Beta Was this translation helpful? Give feedback.
@hmottestad thank you for the pointer! I managed with
SPARQLResultsJSONParser sparqlResultsJSONParser = new SPARQLResultsJSONParser();
TupleQueryResultBuilder tupleQueryResultHandler = new TupleQueryResultBuilder();
sparqlResultsJSONParser.setQueryResultHandler(tupleQueryResultHandler);
sparqlResultsJSONParser.parseQueryResult(inputstream);
TupleQueryResult tupleQueryResult = tupleQueryResultHandler.getQueryResult();