All Projects â†’ bvolpato â†’ mdmlang

bvolpato / mdmlang

Licence: Apache-2.0 license
🔄 Natural Transformation Language for Java

Programming Languages

java
68154 projects - #9 most used programming language
ANTLR
299 projects

Projects that are alternatives of or similar to mdmlang

Flogo
Project Flogo is an open source ecosystem of opinionated event-driven capabilities to simplify building efficient & modern serverless functions, microservices & edge apps.
Stars: ✭ 1,891 (+13407.14%)
Mutual labels:  rules, integration
roadrunner-laravel
Simple bridge between Symfony and RoadRunner.
Stars: ✭ 43 (+207.14%)
Mutual labels:  integration
cdkdx
Zero-config CLI for aws cdk development
Stars: ✭ 31 (+121.43%)
Mutual labels:  rules
lennoxs30
Home Assistant Lennox S30 / E30 / M30 integration
Stars: ✭ 31 (+121.43%)
Mutual labels:  integration
wordpress-vanilla
Official WordPress plugin for Vanilla Forums integration.
Stars: ✭ 18 (+28.57%)
Mutual labels:  integration
detection
Detection in the form of Yara, Snort and ClamAV signatures.
Stars: ✭ 70 (+400%)
Mutual labels:  rules
slack-robot
Simple robot for your slack integration
Stars: ✭ 29 (+107.14%)
Mutual labels:  integration
A41SLBOT
All For One Bot is an open-source discord server bot built for All For One SLâ„¢ discord server.
Stars: ✭ 83 (+492.86%)
Mutual labels:  rules
logzio-python-handler
Python logging handler that sends your logs to Logz.io using the https bulk input
Stars: ✭ 32 (+128.57%)
Mutual labels:  integration
magento2-pimcore-bridge
Magento 2 module for Pimcore integration.
Stars: ✭ 28 (+100%)
Mutual labels:  integration
openintegrationhub
Open Integration Hub
Stars: ✭ 128 (+814.29%)
Mutual labels:  integration
knime-deeplearning
KNIME Deep Learning Integration
Stars: ✭ 19 (+35.71%)
Mutual labels:  integration
HTTPCalloutFramework
HTTP Callout Framework - A light weight callout framework for apex HTTP callouts in Salesforce
Stars: ✭ 43 (+207.14%)
Mutual labels:  integration
StreamLinkerino
Twitch.tv client using only StreamLink, MPV, and Chatterino
Stars: ✭ 26 (+85.71%)
Mutual labels:  integration
hilo
Hilo integration for Home Assistant
Stars: ✭ 26 (+85.71%)
Mutual labels:  integration
HCubature.jl
pure-Julia multidimensional h-adaptive integration
Stars: ✭ 119 (+750%)
Mutual labels:  integration
bearer
Bearer provides all of the tools to build, run and manage API integrations.
Stars: ✭ 22 (+57.14%)
Mutual labels:  integration
pods-beaver-builder-themer-add-on
Integration of Beaver Themer plugin for WordPress (https://pods.io/beaver-themer/)
Stars: ✭ 37 (+164.29%)
Mutual labels:  integration
walkman
Isolate tests from the real world, inspired by Ruby's VCR.
Stars: ✭ 51 (+264.29%)
Mutual labels:  integration
slack neuralyzer
Ruby gem for clean up messages and files on Slack.
Stars: ✭ 58 (+314.29%)
Mutual labels:  cleaner

mdmlang

Apache License Build Status Maven Central Coverage Status

Data transformation language that makes the process of mapping data easier and with a natural syntax. The grammar for this DSL is based on Antlr4.

Available Operations

There is some operations that you are able to use (some variations allowed, please check the grammar file):

  • keep only numbers of field
  • trim field
  • remove leading zeros from field
  • remove 3 chars from left of field
  • substring 2 to 3 of field
  • truncate at 20 field
  • return field

Usage Example

source-data.json

{
    "it-codigo": " my item ",
    "desc-item": " large description that contains more than 20 chars ",
    "num-ddd": 47,
    "num-telefone": "number 9000-1000"
}

mdmlang-rules.txt

itemCode:
    trim it-codigo
    return it-codigo

description:
    trim desc-item
    truncate at 20 desc-item
    return desc-item

phoneNumber:
    trim num-telefone
    keep only numbers of num-telefone
    return num-ddd and num-telefone

Java App:

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Type;
import java.util.Map;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import org.brunocvcunha.mdmlang.processor.MDMProcessorContext;

public class MDMLanguageMain {
    public static void main(String[] args) throws IOException {
        Gson gson = new Gson();

        InputStream rules = MDMLanguageMain.class.getResourceAsStream("/mdmlang-rules.txt");
        InputStream json = MDMLanguageMain.class.getResourceAsStream("/source-data.json");

        MDMProcessorContext ctx = MDMProcessorContext.buildContext(rules);
        Type type = new TypeToken<Map<String, Object>>() {}.getType();

        Map<String, Object> values = gson.fromJson(new InputStreamReader(json), type);
        Map<String, Object> golden = ctx.process(values);

        System.out.println(gson.toJson(golden));
    }
}

Outputs Transformed Data:

{
    "itemCode": "my item",
    "description": "large description th",
    "phoneNumber": "4790001000"
}

Download

(Release still on process)

Download the latest JAR or grab via Maven:

<dependency>
  <groupId>org.brunocvcunha.mdmlang</groupId>
  <artifactId>mdmlang</artifactId>
  <version>1.0</version>
</dependency>

or Gradle:

compile 'org.brunocvcunha.mdmlang:mdmlang:1.0'

Snapshots of the development version are available in Sonatype's snapshots repository.

MDM Lang requires at minimum Java 7.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].