An open API service indexing awesome lists of open source software.

https://github.com/ianrae/dnal-lang

DNAL language
https://github.com/ianrae/dnal-lang

data java

Last synced: 23 days ago
JSON representation

DNAL language

Awesome Lists containing this project

README

          

DNAL - Data Needs a Language
=======

A compiler for data. DNAL is a JSON-like language that includes types and data validation rules.
The DNAL compiler validates and transforms your DNAL source into other data formats.

*Latest version*: 0.2.2 (requires Java 8+)

## News
##### 2017-10-04 - Release v0.2.2
* views have been added (inputview and outputview)
* syntax change. comma delimiter in struct members, rules, and views.

##### 2017-05-14 - Release v0.2.1
* compile from stream,
* validation options,
* improved date format support,
* prototype of views feature

##### 2017-03-14 - Release v0.2.0
* 'unique' keyword,
* reflection-based loader,
* many fixes

## User's Guide

[User's Guide](https://dnal-lang.org/documentation/) describes the syntax and Java API.

## Where to get

DNAL is available in maven-central.

## Maven

Add the following fragment to your `` section:


org.dnal-lang
dnal
jar
0.2.2

## Tell me more

DNAL is a language for data. It supports types, relations, and validation rules. Here is a sample:

//define a type
type Person struct {
firstName string,
lastName string,
birthDate date
}
!empty(firstName),
!empty(lastName)
end

//define some values
let customer Person = { 'Gillian', 'Smith', '1965-12-31' }

let people list = [
{ 'Simone', 'Tremblay', '1965-12-31' },
{ 'Jason', 'Ackerman', '1991-01-15' }
]

The *dnalc* compiler converts DNAL into other formats. Use it to create JSON, XML, or to do code generation of bean or DTO classes.
The compiler is extensible; add your own output generators.

The DNAL API is a Java API for loading and querying DNAL data.

## Feature highlights

* all the normal scalar types (int, boolean, string, etc)
* lists and structs
* package and import
* type inheritance

## Uses

* producing valid configuration files (JSON, XML, SQL, etc).
* used as configuration directly by a program
* used for validating data received by a program.
* code generation for creating bean and DTO classes.