News for hackers. Stuff that matters.
Re:Show HN: JSON Query: A tool to query JSON data structures by geonik on Saturday January 10, 2015 @05:03AM (#8866438)
XPath for JSON? Who would have thought of that! Now add namespaces and you reinvented XML 10 years later
Re:Show HN: JSON Query: A tool to query JSON data structures by oneeyedpigeon on Saturday January 10, 2015 @06:25AM (#8866582)
Except that, with certain caveats, XML has a slightly nicer syntax for text-heavy documents, and JSON is slightly nicer for hardcore data representation. For example, I'd much rather have a web page in HTML than JSON, but I'd rather have a config file in the latter.
Re:Show HN: JSON Query: A tool to query JSON data structures by thechao on Saturday January 10, 2015 @10:43AM (#8866975)
There is a fairly straightforward generalization of the 'axis' concept to allow graph traversal: 'GPath'. (You have to add an annotation for a traversal kind, and an identifier for a property map.) XPath can be straightforwardly desugared to GPath. I implemented this years ago for an EDG IPR[1] back-end, hooked up a number of 'standard queries' over C++ to Todd Veldhuizen's live OpenGL force-directed graph-viewer [2], and watched EDG compile code---pretty wild stuff watching expressions 'bloom', and classes 'become referenced', etc.

[1] https://parasol.tamu.edu/pivot/ [2] http://ubietylab.net

Re:Show HN: JSON Query: A tool to query JSON data structures by conorgdaly on Saturday January 10, 2015 @10:21AM (#8866924)
Probably most people would have thought of it.

You wouldn't make that same comparison with regular expressions(tool) and a text document(data) would you? As in, the tool is not part and parcel of the data.

XPath(and JSONPath) are powerful tools for programatically pulling data from complex data structures.

Re:Show HN: JSON Query: A tool to query JSON data structures by eCa on Saturday January 10, 2015 @05:14AM (#8866469)
Re:Show HN: JSON Query: A tool to query JSON data structures by emmelaich on Saturday January 10, 2015 @08:12AM (#8866685)
How about Xpath for every configuration file?

    http://augeas.net/