Open larsga opened 5 years ago
Hello, I've been working last 6 months on a commercial project and I've decided to use JSLT there. This library is much better than JOLT for sure. We have about 15 JSLT templates 5 to 50 lines long, but we expect that these numbers can grow in future. Unfortunately I cannot share more info right now.
Hi, I'm currently using JSLT in a project to transform JSON pulled from MongoDB, and apply some transformations before indexing it into Elasticsearch.
These guys are using JSLT, and will apparently publish an article about it https://medium.com/@FranziCros/throwing-down-the-gauntlet-to-the-data-quality-with-data-schemas-7f702d47114
Hey, I took interest in this project, because there aren't many projects for persisting json transforms. Ultimately I had issues with the input files not being valid json and had to go another route. I've got some recommendations. Lmk if you are interested.
Yeah, if you don't have valid JSON then JSLT isn't going to help you much.
Recommendations would be interesting!
Hey @larsga!
We've just published an article about how are we using JSLT expressions at Alpha Health for Evolving and anonymizing our data.
The Datum VEA - Validate, Evolve and Anonymize your data with Data Schemas
Sorry larsga, I should rephrase; I have valid json for my inputs. However, the jslt transform files themselves are not valid json and this is a limitation.
Microsoft has produced a json transformation spec and implemented it in .NET, which is similar to what you've produced, except it reads in transform files that are themselves json. This is valuable because I want to auto-generate transform files.
I am working on a large Apigee initiative, which is basically an api proxy product from Google. We will use Swagger/OAS to define APIs and require Swagger specs for each API we front. We will be source tracking multiple versions of these swagger files and we need transforms to re-apply revisions to future updates for incoming specifications. Automated json transforms will be part of our governance of these specifications.
Here's the Microsoft project: https://github.com/Microsoft/json-document-transforms
It's not well known, but I think a lot of java developers would find this useful. Perhaps jslt could be expanded to accept Microsoft's input spec?
Also, great work so far on jslt. Formalized json transformation is needed in development. Unfortunately, many people have settled for imperative transformation, which is not ideal. This is much better than trying to learn/use xslt (which I also looked into) for json transformations.
Hi Lars Marius! We've started using JSLT in our data platform project for the City of Oslo, of course :-) We're planning to use it for transforming JSON event data, as well as data pipeline configuration templates. In addition, we've built a library for CSV transformation on top of JSLT, which we are planning to open source at some point.
@afranzi Thank you! :)
@vector623 Not making the syntax be JSON was a deliberate choice on my part. I originally did a few designs with a JSON syntax, but they all came out clumsy and awkward to write by hand.
I wasn't aware of that Microsoft project, but it looks very similar to JOLT. Basically, JOLT is one of the things that made me decide to develop JSLT, because JOLT didn't have anything like the expressive power we needed for our transforms. In addition to being rather clumsy. So to be honest it's not something I'm interested in supporting, since it would be a long step backwards.
What could be done, however, is to develop a JSON syntax for JSLT that parses to the same object structure that's used for JSLT now. The question is whether it's worth the effort.
@fredriv That's really nice to hear! :-) That CSV transformation thing sounds interesting. Looking forward to seeing it open sourced.
I stumbled over JSLT about two month ago (June 2019). I could not use it immediatly as I had other concerns, so the first "milestone" of the project I basically manually transformed my incoming JSON with Jackson (node traversals based on Consumer
Now as the second part of the project is starting I'm "fiddeling" with JSLT :D unfortunately I have problems working on arrays that are nested inside of objects.
I'm working for http://www.iab.de/ We transfer internal data as Json to external destinations where it is prepared for publications etc. During that I have to transform and filter the JSON I receive before I forward it.
@larsga , we talk about JSLT in our Data Council talk :) VEA: Validating, Evolving & Anonymizing Data in Real Time | Alpha Health (Youtube)
Thanks, @afranzi! 👍
Hi @larsga, I started using JSLT for a general usage API that allows creation of unified unstructured data repositories and then creating data-mapping (basically JSLT templates) that produces well-defined data hierarchies published to topics, that may be used to populate specific/vertical repositories.
@fsanti68 That sounds very interesting. I was hoping people would start using JSLT for this sort of thing. Is your project open source? It would be interesting to have a look at it.
Hi @larsga, I've started using jslt in the context of JSON Event Sourcing, which uses Kafka Streams. The first microservice that transforms JSON is going to be put in production soon.
@larsga Hi! Interesting project, can you tell us what's with the jslt performance? I'm interested in the case of a lot of small json files
@eutkin At Schibsted we used JSLT in a pipeline that processed 1.2 billion events (small JSON files) every day. It ran something like 9-12 billion transforms a day. We couldn't do that on a single machine, obviously, but performance was not obviously worse than the earlier handwritten transforms.
That's probably not the answer you were looking for, but I don't know of anything that will give you a precise answer other than basically doing some benchmark tests yourself.
I think such issue have to be pinned, as more folks will encounter it and share their experience
@up-to-you I didn't know that was possible. Done now. Thanks!
We are using JSLT for transforming an input JSON to another format and also sometimes to enrich the JSON with additional data. So far we have a few templates only, but we find it the best tool for JSON transformation so far. To add to it, we are using it along with Camel. Glad Camel has Integration with JSLT in-built.
Hi We (www.atex.com) currently use JSLT in our Camel Library, injecting the templates dynamically per route. We have 3 additional functions, 2 of which are domain specific, but the third, a replace-all function which allows regex capture group string replacement.
We're investigating JSLT for use with our legacy adapter solution that processes fixed-width format files using JRecord. The output of JRecord is JSON (via CobolToJson), which we've integrated into Camel as a streaming record iterator. We needed an easy way to transform from the record-specific JSON structure to our enterprise canonical JSON format. One requirement is that we didn't want to go the JSON->POJO->MapStruct->POJO->JSON route. We've investigated AtlasMap.io but found the editor and overall features to be limited. MapNeat seemed like a powerful alternative, but still required more coding than we wanted for simple mappings. I was poking around the Camel documentation and stumbled across JSLT, which I'd never seen before!
I've got a simple JSLT map working with our Camel legacy file processor and, so far, I'm quite satisfied. I've encountered a few issues (likely my lack of experience with JSLT), primarily around if/else statements but everything else seems quite straightforward. I did have a question though, which I've posted in the Discussions section.
Thanks again for this excellent project.
I was using jslt templates in java to map large json datasets to smaller subsets(kind of mapping without the need for pojo) Recently I moved out from java to golang. I was trying to find out it's implementation in golang,but none. Is there any alternative if folks can suggest
Hey folks!
I came across JSLT by using the JSLTTransformJSON processor in Apache NiFi. While JSLT itself proved to be a very useful tool, testing the transforms in NiFi was a bit cumbersome and using the JSLT playground came with a lot of copypasting.
So I wrapped the JSLT java package into a CLI using picocli and compiled that into a static native executable using GraalVM and native-image. For those interested in the cli, the source code and releases can be found here: https://github.com/LeadingMoominExpert/jslt-cli
Thank you for this project, JSTL has been very enjoyable.
I'd like to list users of JSLT in the readme, but to do that I need to know who they are. If you're using JSLT in your software, please post a comment here to let us know.