Live data from Hacker News

SpahQL - A query language for Javascript objects

angryamoeba.co.uk

11–20 of 37 posts

Re: SpahQL - A query language for Javascript objects

#11
post #9

Cool. This plus xml2js should make the whole process of extracting data from a bunch of 3rd-party xml files I'm currently dealing with a lot easier.

Hope you get some use out of it - don't forget to let me know any issues you have. Also there's some other neat JS-querying systems linked in these comments, so check those out and see which meets your needs!

Re: SpahQL - A query language for Javascript objects

#14

I wish developers would stop copying SQL. It's like making fancy new languages, and then adding libraries that help you emulate COBOL. SQL is not the first, the last, or the best query language ever created, it's just the best marketed. It's not even properly relational, it's based on a series of shell scripts on multics for crying out loud!

Is this not more similar to XPath?

Re: SpahQL - A query language for Javascript objects

#15

This looks interesting, I wonder whether the path syntax would work in URLs.

Can you unpack that question a little for me? As in, could you use a spahql selection as the path component of some request? I don't see why not, but the escaping will probably look a little ugly.

Re: SpahQL - A query language for Javascript objects

#16

I wish developers would stop copying SQL. It's like making fancy new languages, and then adding libraries that help you emulate COBOL. SQL is not the first, the last, or the best query language ever created, it's just the best marketed. It's not even properly relational, it's based on a series of shell scripts on multics for crying out loud!

Please provide some substance to your post. What other options exist? What are some references you've used to work with those options?

Re: SpahQL - A query language for Javascript objects

#17

I wish developers would stop copying SQL. It's like making fancy new languages, and then adding libraries that help you emulate COBOL. SQL is not the first, the last, or the best query language ever created, it's just the best marketed. It's not even properly relational, it's based on a series of shell scripts on multics for crying out loud!

"I wish developers would stop copying SQL"

This really doesn't look much like SQL to me - much more like an interesting variation on XPath...

Why do you think it is a copy of SQL?

Re: SpahQL - A query language for Javascript objects

#19

This looks interesting, I wonder whether the path syntax would work in URLs.

Can you unpack that question a little for me? As in, could you use a spahql selection as the path component of some request? I don't see why not, but the escaping will probably look a little ugly.

Given a url that returns JSON:

  www.example.com/data.json,
one could append SparQL to select a subset

  www.example.com/data.json/user

  www.example.com/data.json/categories/*

  www.example.com/data.json/categories/0/products

  www.example.com/data.json//avatar

Re: SpahQL - A query language for Javascript objects

#20
post #18

Looks far too similarly pronounced to SPARQL ( http://www.w3.org/TR/rdf-sparql-query/ ). Or is that deliberate?

Nope it's completely my fault. SpahQL is so named because it was primarily developed for Spah, another project I'm working on.

I hope I don't cause too much confusion!

Post reply on HN