private void alert(final String s) { queryEngine.getErrorPrintStream().println("\n" + s + "\n"); }
(resultBuffer, queryResultHistory); recognizerAdapter = new RecognizerAdapter(queryEngine.getErrorPrintStream()) { protected void handleQuery(ListAST ast) throws RippleException { synchronized (mutex) { queryEngine.getErrorPrintStream());
public void evaluate(final Sink<RippleList> sink, final QueryEngine qe, final ModelConnection mc) throws RippleException { Sink<Object> uriSink = v -> sink.accept(mc.list().push(v)); qe.getLexicon().uriForQName(nsPrefix, localName, uriSink, mc, qe.getErrorPrintStream()); } }
public void evaluate(final Sink<RippleList> sink, final QueryEngine qe, final ModelConnection mc) throws RippleException { Sink<Object> uriSink = v -> sink.accept(mc.list().push(v)); qe.getLexicon().resolveKeyword(name, uriSink, mc, qe.getErrorPrintStream()); } }
public void evaluate(final Sink<RippleList> sink, final QueryEngine qe, final ModelConnection mc) throws RippleException { Sink<RippleList> typeSink = l -> { Object type1 = l.getFirst(); Value t = mc.toRDF(type1); if (t instanceof IRI) { Object p = mc.valueOf(value, (IRI) t); sink.accept(mc.list().push(p)); } else { qe.getErrorPrintStream().println("datatype does not map to a URI reference: " + type1); } }; type.evaluate(typeSink, qe, mc); }
public void execute(final QueryEngine qe, final ModelConnection mc) throws RippleException { Collector<RippleList> expressions = new Collector<>(); list.evaluate(expressions, qe, mc); if (expressions.size() == 0) { qe.getErrorPrintStream().println( "Warning: the given expression did not resolve to a value."); } else if (expressions.size() > 1) { qe.getErrorPrintStream().println( "Warning: the given expression resolved to multiple values."); } else { // Note: the first element of the list will also be a list RippleList expr = (RippleList) expressions.iterator().next().getFirst(); //System.out.println( "exprList = " + exprList ); Value id = mc.valueOf(java.net.URI.create(qe.getLexicon().getDefaultNamespace() + name)); expr.setRDFEquivalent(id); mc.internalize(expr); mc.commit(); qe.getLexicon().addURI((IRI) id); mc.getModel().getSpecialValues().put(id, expr); } }
queryEngine = qe; RecognizerAdapter ra = new RecognizerAdapter(qe.getErrorPrintStream()) { protected void handleQuery(final ListAST query) throws RippleException { addCommand(new VisibleQueryCommand(query, queryResultHistory)); qe.getErrorPrintStream());