JSON – Paolo Redaelli https://monodes.com/predaelli A civil engineer with a longlife fondness for Software Libero Sun, 24 Mar 2024 17:43:12 +0000 en-US hourly 1 https://wordpress.org/?v=6.7.2 91795679 DuckDB as the New jq https://monodes.com/predaelli/2024/03/24/duckdb-as-the-new-jq/ https://monodes.com/predaelli/2024/03/24/duckdb-as-the-new-jq/#respond Sun, 24 Mar 2024 17:43:09 +0000 https://monodes.com/predaelli/?p=11513

Recently, I’ve been interested in the DuckDB project (like a SQLite geared towards data applications). And one of the amazing features is that it has many data importers included without requiring extra dependencies. This means it can natively read and parse JSON as a database table, among many other formats.

I work extensively with JSON day to day, and I often reach for jq when exploring documents. I love jq, but I find it hard to use. The syntax is super powerful, but I have to study the docs anytime I want to do anything beyond just selecting fields.

Once I learned DuckDB could read JSON files directly into memory, I realized that I could use it for many of the things where I’m currently using jq. In contrast to the complicated and custom jq syntax, I’m very familiar with SQL and use it almost daily.

Source: DuckDB as the New jq

]]>
https://monodes.com/predaelli/2024/03/24/duckdb-as-the-new-jq/feed/ 0 11513
JSON references https://monodes.com/predaelli/2016/01/26/json-references/ https://monodes.com/predaelli/2016/01/26/json-references/#respond Tue, 26 Jan 2016 20:39:43 +0000 http://monodes.com/predaelli/?p=924

Is there a standard way of referencing objects by identity in JSON? For example, so that graphs and other data structures with lots of (possibly circular) references can be sanely serialized/loaded?

From: JSON: Standard way of referencing an object by identity (for, eg, circular references)? – Stack Overflow

Then there’s an expired yet interesting Internet-Draft used in JSON Schema and Swagger and a Python module giving us this example:

{
“foo”: {“$ref”: “#/bar”},
“bar”: true
}

that would be resolved as:

{
  "foo": true,
  "bar": true
}
]]>
https://monodes.com/predaelli/2016/01/26/json-references/feed/ 0 924