}
return null;
}
public static Bindings getBindings(final JSONObject oneResult, final BindingsFactory bindingsFactory) throws JSONException{
final Bindings luposResult = bindingsFactory.createInstance();
final Iterator<String> keysIt = oneResult.keys();
while(keysIt.hasNext()){
final String var = keysIt.next();
if(var.compareTo("<Query-Triples>")!=0){
luposResult.add(new Variable(var), getLiteral(oneResult.getJSONObject(var)));
} else {
// This JSONObject contains the query-triples!
// This is no standard and a proprietary feature of LUPOSDATE!
final JSONArray triples = oneResult.getJSONArray(var);
for(int i=0; i<triples.length(); i++){
final JSONObject jsonTriple = triples.getJSONObject(i);
luposResult.addTriple(new Triple(getLiteral(jsonTriple.getJSONObject("subject")), getLiteral(jsonTriple.getJSONObject("predicate")), getLiteral(jsonTriple.getJSONObject("object"))));
}
}
}
return luposResult;
}