What is the Query Builder?

The Query Builder is a browser-based graphical tool that allows users to create and edit filters without them having to become a developer and learn the DataSift Curated Stream Definition Language (CSDL). It started life as an internal project at DataSift where our staff quickly recognized its potential for making the users' lives easier; indeed, it has become very popular with users who like the visual approach to building filters. Despite its visual nature, the Query Builder is a serious tool that can be used to build complex CSDL filters without using DataSift's Code Editor.

If you want to try the Query Builder, log in to your DataSift account, create a new stream and choose the Query Builder as your filter editor.

Under the hood

The Query Builder is written in JavaScript.

It is an independent, embeddable module that anyone can add to their own web page, blog, or a web view in a desktop or mobile application. You can embed the system into third party applicationsand you, because it is configurable, you can create 'private label' versions that match the look and feel of existing pages on a site. Internally, the Query Builder uses an intermediate format called JCSDL to store your filter definitions. Users don't edit JCSDL by hand, it is generated by the Query Builder automatically and compiled into CSDL when you save your filters. Whenever you want to modify your filters created using the Query Builder, the JCSDL code will be updated and turned into CSDL automatically, after you save your changes.

It's Open Source!

Being developers ourselves, we understand how hard and expensive it is to write and test code. We want to help external developers integrate our code and services with their own projects and we have decided to release the Query Builder under an open source license. You are free to use it, modify it, distribute it, and integrate it into your own projects, free or commercial, as long as you follow the licensing terms. Some possible use cases (but certainly not the only ones) could be:

  • Giving your employees an editor they can use to create queries for your customers.
  • Integrating and skinning the Query Builder to match your company's brand.
  • Creating a customized version of the Query Builder that includes additional functionality, such as pre-loaded query templates.
  • Creating a customized version of the Query Builder that allows user to build queries for a limited set of targets only.

For more information, check our implementation and customization guidelines.