UriParseFunction implements Function { @Override public void apply(final Scope scope, final List<Expression> args, final JsonNode in, final Path ipath, final PathOutput output, final Version version) throws JsonQueryException { Preconditions.checkInputType("uriparse", in, JsonNodeType.STRING); try { final URI uri = new URI(in.asText()); final Result result = new Result(uri, parseQueryObj(scope, uri.getRawQuery())); output.emit(scope.getObjectMapper().valueToTree(result), null); } catch (URISyntaxException e) { throw new JsonQueryException(e); } }  @Override void apply(final Scope scope, final List<Expression> args, final JsonNode in, final Path ipath, final PathOutput output, final Version version);  }
@Test public void test() throws JsonQueryException { final Scope scope = Scope.newEmptyScope(); BuiltinFunctionLoader.getInstance().loadFunctions(Versions.JQ_1_5, scope); new UriParseFunction().apply(scope, Collections.<Expression>emptyList(), new TextNode("http: }