|
I am not super-familiar with jsonata, so someone else can probably comment better here. That said, I think the biggest difference is Jsonata is really oriented towards querying, as evidenced by it's xpath oriented syntax. DTL can do querying, but it's really made for data transformation, as evidenced by it's more JSON oriented syntax. I also think DTL is significantly more approachable and familiar and therefore easy to learn and make use of. (I think xpath is terribly obtuse and unintuitive, personally) DTL is also made to be self-contained. A single entrypoint in your javascript code, `DTL->apply_transform()' can process any transform you can create. DTL is extremely powerful, but it's deceptively simple, and you only need to learn as much as you need for the task at hand. It has no real special syntax you haven't encountered before, and it has no special modes. It has the capability to do things like map / reduce / grouping, etc. But it accomplishes this in a very functional-form, requiring no special syntax beyond what you would already use to get a string length, for example. DTL also has a number of builtins that are very helpful when remapping data that you would otherwise have to implement yourself. And the entirety of any DTL transform can go wherever you can put a JSON block, including in your db or a config file, which makes it significantly easier to make use of in your projects. DTL also has a very sophisticated CLI tool, allowing you to make direct use of it without writing any code whatsoever, so you can start working with your data immediately, without having to learn much at all. DTL also has a great REPL that lets you play with the syntax, complete with full help within the REPL. In a general sense, DTL predates Jsonata by several years (originally created in 2012) and has been in use that entire time, though I only published to npm a little over a year ago. SO.. TL;DR: * Made for transforming complex data in and out, not just querying * Much easier to use and more familiar * Really useful builtin functions * more approachable, use as much or as little as you need * Embeddable * Great CLI tools But, to be fair, I am a little biased. ;) |