Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade resultset syntax to support JSONPath #573

Open
sggraham32 opened this issue Dec 4, 2012 · 0 comments
Open

upgrade resultset syntax to support JSONPath #573

sggraham32 opened this issue Dec 4, 2012 · 0 comments

Comments

@sggraham32
Copy link

I am trying to build a ql.io script to transform various atom:feeds into JSON objects tailored for my Javascript applications.

Attached is a file containing a simple test feed (3 entries) that I put in a "testfeeds" directory in my local tomcat webapp directory for testing an to illustrate my question. (this file is attached in a post to ql.io discussion thread https://groups.google.com/forum/#!topic/qlio/88gb1mMfRds)

I would like to create a table that contains just the child content of the atom:content elements.

What I can do:
create table test.feed on select get from "http://localhost:8080/testfeed/test.xml";
select '$.atom:feed.atom:entry[*].atom:content.vsc:Thing' from test.feed;

The above script gives me the feed I want: an array of "Thing" resource representations serialized in JSON.

I would prefer to use something like:
create table test.feed on select get from "http://localhost:8080/testfeed/test.xml"
resultset "$.atom:feed.atom:entry[*].atom:content.vsc:Thing";

That way, downstream scripts are simpler and don't have to filter out the atom related markup surrounding the content I want to provide.

The best I have been able to do is to use a resultset using "atom:feed.atom:entry", but of course, because atom:entry is serialized as a JSON array, that is as far as I can go without JSONPath syntax.

Is there any chance that resultset clause syntax could be upgraded to be symmetric with the JSONPath capability available in the select statement?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant